update transaction calls (blockindex, witness)

This commit is contained in:
Michael Rotarius 2017-01-07 19:47:48 +01:00
parent ee9e14c784
commit 9c9edae6f6
6 changed files with 110 additions and 130 deletions

View file

@ -141,9 +141,9 @@ Use v0.n.n in abbreviation title to prevent autocrossrefing.
* [CreateRawTransaction][rpc createrawtransaction]: {{summary_createRawTransaction}} {{UPDATED0_12_0}}
* [FundRawTransaction][rpc fundrawtransaction]: {{summary_fundRawTransaction}} {{NEW0_12_0}}, {{UPDATED0_13_0}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}}
* [DecodeRawTransaction][rpc decoderawtransaction]: {{summary_decodeRawTransaction}} {{UPDATED0_13_0}}
* [DecodeScript][rpc decodescript]: {{summary_decodeScript}}
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}}
* [GetRawTransaction][rpc getrawtransaction]: {{summary_getRawTransaction}} {{UPDATED0_13_0}}
* [SendRawTransaction][rpc sendrawtransaction]: {{summary_sendRawTransaction}}
* [SignRawTransaction][rpc signrawtransaction]: {{summary_signRawTransaction}}

View file

@ -34,77 +34,53 @@ The `decoderawtransaction` RPC {{summary_decodeRawTransaction}}
{{INCLUDE_DECODE_RAW_TRANSACTION}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Bitcoin Core 0.13.1*
Decode a signed one-input, three-output transaction:
{% highlight bash %}
bitcoin-cli -testnet decoderawtransaction 0100000001268a9ad7bfb2\
1d3c086f0ff28f73a064964aa069ebb69a9e437da85c7e55c7d7000000006b48\
3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560f\
eb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd4\
5a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b\
3118f3db16cbbcf8f326ffffffff0350ac6002000000001976a91456847befbd\
2360df0e35b4e3b77bae48585ae06888ac80969800000000001976a9142b1495\
0b8d31620c6cc923c5408a701b1ec0a02088ac002d3101000000001976a9140d\
fc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000
bitcoin-cli decoderawtransaction 0100000001bafe2175b9d7b3041ebac\
529056b393cf2997f7964485aa382ffa449ffdac02a000000008a47304402201\
3d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00\
220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39\
e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815\
b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08\
ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc\
2db9c19e2e80358f30688ac00000000
{% endhighlight %}
Result:
{% highlight json %}
{
"txid" : "ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e",
"version" : 1,
"locktime" : 0,
"vin" : [
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"size": 223,
"vsize": 223,
"version": 1,
"locktime": 0,
"vin": [
{
"txid" : "d7c7557e5ca87d439e9ab6eb69a04a9664a0738ff20f6f083c1db2bfd79a8a26",
"vout" : 0,
"scriptSig" : {
"asm" : "3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc001 03a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326",
"hex" : "483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326"
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
"vout": 0,
"scriptSig": {
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
},
"sequence" : 4294967295
"sequence": 4294967295
}
],
"vout" : [
"vout": [
{
"value" : 0.39890000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 56847befbd2360df0e35b4e3b77bae48585ae068 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91456847befbd2360df0e35b4e3b77bae48585ae06888ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7"
]
}
},
{
"value" : 0.10000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 2b14950b8d31620c6cc923c5408a701b1ec0a020 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN"
]
}
},
{
"value" : 0.20000000,
"n" : 2,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dfc8bafc8419853b34d5e072ad37d1a5159f584 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe"
"value": 0.06990000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 01b81d5fa1e55e069e3cc2db9c19e2e80358f306 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1A6Ei5cRfDJ8jjhwxfzLJph8B9ZEthR9Z"
]
}
}

View file

@ -1,4 +1,4 @@
{% comment %}
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
@ -63,6 +63,10 @@ The `getrawtransaction` RPC {{summary_getRawTransaction}}
p: "Required<br>(exactly 1)"
d: "If the transaction was found, this will be an object describing it"
- n: "{{DEPTH}} →<br>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "The serialized, hex-encoded data for the provided `txid`"
{{INCLUDE_DECODE_RAW_TRANSACTION}}
- n: "→<br>`blockhash`"
t: "string (hex)"
@ -86,33 +90,31 @@ The `getrawtransaction` RPC {{summary_getRawTransaction}}
{% enditemplate %}
*Examples from Bitcoin Core 0.10.0*
*Examples from Bitcoin Core 0.13.1*
A transaction in serialized transaction format:
{% highlight bash %}
bitcoin-cli -testnet getrawtransaction \
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e
bitcoin-cli getrawtransaction \
52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46
{% endhighlight %}
Result (wrapped):
{% highlight text %}
0100000001268a9ad7bfb21d3c086f0ff28f73a064964aa069ebb69a9e437da8\
5c7e55c7d7000000006b483045022100ee69171016b7dd218491faf6e13f53d4\
0d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed28\
8d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc\
8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326ffffffff0350ac60020000\
00001976a91456847befbd2360df0e35b4e3b77bae48585ae06888ac80969800\
000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac002d\
3101000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac\
00000000
0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa4\
49ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a972\
3adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45\
c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295\
ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc\
0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000\
001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000
{% endhighlight %}
Get the same transaction in JSON:
{% highlight bash %}
bitcoin-cli -testnet getrawtransaction \
bitcoin-cli getrawtransaction \
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e \
1
{% endhighlight %}
@ -121,66 +123,43 @@ Result:
{% highlight json %}
{
"hex" : "0100000001268a9ad7bfb21d3c086f0ff28f73a064964aa069ebb69a9e437da85c7e55c7d7000000006b483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326ffffffff0350ac6002000000001976a91456847befbd2360df0e35b4e3b77bae48585ae06888ac80969800000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac002d3101000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
"txid" : "ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e",
"version" : 1,
"locktime" : 0,
"vin" : [
"hex": "0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa449ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000",
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
"size": 223,
"vsize": 223,
"version": 1,
"locktime": 0,
"vin": [
{
"txid" : "d7c7557e5ca87d439e9ab6eb69a04a9664a0738ff20f6f083c1db2bfd79a8a26",
"vout" : 0,
"scriptSig" : {
"asm" : "3045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc001 03a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326",
"hex" : "483045022100ee69171016b7dd218491faf6e13f53d40d64f4b40123a2de52560feb95de63b902206f23a0919471eaa1e45a0982ed288d374397d30dff541b2dd45a4c3d0041acc0012103a7c1fd1fdec50e1cf3f0cc8cb4378cd8e9a2cee8ca9b3118f3db16cbbcf8f326"
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
"vout": 0,
"scriptSig": {
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
},
"sequence" : 4294967295
"sequence": 4294967295
}
],
"vout" : [
"vout": [
{
"value" : 0.39890000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 56847befbd2360df0e35b4e3b77bae48585ae068 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91456847befbd2360df0e35b4e3b77bae48585ae06888ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"moQR7i8XM4rSGoNwEsw3h4YEuduuP6mxw7"
]
}
},
{
"value" : 0.10000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 2b14950b8d31620c6cc923c5408a701b1ec0a020 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN"
]
}
},
{
"value" : 0.20000000,
"n" : 2,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 0dfc8bafc8419853b34d5e072ad37d1a5159f584 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe"
"value": 0.06990000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 01b81d5fa1e55e069e3cc2db9c19e2e80358f306 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1A6Ei5cRfDJ8jjhwxfzLJph8B9ZEthR9Z"
]
}
}
],
"blockhash" : "00000000103e0091b7d27e5dc744a305108f0c752be249893c749e19c1c82317",
"confirmations" : 88192,
"time" : 1398734825,
"blocktime" : 1398734825
"blockhash": "0000000000000000015955e197fc362502a32f76290e5b5e5be822f9f161b3f3",
"confirmations": 374,
"time": 1483591778,
"blocktime": 1483591778
}
{% endhighlight %}

View file

@ -89,8 +89,13 @@ The `gettransaction` RPC {{summary_getTransaction}}
- n: "→ →<br>`fee`"
t: "number (bitcoins)"
p: "Optional<br>(0 or 1)"
d: "If sending payment, the fee paid as a negative bitcoins value. May be `0`. Not returned if receiving payment"
d: "If sending payment, the fee paid as a negative bitcoins value. May be `0`. Not returned if receiving payment"
- n: "→ →<br>`abandoned`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.12.1*<br><br>Indicates if a transaction is was abandoned:<br>`true` if it was abandoned (inputs are respendable)<br>`false` if it was not abandoned<br>Only returned by *send* category payments"
- n: "→<br>`hex`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
@ -98,7 +103,7 @@ The `gettransaction` RPC {{summary_getTransaction}}
{% enditemplate %}
*Example from Bitcoin Core 0.12.1*
*Example from Bitcoin Core 0.13.1*
{% highlight bash %}
bitcoin-cli -testnet gettransaction \

View file

@ -65,7 +65,7 @@ The `listtransactions` RPC {{summary_listTransactions}}
- n: "→ →<br>`account`"
t: "string"
p: "Required<br>(exactly 1)"
d: "The account which the payment was credited to or debited from. May be an empty string (\"\") for the default account"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account which the payment was credited to or debited from. May be an empty string (\"\") for the default account"
- n: "→ →<br>`address`"
t: "string (base58)"
@ -120,7 +120,7 @@ The `listtransactions` RPC {{summary_listTransactions}}
- n: "→ →<br>`blockindex`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The block height of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions"
d: "The index of the transaction in the block that includes it. Only returned for confirmed transactions"
- n: "→ →<br>`blocktime`"
t: "number (int)"

View file

@ -56,17 +56,17 @@ http://opensource.org/licenses/MIT.
- n: "{{DEPTH}}<br>`blockhash`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "Only returned for confirmed transactions. The hash of the block on the local best block chain which includes this transaction, encoded as hex in RPC byte order"
d: "The hash of the block on the local best block chain which includes this transaction, encoded as hex in RPC byte order. Only returned for confirmed transactions"
- n: "{{DEPTH}}<br>`blockindex`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned for confirmed transactions. The block height of the block on the local best block chain which includes this transaction"
d: "The index of the transaction in the block that includes it. Only returned for confirmed transactions"
- n: "{{DEPTH}}<br>`blocktime`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "Only returned for confirmed transactions. The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction"
d: "The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions"
- n: "{{DEPTH}}<br>`txid`"
t: "string (hex)"
@ -131,6 +131,21 @@ bitcoins even if this parameter is set to `1` or higher.{% endcapture %}
p: "Required<br>(exactly 1)"
d: "The transaction's TXID encoded as hex in RPC byte order"
- n: "{{DEPTH}} →<br>`hash`"
t: "string (hex)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The transaction hash. Differs from txid for witness transactions"
- n: "{{DEPTH}} →<br>`size`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.12.0*<br><br>The serialized transaction size"
- n: "{{DEPTH}} →<br>`vsize`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The virtual transaction size. Differs from size for witness transactions"
- n: "{{DEPTH}} →<br>`version`"
t: "number (int)"
p: "Required<br>(exactly 1)"
@ -186,6 +201,11 @@ bitcoins even if this parameter is set to `1` or higher.{% endcapture %}
p: "Required<br>(exactly 1)"
d: "The input sequence number"
- n: "{{DEPTH}} → → →<br>`txinwitness`"
t: "string : array"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>Hex-encoded witness data. Only for segregated witness transactions"
- n: "{{DEPTH}} →<br>`vout`"
t: "array"
p: "Required<br>(exactly 1)"