BlockchainTransactionSign (for Ethereum)
BlockchainTransactionSign[obj,key]
digitally signs an Ethereum blockchain transaction using the specified private key.
Details
- In BlockchainTransactionSign[obj,…], obj is a BlockchainTransaction object.
- The key for BlockchainTransactionSign must be a PrivateKey object or a hex string representing a private key.
- BlockchainTransactionSign returns a blockchain transaction object with True as the value of its property "Signed" and with the added property "RawTransaction".
Examples
open all close allBasic Examples (1)
Create an Ethereum BlockchainTransaction:
ethTX = BlockchainTransaction[<|"BlockchainBase" -> {"Ethereum", "Testnet"},
"TransactionCount" -> 11,
"GasPrice" -> Quantity[150, "GWei"],
"Address" -> "61cccDcDb7617d01239D0Cfc7D1627e39EA2a2c3",
"Amount" -> Quantity[0.50, "Ethers"]|>]BlockchainTransactionSign[ethTX, PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{16676173248318435135530093705658075451448270649776782441185582813615674064589,
86146693258001150152237806044792681696883435827253397319 ... 84,
"Compressed" -> False, "PublicByteArray" ->
ByteArray[
"BCTeYSvTb1h4i8B8nUtJrM//zRHHu7GdlW16oP8LZ37NvnVM7PCJ8Qms/BwonG76LAj2PCP+VGbfyw1cFM21dNI="],
"PrivateByteArray" -> ByteArray["q/aGR9Z8/pp7h2fSVcu50AHSi8r4pHPKW97/exaY34w="]]]]Applications (1)
Create an Ethereum BlockchainTransaction:
ethTX = BlockchainTransaction[<|"BlockchainBase" -> {"Ethereum", "Testnet"},
"TransactionCount" -> 11,
"GasPrice" -> Quantity[150, "GWei"],
"Address" -> "61cccDcDb7617d01239D0Cfc7D1627e39EA2a2c3",
"Amount" -> Quantity[0.50, "Ethers"]|>]ethTXSigned = BlockchainTransactionSign[ethTX, PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{16676173248318435135530093705658075451448270649776782441185582813615674064589,
86146693258001150152237806044792681696883435827253397319 ... 84,
"Compressed" -> False, "PublicByteArray" ->
ByteArray[
"BCTeYSvTb1h4i8B8nUtJrM//zRHHu7GdlW16oP8LZ37NvnVM7PCJ8Qms/BwonG76LAj2PCP+VGbfyw1cFM21dNI="],
"PrivateByteArray" -> ByteArray["q/aGR9Z8/pp7h2fSVcu50AHSi8r4pHPKW97/exaY34w="]]]]Send the signed transaction to the Ethereum blockchain:
ethTXSubmit = BlockchainTransactionSubmit[ethTXSigned]Verify the transaction using its "TransactionID":
txdata = BlockchainTransactionData[ethTXSubmit["TransactionID"], BlockchainBase -> {"Ethereum", "Testnet"}]Possible Issues (1)
Incorrect Private Key (1)
Providing an invalid private key will return a $Failed output:
tx = BlockchainTransaction[Association["BlockchainBase" -> {"Ethereum", "TestNet"}, "Signed" -> False,
"TransactionCount" -> 58, "GasPrice" -> Quantity[1, "Gwei"], "GasLimit" -> 25200,
"Fee" -> Quantity[25200000000000, "Wei"],
"Address" -> "3535353535353535353535353535353535353535", "Amount" -> Quantity[0.0002, "Ethers"],
"MessageHash" -> "beac3f99c4d488b97866f84b96caf8fa2415bbfbab0d554ed1a507bc888e7638"]];BlockchainTransactionSign[tx, "AAAAAA"]Related Guides
History
Introduced in 2019 (12.0)
Text
Wolfram Research (2019), BlockchainTransactionSign, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Ethereum.html.
CMS
Wolfram Language. 2019. "BlockchainTransactionSign." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Ethereum.html.
APA
Wolfram Language. (2019). BlockchainTransactionSign. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Ethereum.html
BibTeX
@misc{reference.wolfram_2026_blockchaintransactionsign, author="Wolfram Research", title="{BlockchainTransactionSign}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Ethereum.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaintransactionsign, organization={Wolfram Research}, title={BlockchainTransactionSign}, year={2019}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Ethereum.html}, note=[Accessed: 13-June-2026]}