mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
RPCs (Raw Tx / Utility)
- Update all raw transaction RPCs - Update CreateMultiSig Utility RPC
This commit is contained in:
parent
09c005ffdd
commit
b85d023be3
10 changed files with 261 additions and 174 deletions
|
@ -58,17 +58,17 @@ The `createmultisig` RPC {{summary_createMultiSig}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Creating a 2-of-3 P2SH multisig address by mixing two P2PKH addresses and
|
||||
one full public key:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet createmultisig 2 '''
|
||||
dash-cli -testnet createmultisig 2 '''
|
||||
[
|
||||
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
|
||||
"02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f",
|
||||
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
|
||||
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
|
||||
"0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88",
|
||||
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
|
||||
]
|
||||
'''
|
||||
{% endhighlight %}
|
||||
|
@ -77,8 +77,8 @@ Result:
|
|||
|
||||
{%highlight json %}
|
||||
{
|
||||
"address" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq",
|
||||
"redeemScript" : "522103ede722780d27b05f0b1169efc90fa15a601a32fc6c3295114500c586831b6aaf2102ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f21022d609d2f0d359e5bc0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d553ae"
|
||||
"address": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW",
|
||||
"redeemScript": "522102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29210311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d882103251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d053ae"
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -84,21 +84,21 @@ The `createrawtransaction` RPC {{summary_createRawTransaction}}
|
|||
dash-cli -testnet createrawtransaction '''
|
||||
[
|
||||
{
|
||||
"txid": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f",
|
||||
"vout" : 0
|
||||
"txid": "061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b",
|
||||
"vout" : 1
|
||||
}
|
||||
]''' \
|
||||
'{"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 800, "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh":77.78}' '1024'
|
||||
'{"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 800, "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh":74.99}' '0'
|
||||
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight text %}
|
||||
01000000010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f6\
|
||||
0000000000ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3\
|
||||
cfc9f32ef388ac80dc9acf010000001976a914811eacc14db8ebb5b64486dc43400c0226b4\
|
||||
28a488ac00040000
|
||||
01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e06\
|
||||
0100000000ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3\
|
||||
cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b4\
|
||||
28a488ac00000000
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
|
|
@ -34,57 +34,69 @@ The `decoderawtransaction` RPC {{summary_decodeRawTransaction}}
|
|||
{{INCLUDE_DECODE_RAW_TRANSACTION}}
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.13.1*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Decode a signed one-input, three-output transaction:
|
||||
Decode a signed one-input, two-output transaction:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli decoderawtransaction 0100000001bafe2175b9d7b3041ebac\
|
||||
529056b393cf2997f7964485aa382ffa449ffdac02a000000008a47304402201\
|
||||
3d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00\
|
||||
220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39\
|
||||
e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815\
|
||||
b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08\
|
||||
ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc\
|
||||
2db9c19e2e80358f30688ac00000000
|
||||
dash-cli decoderawtransaction 01000000016b490886c0198b028c6c5cb145c4eb3b10\
|
||||
55a224a7a105aadeff41b69ec91e060100000069463043022033a61c56fa0867ed67b76b02\
|
||||
3204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4\
|
||||
182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e\
|
||||
8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa9\
|
||||
9504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b6\
|
||||
4486dc43400c0226b428a488ac00000000
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
|
||||
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
|
||||
"size": 223,
|
||||
"vsize": 223,
|
||||
"version": 1,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
|
||||
"vout": 0,
|
||||
"scriptSig": {
|
||||
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
|
||||
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
|
||||
},
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 0.06990000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 01b81d5fa1e55e069e3cc2db9c19e2e80358f306 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"1A6Ei5cRfDJ8jjhwxfzLJph8B9ZEthR9Z"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
"txid": "2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5",
|
||||
"size": 224,
|
||||
"version": 1,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
"txid": "061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b",
|
||||
"vout": 1,
|
||||
"scriptSig": {
|
||||
"asm": "3043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e[ALL] 02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29",
|
||||
"hex": "463043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29"
|
||||
},
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 800.00000000,
|
||||
"valueSat": 80000000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 485485425fa99504ec1638ac4213f3cfc9f32ef3 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"value": 74.99000000,
|
||||
"valueSat": 7499000000,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 811eacc14db8ebb5b64486dc43400c0226b428a4 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a914811eacc14db8ebb5b64486dc43400c0226b428a488ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -36,16 +36,16 @@ The `decodescript` RPC {{summary_decodeScript}}
|
|||
p: "Required<br>(exactly 1)"
|
||||
d: "The redeem script in decoded form with non-data-pushing opcodes listed. May be empty"
|
||||
|
||||
- n: "→<br>`type`"
|
||||
t: "string"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The type of script. This will be one of the following:<br>• `pubkey` for a P2PK script inside P2SH<br>• `pubkeyhash` for a P2PKH script inside P2SH<br>• `multisig` for a multisig script inside P2SH<br>• `nonstandard` for unknown scripts"
|
||||
|
||||
- n: "→<br>`reqSigs`"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The number of signatures required; this is always `1` for P2PK or P2PKH within P2SH. It may be greater than 1 for P2SH multisig. This value will not be returned for `nonstandard` script types (see the `type` key above)"
|
||||
|
||||
- n: "→<br>`type`"
|
||||
t: "string"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The type of script. This will be one of the following:<br>• `pubkey` for a P2PK script inside P2SH<br>• `pubkeyhash` for a P2PKH script inside P2SH<br>• `multisig` for a multisig script inside P2SH<br>• `nonstandard` for unknown scripts"
|
||||
|
||||
- n: "→<br>`addresses`"
|
||||
t: "array"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
|
@ -63,30 +63,30 @@ The `decodescript` RPC {{summary_decodeScript}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
A 2-of-3 P2SH multisig pubkey script:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet decodescript 522103ede722780d27b05f0b1169ef\
|
||||
c90fa15a601a32fc6c3295114500c586831b6aaf2102ecd2d250a76d204011de\
|
||||
6bc365a56033b9b3a149f679bc17205555d3c2b2854f21022d609d2f0d359e5b\
|
||||
c0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d553ae
|
||||
dash-cli -testnet decodescript 522102eacba539d92eb88d4e73bb32\
|
||||
749d79f53f6e8d7947ac40a71bd4b26c13b6ec29210311f97539724e0de38fb1\
|
||||
ff79f5148e5202459d06ed07193ab18c730274fd0d882103251f25a5c0291446\
|
||||
d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d053ae
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"asm" : "2 03ede722780d27b05f0b1169efc90fa15a601a32fc6c3295114500c586831b6aaf 02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f 022d609d2f0d359e5bc0e5d0ea20ff9f5d3396cb5b1906aa9c56a0e7b5edc0c5d5 3 OP_CHECKMULTISIG",
|
||||
"reqSigs" : 2,
|
||||
"type" : "multisig",
|
||||
"addresses" : [
|
||||
"mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ",
|
||||
"mo1vzGwCzWqteip29vGWWW6MsEBREuzW94",
|
||||
"mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG"
|
||||
],
|
||||
"p2sh" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq"
|
||||
"asm": "2 02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29 0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88 03251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d0 3 OP_CHECKMULTISIG",
|
||||
"reqSigs": 2,
|
||||
"type": "multisig",
|
||||
"addresses": [
|
||||
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
|
||||
"yWAk1cDVvsRdPYjnzcFkySJux75yaCE7xz",
|
||||
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
|
||||
],
|
||||
"p2sh": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW"
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -29,6 +29,16 @@ All existing inputs must have their previous output transaction be in the wallet
|
|||
|
||||
*Parameter #2---Additional options*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`includeWatching`"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Inputs from watch-only addresses are also considered. The default is `false`"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
The following options from Bitcoin are not implemented in Dash Core.
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Options"
|
||||
t: "Object"
|
||||
|
@ -39,17 +49,12 @@ All existing inputs must have their previous output transaction be in the wallet
|
|||
t: "string"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The bitcoin address to receive the change. If not set, the address is chosen from address pool"
|
||||
|
||||
|
||||
- n: "→ <br>`changePosition`"
|
||||
t: "nummeric (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The index of the change output. If not set, the change position is randomly chosen"
|
||||
|
||||
- n: "→ <br>`includeWatching`"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Inputs from watch-only addresses are also considered. The default is `false`"
|
||||
|
||||
- n: "→ <br>`lockUnspent`"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
|
@ -59,7 +64,7 @@ All existing inputs must have their previous output transaction be in the wallet
|
|||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "*Added in Bitcoin Core 0.14.0*<br><br>Reserves the change output key from the keypool. The default is `true`. Before 0.14.0, the used keypool key was never marked as change-address key and directly returned to the keypool (leading to address reuse)."
|
||||
|
||||
|
||||
- n: "→ <br>`feeRate`"
|
||||
t: "numeric (bitcoins)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
|
@ -105,29 +110,36 @@ All existing inputs must have their previous output transaction be in the wallet
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.13.1*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet fundrawtransaction 01000000011da9283b4ddf8d\
|
||||
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffff\
|
||||
ffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a51\
|
||||
59f58488ac00000000
|
||||
'{
|
||||
"changeAddress": "15gJiApWFGTN2iTteQwQbqasdT6dwGWwv6",
|
||||
"changePosition" : 1,
|
||||
"includeWatching" : false,
|
||||
"lockUnspents" : true,
|
||||
"feeRate" : 0.0001
|
||||
}'
|
||||
dash-cli -testnet fundrawtransaction 01000000000100205fa012000000\
|
||||
1976a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac00000000
|
||||
|
||||
{% comment %}
|
||||
KEPT IN CASE DASH IMPLEMENTS ADDITIONAL OPTIONS
|
||||
|
||||
bitcoin-cli -testnet fundrawtransaction 01000000011da9283b4ddf8d\
|
||||
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffff\
|
||||
ffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a51\
|
||||
59f58488ac00000000
|
||||
'{
|
||||
"changeAddress": "15gJiApWFGTN2iTteQwQbqasdT6dwGWwv6",
|
||||
"changePosition" : 1,
|
||||
"includeWatching" : false,
|
||||
"lockUnspents" : true,
|
||||
"feeRate" : 0.0001
|
||||
}'
|
||||
{% endcomment %}
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight text %}
|
||||
{
|
||||
"hex": "01000000011da9283b4ddf8d89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffffffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
|
||||
"fee": 0.0000245,
|
||||
"changepos": 2
|
||||
"hex": "01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000000feffffff023e1207bf010000001976a914bd652a167e7ad674f7815dc549bea9c57a7f919b88ac00205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac00000000",
|
||||
"changepos": 0,
|
||||
"fee": 0.00000226
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ http://opensource.org/licenses/MIT.
|
|||
##### GetRawTransaction
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_getRawTransaction="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default `txindex=1` in your Bitcoin Core startup settings." %}
|
||||
{% assign summary_getRawTransaction="gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Dash Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default `txindex=1` in your Dash Core startup settings." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
|
@ -31,7 +31,7 @@ The `getrawtransaction` RPC {{summary_getRawTransaction}}
|
|||
- n: "Format"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "*Updated in Bitcoin Core 0.14.0*<br><br>Set to `false` (the default) to return the serialized transaction as hex. Set to `true` to return a decoded transaction. Before 0.14.0, use `0` and `1`, respectively"
|
||||
d: "For Dash:<br>Set to `0` (the default) to return the serialized transaction as hex. Set to `1` to return a decoded transaction.<br><br>*Updated in Bitcoin Core 0.14.0*<br><br>Set to `false` (the default) to return the serialized transaction as hex. Set to `true` to return a decoded transaction. Before 0.14.0, use `0` and `1`, respectively"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
|
@ -41,7 +41,7 @@ The `getrawtransaction` RPC {{summary_getRawTransaction}}
|
|||
- n: "`result`"
|
||||
t: "null"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "If the transaction wasn't found, the result will be JSON `null`. This can occur because the transaction doesn't exist in the block chain or memory pool, or because it isn't part of the transaction index. See the Bitcoin Core `-help` entry for `-txindex`"
|
||||
d: "If the transaction wasn't found, the result will be JSON `null`. This can occur because the transaction doesn't exist in the block chain or memory pool, or because it isn't part of the transaction index. See the Dash Core `-help` entry for `-txindex`"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
|
@ -90,76 +90,93 @@ The `getrawtransaction` RPC {{summary_getRawTransaction}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.14.1*
|
||||
*Examples from Dash Core 0.12.2*
|
||||
|
||||
A transaction in serialized transaction format:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli getrawtransaction \
|
||||
52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46
|
||||
dash-cli getrawtransaction \
|
||||
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5
|
||||
{% endhighlight %}
|
||||
|
||||
Result (wrapped):
|
||||
|
||||
{% highlight text %}
|
||||
0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa4\
|
||||
49ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a972\
|
||||
3adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45\
|
||||
c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295\
|
||||
ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc\
|
||||
0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000\
|
||||
001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000
|
||||
01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41\
|
||||
b69ec91e060100000069463043022033a61c56fa0867ed67b76b023204a9dc0e\
|
||||
e6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4\
|
||||
182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb3274\
|
||||
9d79f53f6e8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa012000000\
|
||||
1976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be0100\
|
||||
00001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000
|
||||
{% endhighlight %}
|
||||
|
||||
Get the same transaction in JSON:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli getrawtransaction \
|
||||
ef7c0cbf6ba5af68d2ea239bba709b26ff7b0b669839a63bb01c2cb8e8de481e \
|
||||
true
|
||||
dash-cli getrawtransaction \
|
||||
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5 \
|
||||
1
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"hex": "0100000001bafe2175b9d7b3041ebac529056b393cf2997f7964485aa382ffa449ffdac02a000000008a473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01b0a86a00000000001976a91401b81d5fa1e55e069e3cc2db9c19e2e80358f30688ac00000000",
|
||||
"txid": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
|
||||
"hash": "52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46",
|
||||
"size": 223,
|
||||
"vsize": 223,
|
||||
"version": 1,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
"txid": "2ac0daff49a4ff82a35a4864797f99f23c396b0529c5ba1e04b3d7b97521feba",
|
||||
"vout": 0,
|
||||
"scriptSig": {
|
||||
"asm": "3044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
|
||||
"hex": "473044022013d212c22f0b46bb33106d148493b9a9723adb2c3dd3a3ebe3a9c9e3b95d8cb00220461661710202fbab550f973068af45c294667fc4dc526627a7463eb23ab39e9b01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
|
||||
},
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"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": "0000000000000000015955e197fc362502a32f76290e5b5e5be822f9f161b3f3",
|
||||
"confirmations": 374,
|
||||
"time": 1483591778,
|
||||
"blocktime": 1483591778
|
||||
"hex": "01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000069463043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000",
|
||||
"txid": "2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5",
|
||||
"size": 224,
|
||||
"version": 1,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
{
|
||||
"txid": "061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b",
|
||||
"vout": 1,
|
||||
"scriptSig": {
|
||||
"asm": "3043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e[ALL] 02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29",
|
||||
"hex": "463043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29"
|
||||
},
|
||||
"value": 874.99879200,
|
||||
"valueSat": 87499879200,
|
||||
"address": "yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
|
||||
"sequence": 4294967295
|
||||
}
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 800.00000000,
|
||||
"valueSat": 80000000000,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 485485425fa99504ec1638ac4213f3cfc9f32ef3 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"value": 74.99000000,
|
||||
"valueSat": 7499000000,
|
||||
"n": 1,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_DUP OP_HASH160 811eacc14db8ebb5b64486dc43400c0226b428a4 OP_EQUALVERIFY OP_CHECKSIG",
|
||||
"hex": "76a914811eacc14db8ebb5b64486dc43400c0226b428a488ac",
|
||||
"reqSigs": 1,
|
||||
"type": "pubkeyhash",
|
||||
"addresses": [
|
||||
"yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"blockhash": "00000000e679e76eabc913b15c7f202e7ea831b8fb07beb28ca2a047b03ff3cc",
|
||||
"height": 19560,
|
||||
"confirmations": 6,
|
||||
"time": 1509568811,
|
||||
"blocktime": 1509568811
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ The `sendrawtransaction` RPC {{summary_sendRawTransaction}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2--whether to allow high fees**
|
||||
*Parameter #2--whether to allow high fees*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Allow High Fees"
|
||||
|
@ -33,6 +33,16 @@ The `sendrawtransaction` RPC {{summary_sendRawTransaction}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #3--whether to use InstantSend*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Use InstantSend"
|
||||
t: "bool"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Set to `true` to send as an InstantSend transaction. Set to `false` (the default) to send as a normal transaction"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Result---a TXID or error message*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
|
@ -43,24 +53,25 @@ The `sendrawtransaction` RPC {{summary_sendRawTransaction}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Examples from Bitcoin Core 0.10.0*
|
||||
*Examples from Dash Core 0.12.2*
|
||||
|
||||
Broadcast a signed transaction:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet sendrawtransaction 01000000011da9283b4ddf8d\
|
||||
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e000000006a4730\
|
||||
4402200ebea9f630f3ee35fa467ffc234592c79538ecd6eb1c9199eb23c4a16a\
|
||||
0485a20220172ecaf6975902584987d295b8dddf8f46ec32ca19122510e22405\
|
||||
ba52d1f13201210256d16d76a49e6c8e2edc1c265d600ec1a64a45153d45c29a\
|
||||
2fd0228c24c3a524ffffffff01405dc600000000001976a9140dfc8bafc84198\
|
||||
53b34d5e072ad37d1a5159f58488ac00000000
|
||||
dash-cli -testnet sendrawtransaction 01000000016b490886c0198b\
|
||||
028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e0601000000694630\
|
||||
43022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe943354\
|
||||
45ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f\
|
||||
561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71b\
|
||||
d4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa99504\
|
||||
ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8\
|
||||
ebb5b64486dc43400c0226b428a488ac00000000
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight text %}
|
||||
f5a5ce5988cc72b9b90e8d1d6c910cda53c88d2175177357cc2f2cf0899fbaad
|
||||
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
|
|
@ -103,24 +103,25 @@ The `signrawtransaction` RPC {{summary_signRawTransaction}}
|
|||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.10.0*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Sign the hex generated in the example section for the `createrawtransaction`
|
||||
RPC:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -testnet signrawtransaction 01000000011da9283b4ddf8d\
|
||||
89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e0000000000ffff\
|
||||
ffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a51\
|
||||
59f58488ac00000000
|
||||
dash-cli -testnet signrawtransaction signrawtransaction 01000000016b4908\
|
||||
86c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000000ffff\
|
||||
ffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388\
|
||||
acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00\
|
||||
000000
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
{
|
||||
"hex" : "01000000011da9283b4ddf8d89eb996988b89ead56cecdc44041ab38bf787f1206cd90b51e000000006a47304402200ebea9f630f3ee35fa467ffc234592c79538ecd6eb1c9199eb23c4a16a0485a20220172ecaf6975902584987d295b8dddf8f46ec32ca19122510e22405ba52d1f13201210256d16d76a49e6c8e2edc1c265d600ec1a64a45153d45c29a2fd0228c24c3a524ffffffff01405dc600000000001976a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac00000000",
|
||||
"complete" : true
|
||||
"hex": "01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000069463043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000",
|
||||
"complete": true
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue