BlockchainTransaction (for Bitcoin)
represents a Bitcoin blockchain transaction built from the components in the association assoc.
- Gives a symbolic representation of a Bitcoin blockchain transaction; it does not submit the transaction, and the transaction is not signed.
- BlockchainTransaction[…][prop] gives the value of the property prop for the transaction.
- The following elements must be given:
"Inputs" list of inputs, given as associations "Outputs" list of outputs, given as associations
- The following additional elements can also be given:
"Version" transaction version number (default: 1) "LockTime" earliest time or block when the transaction may be added (default: 0)
- Each association in the "Inputs" list must have the following entries:
"TransactionID" hash of a previous transaction "Index" index within the previous transaction output
- The following additional entries can also be given:
"ScriptString" "" unlocking script also known as scriptSig "SignatureHash" All signature hash flag
- Possible values for "SignatureHash" include:
All signature applies to all inputs and outputs None signature applies to all inputs, none of the outputs "Single" signature applies to all inputs and the output with the same index number as the signed input "AllAnyoneCanPay" signature applies to one input and all outputs "NoneAnyoneCanPay" signature applies to one input, none of the outputs "SingleAnyoneCanPay" signature applies to one input and the output with the same index number
- For Pay-to-Public-Key-Hash (P2PKH) transactions, each association in the "Outputs" list must have the following entries:
"Amount" amount of bitcoins to be transferred "Address" destination P2PKH address for transfer
- For general Bitcoin transactions, a custom locking script can be given, and each association in the "Outputs" list must have the following entries:
"Amount" amount of bitcoins to be transferred "ScriptString" Bitcoin script in the form of a string
- BlockchainTransaction can represent Bitcoin mainnet (default) and testnet transactions. To specify these networks, use the "BlockchainBase" value inside the required association or the BlockchainBase option.
Examplesopen allclose all
Basic Examples (1)
Custom Nonstandard Scripts (2)
Create a Bitcoin Pay-to-Public-Key-Hash BlockchainTransaction:
Sign the transaction object using a WIF-encoded private key:
Wolfram Research (2019), BlockchainTransaction, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Bitcoin.html.
Wolfram Language. 2019. "BlockchainTransaction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Bitcoin.html.
Wolfram Language. (2019). BlockchainTransaction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Bitcoin.html