Bitcoind
為什麼在 regtest 模式下會有 op-return 輸出?
這是來自的輸出
getrawtransaction
:{ "txid": "a2b9e3aa4adeb68a9b8b8b0bbc8d4890585cd711e89cda83e7f236397fac6218", "hash": "6d96c04d49eefe3eab4934188841ef3592c818bf789517b90b1f71ff75a14c26", "version": 2, "size": 183, "vsize": 156, "locktime": 0, "vin": [ { "coinbase": "02b0010101", "sequence": 4294967295 } ], "vout": [ { "value": 12.50000000, "n": 0, "scriptPubKey": { "asm": "03d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6a OP_CHECKSIG", "hex": "2103d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6aac", "reqSigs": 1, "type": "pubkey", "addresses": [ "mwzWcEU4kBkJPSTgB8LSBfvyaEjdXmyGh7" ] } }, { "value": 0.00000000, "n": 1, "scriptPubKey": { "asm": "OP_RETURN aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9", "hex": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9", "type": "nulldata" } } ], "hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0502b0010101ffffffff02807c814a00000000232103d81b3d2ac76e322dcb2e713cb8fdeaf68cb83406c0e4d28dcd10a880ef172a6aac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000", "blockhash": "4742b345fb92ce66f5fccaa880ebef29ebe44d8649114ddb06c4f7177047a717", "confirmations": 1, "time": 1512718207, "blocktime": 1512718207 }
我對這一點很感興趣:
{ "value": 0.00000000, "n": 1, "scriptPubKey": { "asm": "OP_RETURN aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9", "hex": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9", "type": "nulldata" } }
誰創造了它?(我正在使用
regtest
模式)
你做到了,大概。
您顯示的交易是 coinbase;這是礦工添加的特殊交易。OP_RETURN 輸出是 SegWit 塊送出。它是所有交易的 wtxid(包括見證人的 txid)的 Merkle 根,從而確保區塊送出給所有見證人。
在 regtest 模式下執行時,您可能直接或間接地從一個稱為
generate
RPC 呼叫的腳本中生成一個新塊。如果區塊中有任何 SegWit 交易,則承諾是強制性的(否則是可選的)。