Skip to content

Instantly share code, notes, and snippets.

@icostan
Created November 14, 2018 08:09
Show Gist options
  • Save icostan/0029f5f5db19955ef4a6eb90a0c07875 to your computer and use it in GitHub Desktop.
Save icostan/0029f5f5db19955ef4a6eb90a0c07875 to your computer and use it in GitHub Desktop.
Output = Struct.new :value, :lock_script do
def serialize
script_hex = script_to_hex(lock_script)
long_to_hex(value) + byte_to_hex(hex_size(script_hex)) + script_hex
end
end
output_script = bitcoin_script '2N959B4qEPkce8jbzQC7EQaS6uaEBB9YTgQ'
output = Output.new 1_000_000, output_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment