BlockchainTransaction (for Litecoin)
BlockchainTransaction[assoc]
連想 assoc 内の構成要素から構築されたライトコインブロックチェーンのトランザクションを表す.
詳細
- ライトコインブロックチェーンのトランザクションの記号表現を与える.トランザクションは送信せず,トランザクションに署名もしない.
- BlockchainTransaction[…][prop]は,トランザクションの特性 prop の値を与える.
- 次の要素を与えなくてはならない.
-
"Inputs" 入力のリスト(連想として与えられる) "Outputs" 出力のリスト(連想として与えられる) - 次の追加的要素を与えることができる.
-
"Version" トランザクションのバージョン番号(デフォルト:1) "LockTime" トランザクションが加えられる可能性がある,最も早い時間またはブロック(デフォルト:0) - "Inputs"リストの各連想には次の項目が含まれていなければならない.
-
"TransactionID" 前のトランザクションのハッシュ "Index" 前のトランザクション出力内のインデックス - 次の追加的要素も与えることができる.
-
"ScriptString" "" ロック解除スクリプト(scriptSigとも呼ばれる) "SignatureHash" All 署名ハッシュフラグ - 次は,"SignatureHash"の可能な値である.
-
All 署名は全入出力に適用される None 署名は全入力に適用されるが,出力には適用されない "Single" 署名は全入力と署名された入力と同じインデックス番号を持つ出力に適用される "AllAnyoneCanPay" 署名は1つの入力と全出力に適用される "NoneAnyoneCanPay" 署名は1つの入力に適用されるが出力には適用されない "SingleAnyoneCanPay" 署名は1つの入力とそれと同じインデックス番号の出力に適用される - P2PKH (Pay-to-Public-Key-Hash)トランザクションについては,"Outputs"リスト内の各連想に次の項目がなければならない.
-
"Amount" 送金されるライトコインの量 "Address" 送金するための宛先P2PKHアドレス - 一般的なライトコインのトランザクションについては,カスタムのロックスクリプトを与えることができる."Outputs"リスト内の各連想には次の項目がなければならない.
-
"Amount" 送金するライトコイン量 "ScriptString" 文字列形式のビットコインスクリプト - BlockchainTransactionは,ライトコインのメインネット(デフォルト)とテストネットのトランザクションを表すことができる.これらのネットワークの指定には,必要とされる連想あるいはBlockchainBaseオプションの中で"BlockchainBase"の値を使う.
例題
すべて開く すべて閉じる例 (1)
P2PKHトランザクションを表すライトコインのトランザクションオブジェクトを作る:
BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"}, "Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>]スコープ (4)
カスタムの非標準スクリプト (2)
BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"}, "Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "ScriptString" -> "OP_3 OP_ADD OP_5 OP_EQUAL"|>}|>]BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"},
"Inputs" -> {
<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1, "ScriptString" -> "OP_2"|>
}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>]署名ハッシュ (1)
トランザクション入力に"SignatureHash"のさまざまな値を使う:
BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"},
"Inputs" -> {
<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1, "SignatureHash" -> "All"|>,
<|"TransactionID" -> "1b9daf5a7bcafab46a2d9a1fc7061016d972d303520e5b3e3a42987d0cce9a6b", "Index" -> 0, "SignatureHash" -> "Single"|>
}, "Outputs" -> {<|"Amount" -> Quantity[0.050076, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>]時限鍵をかけたトランザクション (1)
ブロック3000000まで鍵がかけられるトランザクションを作成する:
BlockchainTransaction[<|"BlockchainBase" -> {"Litecoin", "Testnet"},
"LockTime" -> 3000000,
"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>]オプション (2)
BlockchainBase (2)
Mainnet (1)
BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "21f0cb929ac6890ccff94c95918031ce7875d8b8b1d3393a1d71f59a67cd334e", "Index" -> 0|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0009, "Litecoins"], "Address" -> "LNm4kbpGmjmjWpQss82Q4Zvh8a3fWSEiAh"|>,
<|"Amount" -> Quantity[49.999, "Litecoins"], "Address" -> "LgWz852qDfWtPRNVPxmeTyNoSrXhsYfo1L"|>}|>, BlockchainBase -> "Litecoin"]Testnet (1)
BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]アプリケーション (1)
ライトコインのP2PKH 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"}]ltcTXSigned = BlockchainTransactionSign[ltcTX, PrivateKey[Association["Type" -> "EllipticCurve", "CurveName" -> "secp256k1",
"PublicCurvePoint" ->
{48067351049682456848332087651486245083783305555783485878336439165336160262912,
86265118836901232199742833912280553529588413604147325207 ... 2189122391110402380266844823627587263308329834036977,
"Compressed" -> True, "PublicByteArray" ->
ByteArray["A2pFKBWbemeSGJyOJDDf0PAYeiCFpELJhS6mPqd8f1sA"],
"PrivateByteArray" -> ByteArray["0fZvlotEk+koVRcqSixTrj5axlqRQV1AcEBeNPVUvvE="]]]]署名したトランザクションをライトコインブロックチェーンに送信する:
BlockchainTransactionSubmit[ltcTXSigned]考えられる問題 (2)
不十分な金額 (1)
合計出力金額に対して不十分な金額の未使用トランザクション出力を参照する入力を与えると,$Failed出力が返される:
BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.1, "Litecoins"], "Address" -> "munDTMqa9V9Uhi3P21FpkY8UfYzvQqpmoQ"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]不正な出力アドレス (1)
無効なアドレスを与えると$Failed出力が返される:
BlockchainTransaction[<|"Inputs" -> {<|"TransactionID" -> "5f38f453a3a36b540fd11480f9e07ae02ed14206e4a21ff351898b16b1615a79", "Index" -> 1|>}, "Outputs" -> {<|"Amount" -> Quantity[0.0001, "Litecoins"], "Address" -> "AAAAAA"|>,
<|"Amount" -> Quantity[0.09977, "Litecoins"], "Address" -> "n2oz9uoyx2i5uj9wwPkj1sXN6dm8efe7n9"|>}|>, BlockchainBase -> {"Litecoin", "Testnet"}]関連するガイド
履歴
2024 で導入 (14.0)
テキスト
Wolfram Research (2024), BlockchainTransaction, Wolfram言語関数, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Litecoin.html.
CMS
Wolfram Language. 2024. "BlockchainTransaction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Litecoin.html.
APA
Wolfram Language. (2024). BlockchainTransaction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Litecoin.html
BibTeX
@misc{reference.wolfram_2026_blockchaintransaction, author="Wolfram Research", title="{BlockchainTransaction}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Litecoin.html}", note=[Accessed: 24-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaintransaction, organization={Wolfram Research}, title={BlockchainTransaction}, year={2024}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Litecoin.html}, note=[Accessed: 24-August-2026]}