BlockchainTransactionSubmit (for Bitcoin)
BlockchainTransactionSubmit[obj]
submits the transaction specified in the BlockchainTransaction object obj to the Bitcoin blockchain.
Details
- BlockchainTransactionSubmit[obj] submits the transaction to a Bitcoin node for inclusion in a future block.
- BlockchainTransactionSubmit will return a BlockchainTransaction object with the added property "TransactionID".
- BlockchainTransactionData can be applied to the result from BlockchainTransactionSubmit to determine if the submitted transaction has been added to the Bitcoin blockchain yet.
- BlockchainTransactionSubmit can submit transactions to the Bitcoin mainnet (default) and testnet. These networks are specified in the BlockchainTransaction object.
Examples
open all close allBasic Examples (1)
Create a Bitcoin Pay-to-Public-Key-Hash BlockchainTransaction:
btcTX = BlockchainTransaction[<|
"Inputs" -> {
<|"TransactionID" -> "79bd95a5c087cfc33904020b3cd31b11b97be7751c8a1ca57c5313d4ac848830", "Index" -> 0|>},
"Outputs" -> {
<|"Amount" -> Quantity[0.005, "Bitcoins"], "Address" -> "mgPhDaCzXcm4gmkxfz9sZKvpabmNGdLj52"|>,
<|"Amount" -> Quantity[0.044, "Bitcoins"], "Address" -> "mkHGstoUaDWzGxag29MEnp8WJPpfA45omK"|>},
"BlockchainBase" -> {"Bitcoin", "Testnet"}|>]Sign the transaction object using a WIF-encoded private key:
btcTXSigned = BlockchainTransactionSign[btcTX, "cVN2fsWXoxMkPGx5EL7X6grykQ3VSDfHPUg3CJhD8AC9pJ5y8Nhi"]Send the signed transaction to the Bitcoin blockchain:
BlockchainTransactionSubmit[btcTXSigned]Possible Issues (1)
Incomplete Multi-signature (1)
Trying to submit a partially signed multi-signature transaction will return a $Failed output:
btcTX = BlockchainTransaction[
<|
"Inputs" -> {<|"TransactionID" -> "b532b504e7f64b08667d0ae4c9549183f63f34c8d8f0c2101bb626eba6deea76", "Index" -> 0|>},
"Outputs" -> {<|"Amount" -> Quantity[0.011478, "Bitcoins"], "Address" -> "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB"|>}
|>,
BlockchainBase -> {"Bitcoin", "Testnet"}
]btcTXPartiallySigned = BlockchainTransactionSign[btcTX, <|"PrivateKeys" -> {PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{51724874525444673739416721101123148946820313131304153131265018986533336040603,
48268731188414227634929888133357578613956172980857119866 ... 2945683748054256803097024204184959830409291338374588,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A3JbPdNVSP2qOQQGZ8L356XoOXtca+x0yN/eJRFyZsSb"],
"PrivateByteArray" -> ByteArray["SpSctIIABYGROtVVkNEK5YJef7vYlAiFJfTuRCsEXbw="]]]}, "PublicKeys" -> {PublicKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1", "Compressed" -> True,
"PublicByteArray" -> ByteArray["A3JbPdNVSP2qOQQGZ8L356XoOXtca+x0yN/eJRFyZsSb"],
"PublicCurvePoint" ->
{51724874525444673739416721101123148946820313131304153131265018986533336040603,
48268731188414227634929888133357578613956172980857119866702680060264360725427}]], PublicKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1", "Compressed" -> True,
"PublicByteArray" -> ByteArray["Au66O1At9hyzPrP7jrH8x3+0Eu+iockh1KM1MemGIOaY"],
"PublicCurvePoint" ->
{107979500881536671708232537632503185481996798629419440902689565824755056043672,
26374548080945029226426206096084022226908831760958577652142947530277320333564}]], PublicKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1", "Compressed" -> True,
"PublicByteArray" -> ByteArray["A2oN92oQNAuhAQWLabDZHbQ8kuwIEtlRPlY5sRPfB66R"],
"PublicCurvePoint" ->
{47969838552476767063979266372986347156581982326487605026895634402235021504145,
106239829386092594197652494795106677088067962409072619345894133053834318874239}]]}, "RequiredKeys" -> 2|>]BlockchainTransactionSubmit[btcTXPartiallySigned]Related Guides
History
Introduced in 2019 (12.0)
Text
Wolfram Research (2019), BlockchainTransactionSubmit, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSubmit-Bitcoin.html.
CMS
Wolfram Language. 2019. "BlockchainTransactionSubmit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSubmit-Bitcoin.html.
APA
Wolfram Language. (2019). BlockchainTransactionSubmit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSubmit-Bitcoin.html
BibTeX
@misc{reference.wolfram_2026_blockchaintransactionsubmit, author="Wolfram Research", title="{BlockchainTransactionSubmit}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSubmit-Bitcoin.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaintransactionsubmit, organization={Wolfram Research}, title={BlockchainTransactionSubmit}, year={2019}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSubmit-Bitcoin.html}, note=[Accessed: 13-June-2026]}