BlockchainTransactionSign (for Litecoin)
BlockchainTransactionSign[obj,key]
digitally signs a Litecoin blockchain transaction using the specified private key.
BlockchainTransactionSign[obj,{key1,key2,…}]
digitally signs a transaction using all the keys keyi.
BlockchainTransactionSign[obj,{assoc1,assoc2,…}]
digitally signs a transaction where associ contains Pay-to-Script-Hash data.
Details
- Digitally signs a Litecoin blockchain transaction using the specified private key.
- 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".
- For a Litecoin BlockchainTransaction object, BlockchainTransactionSign will use the value of the property "SignatureHash" provided with each input to determine the appropriate digital signature method.
- Multiple private keys can be given in any order.
- If an input of the transaction belongs to a Pay-to-Script-Hash address, the association in the list must have the following elements:
-
"Data" list of elements used during the execution of the script "Script" valid Bitcoin script - "Data" may contain PrivateKey objects, hexadecimal strings or Bitcoin script opcodes according to the script. PrivateKey objects will be used for signing the corresponding input. "Script" is a valid Bitcoin script composed of opcodes and hexadecimal strings.
- If an input of the transaction is related to a multi-signature script, the association in the list must have the following elements:
-
"PrivateKeys" list of PrivateKey objects used for signing "PublicKeys" list of all the PublicKey objects used in the script "RequiredKeys" minimum number of private keys required
Examples
open all close allBasic Examples (1)
Create a Litecoin Pay-to-Public-Key-Hash BlockchainTransaction:
ltcTX = BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]Sign the transaction object using a private key:
ltcTXSigned = BlockchainTransactionSign[ltcTX, PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{48067351049682456848332087651486245083783305555783485878336439165336160262912,
86265118836901232199742833912280553529588413604147325207 ... 2189122391110402380266844823627587263308329834036977,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A2pFKBWbemeSGJyOJDDf0PAYeiCFpELJhS6mPqd8f1sA"],
"PrivateByteArray" -> ByteArray["0fZvlotEk+koVRcqSixTrj5axlqRQV1AcEBeNPVUvvE="]]]]Scope (3)
Multiple Key Signatures (1)
Sign a Litecoin transaction with multiple keys:
ltcTX = BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "7f4acc2b5c12686130a7db5005b974afe4341385ae33a871a14fc971195c987f", "Index" -> 0|>,
<|"TransactionID" -> "7f4acc2b5c12686130a7db5005b974afe4341385ae33a871a14fc971195c987f", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0007, "Litecoins"], "Address" -> "mj44nSbRW6xw38CLQZ1UcU5FnMH6HvJsXC"|>,
<|"Amount" -> Quantity[0.09877, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]BlockchainTransactionSign[ltcTX, {PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{48067351049682456848332087651486245083783305555783485878336439165336160262912,
86265118836901232199742833912280553529588413604147325207 ... 2189122391110402380266844823627587263308329834036977,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A2pFKBWbemeSGJyOJDDf0PAYeiCFpELJhS6mPqd8f1sA"],
"PrivateByteArray" -> ByteArray["0fZvlotEk+koVRcqSixTrj5axlqRQV1AcEBeNPVUvvE="]]], PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{47178765345982865428220261762530315538767837988546531648297311940713283339268,
11450581132328705441513858508053920737622496748719403078 ... 8509894808869238925932884581427227255455928713105237,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["AmhOPCIIFcR3lB6SiQT+fUfvcTbN3uQK1jH3pDKJQEQE"],
"PrivateByteArray" -> ByteArray["nh1Jg0+b5uimkDwFcNYS/5MZUcRIQVCTomhRGpZCT1U="]]]}]Pay-to-Script-Hash Input (1)
Sign a Litecoin transaction with an input that belongs to a Pay-to-Script-Hash address:
ltcTX = BlockchainTransaction[
<|"Inputs" -> {<|"TransactionID" -> "1b9daf5a7bcafab46a2d9a1fc7061016d972d303520e5b3e3a42987d0cce9a6b", "Index" -> 0|>},
"Outputs" -> {<|"Amount" -> Quantity[0.049956, "Litecoins"], "Address" -> "QjrVNTdSrX5uKwKEguLdf8uNk1txGq8dqL"|>}
|>,
BlockchainBase -> {"Litecoin", "Testnet"}
]The association must include the "Data" required to run the "Script" used when creating the Pay-to-Script-Hash address:
ltcTXSigned = BlockchainTransactionSign[ltcTX,
<|"Data" -> {PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{66761639592919821477469190919815924180094699857628922323270431008999548151984,
67073481882215646202832337781986508967035346830822431863 ... 2242835004181077759496032839736411347399045052265541,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["ApOZv7oUkd489VkyiijZ23genB2qeosXkgaZayZyaGiw"],
"PrivateByteArray" -> ByteArray["YIcIjOXOjhSRNn+98RprkTeQ4gQUP0oaQ60YHrQydEU="]]], PublicKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1", "Compressed" -> True,
"PublicByteArray" -> ByteArray["ApOZv7oUkd489VkyiijZ23genB2qeosXkgaZayZyaGiw"],
"PublicCurvePoint" ->
{66761639592919821477469190919815924180094699857628922323270431008999548151984,
67073481882215646202832337781986508967035346830822431863975597637481339178216}]]["PublicHexString"]}, "Script" -> "OP_DUP OP_HASH160 4088a7838506b091bad63790dee787816afced90 OP_EQUALVERIFY OP_CHECKSIG"|>]The PrivateKey object in "Data" was used to create a signature of the transaction that appears in the final transaction object:
StringTake[ltcTXSigned["Inputs"][[1]]["ScriptString"], {1, 147}]Multi-signature Input (1)
Sign a Litecoin transaction with an input related to a multi-signature script:
ltcTX = BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"},
"Inputs" -> {
<|"TransactionID" -> "ded9b3f34da247e883e4242af710f5aa7439b2d39f47f7fcb6ba08d9abcf7e73", "Index" -> 0|>
},
"Outputs" -> {
<|"Amount" -> Quantity[0.00004, "Litecoins"], "Address" -> "QbGkcbSC5Y3e6cP87eLGS7EM9csQQujj9U"|>
}|>]The transaction must be signed with a minimum number of private keys from the participants according to the "RequiredKeys" parameter:
BlockchainTransactionSign[ltcTX, <|"PrivateKeys" -> {PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{51724874525444673739416721101123148946820313131304153131265018986533336040603,
48268731188414227634929888133357578613956172980857119866 ... 2945683748054256803097024204184959830409291338374588,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A3JbPdNVSP2qOQQGZ8L356XoOXtca+x0yN/eJRFyZsSb"],
"PrivateByteArray" -> ByteArray["SpSctIIABYGROtVVkNEK5YJef7vYlAiFJfTuRCsEXbw="]]], PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{107979500881536671708232537632503185481996798629419440902689565824755056043672,
2637454808094502922642620609608402222690883176095857765 ... 9932546330509479197220801016216185613865467267293385,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["Au66O1At9hyzPrP7jrH8x3+0Eu+iockh1KM1MemGIOaY"],
"PrivateByteArray" -> ByteArray["Kdbwgcvp8l5y34qidpHOP/qLecxBydEn97nfCKKcoMk="]]]}, "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|>]Alternatively, the transaction object can be signed sequentially by each participant:
ltcTXPartiallySigned = BlockchainTransactionSign[ltcTX, <|"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|>]BlockchainTransactionSign[ltcTXPartiallySigned, <|"PrivateKeys" -> {PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{107979500881536671708232537632503185481996798629419440902689565824755056043672,
2637454808094502922642620609608402222690883176095857765 ... 9932546330509479197220801016216185613865467267293385,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["Au66O1At9hyzPrP7jrH8x3+0Eu+iockh1KM1MemGIOaY"],
"PrivateByteArray" -> ByteArray["Kdbwgcvp8l5y34qidpHOP/qLecxBydEn97nfCKKcoMk="]]]}, "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|>]Applications (1)
Create a Litecoin Pay-to-Public-Key-Hash BlockchainTransaction:
ltcTX = BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]Sign the transaction object using a private key:
ltcTXSigned = BlockchainTransactionSign[ltcTX, PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{48067351049682456848332087651486245083783305555783485878336439165336160262912,
86265118836901232199742833912280553529588413604147325207 ... 2189122391110402380266844823627587263308329834036977,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A2pFKBWbemeSGJyOJDDf0PAYeiCFpELJhS6mPqd8f1sA"],
"PrivateByteArray" -> ByteArray["0fZvlotEk+koVRcqSixTrj5axlqRQV1AcEBeNPVUvvE="]]]]Send the signed transaction to the Litecoin blockchain:
BlockchainTransactionSubmit[ltcTXSigned]Possible Issues (1)
Incorrect Private Key (1)
Providing an invalid private key will return a $Failed output:
tx = BlockchainTransaction[Association["BlockchainBase" -> {"Litecoin", "Testnet"}, "Signed" -> False,
"Fee" -> Quantity[2000, "Litoshis"], "Version" -> 1, "LockTime" -> 0,
"Inputs" -> {Association["TransactionID" ->
"5f38f453a3a36b540fd114 ... "0100000001795a61b1168b8951f31fa2e40642d12ee07ae0f98014d10f546ba3a353f4385f01\
00000000ffffffff0210270000000000001976a9149c74a7dc51225f0c97eadefbd014d621833d5ce388aca83c980000000\
0001976a914e99343dfc254ae4b17701104467d9c7caf904b2d88ac00000000"]];BlockchainTransactionSign[tx, "AAAAAA"]Related Guides
History
Introduced in 2024 (14.0)
Text
Wolfram Research (2024), BlockchainTransactionSign, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Litecoin.html.
CMS
Wolfram Language. 2024. "BlockchainTransactionSign." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Litecoin.html.
APA
Wolfram Language. (2024). BlockchainTransactionSign. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Litecoin.html
BibTeX
@misc{reference.wolfram_2026_blockchaintransactionsign, author="Wolfram Research", title="{BlockchainTransactionSign}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Litecoin.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaintransactionsign, organization={Wolfram Research}, title={BlockchainTransactionSign}, year={2024}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Litecoin.html}, note=[Accessed: 13-June-2026]}