From 357525edafb67b8995b7f8562cf7afa88d10f33b Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 14:13:01 -0400 Subject: [PATCH 1/9] docs(rpc): fix getnetworkinfo example --- docs/api/remote-procedure-calls-network.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/api/remote-procedure-calls-network.md b/docs/api/remote-procedure-calls-network.md index eaa88c49..4b7861fb 100644 --- a/docs/api/remote-procedure-calls-network.md +++ b/docs/api/remote-procedure-calls-network.md @@ -423,13 +423,11 @@ dash-cli getnetworkinfo Result (actual addresses have been replaced with [RFC5737](http://tools.ietf.org/html/rfc5737) reserved addresses): ```json - -16:31:29 { - "version": 210000, - "buildversion": "v20.1.1-541-gc617d4a50bff", - "subversion": "/Dash Core:21.0.0/", - "protocolversion": 70231, + "version": 210100, + "buildversion": "v21.1.0", + "subversion": "/Dash Core:21.1.0/", + "protocolversion": 70233, "localservices": "0000000000000c05", "localservicesnames": [ "NETWORK", @@ -475,6 +473,13 @@ Result (actual addresses have been replaced with [RFC5737](http://tools.ietf.org "reachable": false, "proxy": "", "proxy_randomize_credentials": false + }, + { + "name": "cjdns", + "limited": true, + "reachable": false, + "proxy": "", + "proxy_randomize_credentials": false } ], "relayfee": 0.00001000, From db470575f110b8882e58d1118d0f2907354e71a6 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 14:45:29 -0400 Subject: [PATCH 2/9] docs(rpc): add listdescriptors --- .../remote-procedure-call-quick-reference.md | 1 + docs/api/remote-procedure-calls-wallet.md | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/docs/api/remote-procedure-call-quick-reference.md b/docs/api/remote-procedure-call-quick-reference.md index e20201bc..002de595 100644 --- a/docs/api/remote-procedure-call-quick-reference.md +++ b/docs/api/remote-procedure-call-quick-reference.md @@ -186,6 +186,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [KeyPoolRefill](../api/remote-procedure-calls-wallet.md#keypoolrefill): fills the cache of unused pre-generated keys (the keypool). * [ListAddressBalances](../api/remote-procedure-calls-wallet.md#listaddressbalances): lists addresses of this wallet and their balances _New in Dash Core 0.12.3_ * [ListAddressGroupings](../api/remote-procedure-calls-wallet.md#listaddressgroupings): lists groups of addresses that may have had their common ownership made public by common use as inputs in the same transaction or from being used as change from a previous transaction. _Updated in Dash Core 0.17.0_ +* [ListDescriptors](../api/remote-procedure-calls-wallet.md#listdescriptors): lists descriptors imported into a descriptor-enabled wallet. **New in Dash Core 21.0.0** * [ListLabels](../api/remote-procedure-calls-wallet.md#listlabels): returns the list of all labels, or labels that are assigned to addresses with a specific purpose. _New in Dash Core 0.17.0_ * [ListLockUnspent](../api/remote-procedure-calls-wallet.md#listlockunspent): returns a list of temporarily unspendable (locked) outputs. * [ListReceivedByAddress](../api/remote-procedure-calls-wallet.md#listreceivedbyaddress): lists the total number of dash received by each address. _Updated in Dash Core 0.17.0_ diff --git a/docs/api/remote-procedure-calls-wallet.md b/docs/api/remote-procedure-calls-wallet.md index 8782427f..f055e4ff 100644 --- a/docs/api/remote-procedure-calls-wallet.md +++ b/docs/api/remote-procedure-calls-wallet.md @@ -1686,6 +1686,65 @@ _See also_ * [GetTransaction](../api/remote-procedure-calls-wallet.md#gettransaction): gets detailed information about an in-wallet transaction. * [ListAddressBalances](../api/remote-procedure-calls-wallet.md#listaddressbalances): lists addresses of this wallet and their balances +## ListDescriptors + +> 📘 +> +> Requires [wallet](../resources/glossary.md#wallet) support (**unavailable on masternodes**). Wallet must be unlocked. + +_Added in Dash Core 21.0.0_ + +The [`listdescriptors` RPC](../api/remote-procedure-calls-wallet.md#listdescriptors) lists descriptors imported into a descriptor-enabled wallet. + +_Result---execution result_ + +| Name | Type | Presence | Description | +| ----------------- | -------------- | ----------------------- | ----------- | +| `wallet_name` | string | Required
(exactly 1) | Name of wallet this operation was performed on | +| `descriptors` | array | Required
(exactly 1) | An array of JSON objects, each describing a descriptor | +| → Descriptor | object | Required
(1 or more) | A JSON object describing a particular descriptor | +| → →
`desc` | string | Required
(exactly 1) | Descriptor string representation | +| → →
`timestamp`| number (int) | Required
(exactly 1) | The creation time of the descriptor in Unix epoch time | +| → →
`active` | bool | Required
(exactly 1) | Indicates whether this descriptor is currently used to generate new addresses | +| → →
`internal` | bool | Optional
(0 or 1) | True if this descriptor is used to generate change addresses; False if used for receiving | +| → →
`range` | array | Optional
(0 or 1) | Defined only for ranged descriptors | +| → →→
`start` | number (int) | Optional
(0 or 1) | Range start inclusive | +| → →→
`end` | number (int) | Optional
(0 or 1) | Range end inclusive | +| → →
`next` | number (int) | Optional
(0 or 1) | The next index to generate addresses from; defined only for ranged descriptors | + +_Example from Dash Core 21.1.0_ + +List all descriptors in a descriptor-enabled wallet: + +```bash +dash-cli listdescriptors +``` + +Result (example output): + +```json +{ + "wallet_name": "test-descriptor", + "descriptors": [ + { + "desc": "pkh([c7fe8acb/44'/1'/0']tpubDDgGSmowbmYWepHK5PJYCfzUFrKy1c7PHVumScWELYwwjaGBf73ZD1JD1xc2y4hKQDp4qHUKjxz8HQyJXmM5UQh797enQQSpq8vife8yva8/0/*)#tz4w30l2", + "timestamp": 1715259431, + "active": true, + "internal": false, + "range": [ + 0, + 999 + ], + "next": 0 + } + ] +} +``` + +_See also_ + +* [ImportDescriptors](../api/remote-procedure-calls-wallet.md#importdescriptors): imports multiple descriptors into the wallet, each with specific attributes. + ## ListLabels > 📘 From 7a6b5dbe5879db878ae206656b015799da58771c Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 14:46:19 -0400 Subject: [PATCH 3/9] chore: add prompt for creating new rpc documentation --- docs/api/ai-prompt.md | 101 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/docs/api/ai-prompt.md b/docs/api/ai-prompt.md index bb6b9a4b..5d02912c 100644 --- a/docs/api/ai-prompt.md +++ b/docs/api/ai-prompt.md @@ -14,4 +14,103 @@ Only list any discrepancies (including parameters and/or response fields that ha ## Remove the excess whitespace at the end of tables -Remove the whitespace padding from the last column of this markdown table. do not worry about alignment of the end of the line but do include the ending "|" with a single space before it \ No newline at end of file +Remove the whitespace padding from the last column of this markdown table. do not worry about alignment of the end of the line but do include the ending "|" with a single space before it + +## Create documentation for a new RPC + +Use this RPC documentation as a template to create documentation for new RPCs: + +```## ImportMulti + +> 📘 +> +> Requires [wallet](../resources/glossary.md#wallet) support (**unavailable on masternodes**). Wallet must be unlocked. + +_Added in Dash Core 0.12.3 / Bitcoin Core 0.14.0_ + +The [`importmulti` RPC](../api/remote-procedure-calls-wallet.md#importmulti) imports addresses or scripts (with private keys, public keys, or P2SH redeem scripts) and optionally performs the minimum necessary rescan for all imports. + +_Parameter #1---the addresses/scripts to import_ + +| Name | Type | Presence | Description| +| --------------------- | --------------------- | ----------------------- | -----------| +| Imports | array | Required
(exactly 1) | An array of JSON objects, each one being an address or script to be imported | +| → Import | object | Required
(1 or more) | A JSON object describing a particular import | +| → →
`scriptPubKey` | string (hex) | Optional
(0 or 1) | The script (string) to be imported. Must have either this field or `address` below | +| → →
`address` | string (base58) | Optional
(0 or 1) | The P2PKH or P2SH address to be imported. Must have either this field or `scriptPubKey` above | +| → →
`timestamp` | number (int) / string | Required
(exactly 1) | The creation time of the key in Unix epoch time or the string “now” to substitute the current synced block chain time. The timestamp of the oldest key will determine how far back block chain rescans need to begin. Specify `now` to bypass scanning for keys which are known to never have been used. Specify `0` to scan the entire block chain. Blocks up to 2 hours before the earliest key creation time will be scanned | +| → →
`redeemscript` | string | Optional
(0 or 1) | A redeem script. Only allowed if either the `address` field is a P2SH address or the `scriptPubKey` field is a P2SH scriptPubKey | +| → →
`pubkeys` | array | Optional
(0 or 1) | Array of strings giving pubkeys that must occur in the scriptPubKey or redeemscript | +| → →
`keys` | array | Optional
(0 or 1) | Array of strings giving private keys whose corresponding public keys must occur in the scriptPubKey or redeemscript | +| → →
`internal` | bool | Optional
(0 or 1) | Stating whether matching outputs should be treated as change rather than incoming payments. The default is `false` | +| → →
`watchonly` | bool | Optional
(0 or 1) | Stating whether matching outputs should be considered watched even when they're not spendable. This is only allowed if keys are empty. The default is `false` | +| → →
`label` | string | Optional
(0 or 1) | Label to assign to the address, only allowed with `internal` set to `false`. The default is an empty string (“”) | + +_Parameter #2---options regarding the import_ + +| Name | Type | Presence | Description | +| -------------- | ------ | -------------------- | ----------- | +| Option | object | Optional
(0 or 1) | JSON object with options regarding the import | +| →
`rescan` | bool | Optional
(0 or 1) | Set to `true` (the default) to rescan the entire local block chain for transactions affecting any imported address or script. Set to `false` to not rescan after the import. Rescanning may take a considerable amount of time and may require re-downloading blocks if using block chain pruning | + +_Result---execution result_ + +| Name | Type | Presence | Description | +| ------------------- | --------------- | ----------------------- | ----------------------------------------------------------------------------------------- | +| `result` | array | Required
(exactly 1) | An array of JSON objects, with each object describing the execution result of each import | +| → Result | object | Required
(1 or more) | A JSON object describing the execution result of an imported address or script | +| → →
`success` | string | Required
(exactly 1) | Displays `true` if the import has been successful or `false` if it failed | +| → →
`error` | string : object | Optional
(0 or 1) | A JSON object containing details about the error. Only displayed if the import fails | +| → → →
`code` | number (int) | Optional
(0 or 1) | The error code | +| → → →
`message` | string | Optional
(0 or 1) | The error message | + +_Example from Dash Core 0.12.3_ + +Import the address `ycCsAUKsjdmoP4qAXiS1cjYA4ixM48zJWe` (giving it a label and scanning the entire block chain) and the scriptPubKey `76a9146cf5870411edc31ba5630d61c7cddff55b884fda88ac` (giving a specific timestamp and label): + +```bash +dash-cli importmulti ' + [ + { + "scriptPubKey" : { "address": "ycCsAUKsjdmoP4qAXiS1cjYA4ixM48zJWe" }, + "timestamp" : 0, + "label" : "Personal" + }, + { + "scriptPubKey" : "76a9146cf5870411edc31ba5630d61c7cddff55b884fda88ac", + "timestamp" : 1493912405, + "label" : "TestFailure" + } + ]' '{ "rescan": true }' +``` + +Result (scriptPubKey import failed because `internal` was not set to `true`): + +```json +[ + { + "success": true + }, + { + "success": false, + "error": { + "code": -8, + "message": "Internal must be set for hex scriptPubKey" + } + } +] +``` + +_See also_ + +* [ImportPrivKey](../api/remote-procedure-calls-wallet.md#importprivkey): adds a private key to your wallet. The key should be formatted in the wallet import format created by the [`dumpprivkey` RPC](../api/remote-procedure-calls-wallet.md#dumpprivkey). +* [ImportAddress](../api/remote-procedure-calls-wallet.md#importaddress): adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs. +* [ImportWallet](../api/remote-procedure-calls-wallet.md#importwallet): imports private keys from a file in wallet dump file format (see the [`dumpwallet` RPC](../api/remote-procedure-calls-wallet.md#dumpwallet)). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes. +``` + + +Create documentation for the following new RPC using the style of previously provided RPC documentation as a template: + +``` +INSERT "HELP " OUTPUT HERE +``` From 01de711bc4cd4c908cf08a25a34f5400375ae206 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 15:18:31 -0400 Subject: [PATCH 4/9] docs(rpc): update gettransaction --- docs/api/remote-procedure-calls-wallet.md | 40 +++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/api/remote-procedure-calls-wallet.md b/docs/api/remote-procedure-calls-wallet.md index f055e4ff..8a70996c 100644 --- a/docs/api/remote-procedure-calls-wallet.md +++ b/docs/api/remote-procedure-calls-wallet.md @@ -946,8 +946,9 @@ _Result---a description of the transaction_ | →
`fee` | number (dash) | Optional
(0 or 1) | If an outgoing transaction, this is the fee paid by the transaction reported as negative dash | | →
`confirmations` | number (int) | Required
(exactly 1) | The number of confirmations the transaction has received. Will be `0` for unconfirmed and `-1` for conflicted | | →
`instantlock` | bool | Required
(exactly 1) | If set to `true`, this transaction is either protected by an [InstantSend](../resources/glossary.md#instantsend) lock or it is in a block that has received a [ChainLock](../resources/glossary.md#chainlock) | -| →
`instantlock_internal` | bool | Required
(exactly 1) | If set to `true`, this transaction has an [InstantSend](../resources/glossary.md#instantsend) lock | -| →
`chainlock` | bool | Required
(exactly 1) | _Added in Dash Core 0.14.0_

If set to `true`, this transaction is in a block that is locked (not susceptible to a chain re-org) | +| →
`instantlock-internal` | bool | Required
(exactly 1) | If set to `true`, this transaction has an [InstantSend](../resources/glossary.md#instantsend) lock. Available for 'send' and 'receive' category of transactions. | +| →
`chainlock` | bool | Required
(exactly 1) | _Added in Dash Core 0.14.0_

If set to `true`, this transaction is in a block that is locked (not susceptible to a chain re-org) | +| →
`trusted` | bool | Optional
(0 or 1) | Whether we consider the outputs of this unconfirmed transaction safe to spend. Only returned for unconfirmed transactions | | →
`generated` | bool | Optional
(0 or 1) | Set to `true` if the transaction is a coinbase. Not returned for regular transactions | | →
`blockhash` | string (hex) | Optional
(0 or 1) | 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 | | →
`blockheight` | string (hex) | Optional
(0 or 1) | The block height containing the transaction. Only returned for confirmed transactions | @@ -975,44 +976,41 @@ _Result---a description of the transaction_ | →
`hex` | string (hex) | Required
(exactly 1) | The transaction in serialized transaction format | | →
`decoded` | object | Optional
(0 or 1) | The decoded transaction (only present when `verbose` is passed), equivalent to the RPC [`decoderawtransaction` method](../api/remote-procedure-calls-raw-transactions.md#decoderawtransaction), or the RPC [`getrawtransaction` method](../api/remote-procedure-calls-raw-transactions.md#getrawtransaction) when `verbose` is passed. | -_Example from Dash Core 20.0.0_ +_Example from Dash Core 21.1.0_ ```bash dash-cli -testnet gettransaction \ - c099c882745ad150e9b2a55ef5818683c7ef597e1e5fc20856c67eabc3778ccc + 88a3fe6bf2ab4425dbf57d75ce761efa2e45556ec36b4fd5b6af6c00f01ebd63 ``` Result: ```json { - "amount": -50.00000000, - "fee": -0.00030000, - "confirmations": 810136, + "amount": 2.37570000, + "confirmations": 192419, "instantlock": true, "instantlock_internal": false, "chainlock": true, - "blockhash": "00000a01007be2912c3123085534b58d341cb5e5980b967e8dcc021089487a1e", - "blockheight": 65859, + "blockhash": "0000009f3480f5e2b6821af57ccbfeb064d9e18b6e9e669aad238f2b0059df1a", + "blockheight": 886992, "blockindex": 1, - "blocktime": 1553290594, - "txid": "c099c882745ad150e9b2a55ef5818683c7ef597e1e5fc20856c67eabc3778ccc", + "blocktime": 1692025132, + "txid": "88a3fe6bf2ab4425dbf57d75ce761efa2e45556ec36b4fd5b6af6c00f01ebd63", "walletconflicts": [ ], - "time": 1553290594, - "timereceived": 1688046610, + "time": 1692025132, + "timereceived": 1692213632, "details": [ { - "address": "ycCsAUKsjdmoP4qAXiS1cjYA4ixM48zJWe", - "category": "send", - "amount": -50.00000000, - "label": "Electrum", - "vout": 1, - "fee": -0.00030000, - "abandoned": false + "address": "ygU1vv8a2fhiM2gYUF1GjQAcjxgZUKY5MD", + "category": "receive", + "amount": 2.37570000, + "label": "First address", + "vout": 1 } ], - "hex": "0200000003aac865dba0e98fe32533df6bc3eaac160d04bb02966584fb61fc8d7788e09537010000006a47304402202d537257f23ab42b3e14f2ab533f39bb4586aa1b29a1f833f718a59493c8a601022019c6c156c20e66ef256519592b3c977b64d417c94aea4dca20cf18522a138993012103c67d86944315838aea7ec80d390b5d09b91b62483370d4979da5ccf7a7df77a9feffffff47833a270d2e2bac47bc5dc0df576c3a68b01bedbc89692060ac4113a6f9cb67010000006a4730440220442c19a913b10edc533bf63310f5294d6d91eec0eb9c510a3c6b0f33333f27320220501d5093ecdf603b8af9734e21d5de4710c8500309bfa4acdda243a294442b2c012103c67d86944315838aea7ec80d390b5d09b91b62483370d4979da5ccf7a7df77a9feffffffdcfd2d0fb30d79ffeadab8832e65be2310b67043ff3d74deac9a9cb825acda67000000006b483045022100cae8c025d3bec82903f356a5ec38d78a141447b6562e3aceac901f5fcc6f8567022076407835937514d6690c81c0c3b97f92d2b0ae9749249affaf539ead825692f4012102d6be44ab930ff67f084fbaf47a38b539b8d5da65c010952a972c9e524b6009dffeffffff0204fe2b00000000001976a914e3b0093477c2f629430d0a7b5813fe8b0153b0fd88ac00f2052a010000001976a914ae4365dedb1836ba215b9149602e0787a23376d288ac42010100" + "hex": "02000000016634e15fe22fe84554833f109916fced5af30fac0849a211f17f326162280f14010000006a47304402207b8f61bebe3560b6ef70de3e10b59bdc60931d09cf0626026bfe3064dcfcf1c00220048ad98398cb294fa19335110db3ce5a466b74cbbf234bf2b4855b264a03ef790121027b90f229e7027758f0c8b39d2d485b88ed5b63b34e58e0dad2a07e3e8eb03373feffffff0278f51104000000001976a9148907e625c343ac9c6b56e8180f73af1d23350d0c88acd007290e000000001976a914dd01754e43690f41feef2cc7974bc2e5101e9f2788accf880d00" } ``` From 1f6305b923a06a8cce86c771e6d535e80238f53a Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 15:19:25 -0400 Subject: [PATCH 5/9] docs(rpc): listdescriptors fixes --- docs/api/remote-procedure-calls-wallet.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/remote-procedure-calls-wallet.md b/docs/api/remote-procedure-calls-wallet.md index 8a70996c..ed0f0323 100644 --- a/docs/api/remote-procedure-calls-wallet.md +++ b/docs/api/remote-procedure-calls-wallet.md @@ -1698,17 +1698,17 @@ _Result---execution result_ | Name | Type | Presence | Description | | ----------------- | -------------- | ----------------------- | ----------- | -| `wallet_name` | string | Required
(exactly 1) | Name of wallet this operation was performed on | -| `descriptors` | array | Required
(exactly 1) | An array of JSON objects, each describing a descriptor | -| → Descriptor | object | Required
(1 or more) | A JSON object describing a particular descriptor | -| → →
`desc` | string | Required
(exactly 1) | Descriptor string representation | -| → →
`timestamp`| number (int) | Required
(exactly 1) | The creation time of the descriptor in Unix epoch time | -| → →
`active` | bool | Required
(exactly 1) | Indicates whether this descriptor is currently used to generate new addresses | -| → →
`internal` | bool | Optional
(0 or 1) | True if this descriptor is used to generate change addresses; False if used for receiving | -| → →
`range` | array | Optional
(0 or 1) | Defined only for ranged descriptors | -| → →→
`start` | number (int) | Optional
(0 or 1) | Range start inclusive | -| → →→
`end` | number (int) | Optional
(0 or 1) | Range end inclusive | -| → →
`next` | number (int) | Optional
(0 or 1) | The next index to generate addresses from; defined only for ranged descriptors | +| `wallet_name` | string | Required
(exactly 1) | Name of wallet this operation was performed on | +| `descriptors` | array | Required
(exactly 1) | An array of JSON objects, each describing a descriptor | +| → Descriptor | object | Required
(1 or more) | A JSON object describing a particular descriptor | +| → →
`desc` | string | Required
(exactly 1) | Descriptor string representation | +| → →
`timestamp`| number (int) | Required
(exactly 1) | The creation time of the descriptor in Unix epoch time | +| → →
`active` | bool | Required
(exactly 1) | Indicates whether this descriptor is currently used to generate new addresses | +| → →
`internal` | bool | Optional
(0 or 1) | True if this descriptor is used to generate change addresses; False if used for receiving | +| → →
`range` | array | Optional
(0 or 1) | Defined only for ranged descriptors | +| → →→
`start` | number (int) | Required
(exactly 1) | Range start inclusive | +| → →→
`end` | number (int) | Required
(exactly 1) | Range end inclusive | +| → →
`next` | number (int) | Optional
(0 or 1) | The next index to generate addresses from; defined only for ranged descriptors | _Example from Dash Core 21.1.0_ From e49d42302b9e2a2e2e76f1c9389fa51480c7e650 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 16:09:08 -0400 Subject: [PATCH 6/9] docs(rpc): update gettxout, decoderawtx, gettx, getrawtx, decodescript --- .../remote-procedure-call-quick-reference.md | 8 +- docs/api/remote-procedure-calls-blockchain.md | 10 +- ...remote-procedure-calls-raw-transactions.md | 158 +++++++----------- 3 files changed, 73 insertions(+), 103 deletions(-) diff --git a/docs/api/remote-procedure-call-quick-reference.md b/docs/api/remote-procedure-call-quick-reference.md index 002de595..865f8d27 100644 --- a/docs/api/remote-procedure-call-quick-reference.md +++ b/docs/api/remote-procedure-call-quick-reference.md @@ -42,7 +42,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [GetMerkleBlocks](../api/remote-procedure-calls-blockchain.md#getmerkleblocks): returns an array of hex-encoded merkleblocks for blocks starting from which match . _New in Dash Core 0.15.0_ * [GetSpecialTxes](../api/remote-procedure-calls-blockchain.md#getspecialtxes): returns an array of special transactions found in the specified block _New in Dash Core 0.13.1_ * [GetSpentInfo](../api/remote-procedure-calls-blockchain.md#getspentinfo): returns the txid and index where an output is spent (requires `spentindex` to be enabled). New in Dash Core 0.12.1 -* [GetTxOut](../api/remote-procedure-calls-blockchain.md#gettxout): returns details about an unspent transaction output (UTXO). _Updated in Dash Core 0.15.0_ +* [GetTxOut](../api/remote-procedure-calls-blockchain.md#gettxout): returns details about an unspent transaction output (UTXO). **Updated in Dash Core 21.0.0** * [GetTxOutProof](../api/remote-procedure-calls-blockchain.md#gettxoutproof): returns a hex-encoded proof that one or more specified transactions were included in a block. * [GetTxOutSetInfo](../api/remote-procedure-calls-blockchain.md#gettxoutsetinfo): returns statistics about the confirmed unspent transaction output (UTXO) set. Note that this call may take some time and that it only counts outputs from confirmed transactions---it does not count outputs from the memory pool. _Updated in Dash Core 18.1.0_ * [PreciousBlock](../api/remote-procedure-calls-blockchain.md#preciousblock): treats a block as if it were received before others with the same work. _New in Dash Core 0.12.3_ @@ -127,11 +127,11 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [GetAssetUnlockStatuses](../api/remote-procedure-calls-raw-transactions.md#getassetunlockstatuses): returns the status of the provided Asset Unlock indexes at the tip of the chain or at a particular block height if specified. **New in Dash Core 20.1.0** * [CreateRawTransaction](../api/remote-procedure-calls-raw-transactions.md#createrawtransaction): creates an unsigned serialized transaction that spends a previous output to a new output with a P2PKH or P2SH address. The transaction is not stored in the wallet or transmitted to the network. _Updated in Dash Core 0.17.0_ * [DecodePSBT](../api/remote-procedure-calls-raw-transactions.md#decodepsbt): returns a JSON object representing the serialized, base64-encoded partially signed Dash transaction. _New in Dash Core 18.0.0_ -* [DecodeRawTransaction](../api/remote-procedure-calls-raw-transactions.md#decoderawtransaction): decodes a serialized transaction hex string into a JSON object describing the transaction. _Updated in Dash Core 0.13.0_ -* [DecodeScript](../api/remote-procedure-calls-raw-transactions.md#decodescript): decodes a hex-encoded P2SH redeem script. +* [DecodeRawTransaction](../api/remote-procedure-calls-raw-transactions.md#decoderawtransaction): decodes a serialized transaction hex string into a JSON object describing the transaction. **Updated in Dash Core 21.0.0** +* [DecodeScript](../api/remote-procedure-calls-raw-transactions.md#decodescript): decodes a hex-encoded P2SH redeem script. **Updated in Dash Core 21.0.0** * [FinalizePSBT](../api/remote-procedure-calls-raw-transactions.md#finalizepsbt): finalizes the inputs of a PSBT. The PSBT produces a network serialized transaction if the transaction is fully signed. _New in Dash Core 18.0.0_ * [FundRawTransaction](../api/remote-procedure-calls-raw-transactions.md#fundrawtransaction): adds inputs to a transaction until it has enough in value to meet its out value. **Updated in Dash Core 21.0.0** -* [GetRawTransaction](../api/remote-procedure-calls-raw-transactions.md#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. _Updated in Dash Core 0.16.0_ +* [GetRawTransaction](../api/remote-procedure-calls-raw-transactions.md#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. **Updated in Dash Core 21.0.0** * [GetRawTransactionMulti](../api/remote-procedure-calls-raw-transactions.md#getrawtransactionmulti): gets hex-encoded serialized transactions or a JSON object describing the multiple transactions. **Added in Dash Core 20.1.0** * [GetTxChainlocks](../api/remote-procedure-calls-raw-transactions.md#gettxchainlocks): returns the block height each transaction was mined at and whether it is ChainLocked or not. **Updated in Dash Core 20.1.0** * [JoinPSBTs](../api/remote-procedure-calls-raw-transactions.md#joinpsbts): joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs. diff --git a/docs/api/remote-procedure-calls-blockchain.md b/docs/api/remote-procedure-calls-blockchain.md index fa7945ad..e2070270 100644 --- a/docs/api/remote-procedure-calls-blockchain.md +++ b/docs/api/remote-procedure-calls-blockchain.md @@ -1994,9 +1994,10 @@ Name | Type | Presence | Description →
`scriptPubKey` | string : object | Optional
(0 or 1) | An object with information about the pubkey script. This may be `null` if there was no pubkey script → →
`asm` | string | Required
(exactly 1) | The pubkey script in decoded form with non-data-pushing opcodes listed → →
`hex` | string (hex) | Required
(exactly 1) | The pubkey script encoded as hex -→ →
`reqSigs` | number (int) | Optional
(0 or 1) | The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) +→ →
`reqSigs` | number (int) | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) → →
`type` | string | Optional
(0 or 1) | The type of script. This will be one of the following:
• `pubkey` for a P2PK script
• `pubkeyhash` for a P2PKH script
• `scripthash` for a P2SH script
• `multisig` for a bare multisig script
• `nulldata` for nulldata scripts
• `nonstandard` for unknown scripts -→ →
`addresses` | string : array | Optional
(0 or 1) | The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types +→ →
`address` | string | Optional
(0 or 1) | Dash address (only if a well-defined address exists) +→ →
`addresses` | string : array | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types → → →
Address | string | Required
(1 or more) | A P2PKH or P2SH address →
`coinbase` | bool | Required
(exactly 1) | Set to `true` if the transaction output belonged to a coinbase transaction; set to `false` for all other transactions. Coinbase transactions need to have 101 confirmations before their outputs can be spent @@ -2021,11 +2022,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 b66266c5017a759817f3bb99e8d9124bf5bb2e74 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914b66266c5017a759817f3bb99e8d9124bf5bb2e7488ac", - "reqSigs": 1, "type": "pubkeyhash", - "addresses": [ - "ycwoiAibTjpwnoCZSX7S4kiB2H8wULw9qo" - ] + "address": "ycwoiAibTjpwnoCZSX7S4kiB2H8wULw9qo" }, "coinbase": false } diff --git a/docs/api/remote-procedure-calls-raw-transactions.md b/docs/api/remote-procedure-calls-raw-transactions.md index c75288f3..fbe8be37 100644 --- a/docs/api/remote-procedure-calls-raw-transactions.md +++ b/docs/api/remote-procedure-calls-raw-transactions.md @@ -535,14 +535,15 @@ _Result---the decoded transaction_ | → → →
`scriptPubKey` | object | Required
(exactly 1) | An object describing the pubkey script | | → → → →
`asm` | string | Required
(exactly 1) | The pubkey script in decoded form with non-data-pushing opcodes listed | | → → → →
`hex` | string (hex) | Required
(exactly 1) | The pubkey script encoded as hex | -| → → → →
`reqSigs` | number (int) | Optional
(0 or 1) | The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) | +| → → → →
`reqSigs` | number (int) | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) | | → → → →
`type` | string | Optional
(0 or 1) | The type of script. This will be one of the following:
• `pubkey` for a P2PK script
• `pubkeyhash` for a P2PKH script
• `scripthash` for a P2SH script
• `multisig` for a bare multisig script
• `nulldata` for nulldata scripts
• `nonstandard` for unknown scripts | -| → → → →
`addresses` | string : array | Optional
(0 or 1) | The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types | +| → → →
`address` | string | Optional
(0 or 1) | Dash address (only if a well-defined address exists) | +| → → → →
`addresses` | string : array | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types | | → → → → →
Address | string | Required
(1 or more) | A P2PKH or P2SH address | | →
`extraPayloadSize` | number (int) | Optional
(0 or 1) | _Added in Dash Core 0.13.0.0_

Size of the DIP2 extra payload. Only present if it's a DIP2 special transaction | | →
`extraPayload` | string (hex) | Optional
(0 or 1) | _Added in Dash Core 0.13.0.0_

Hex encoded DIP2 extra payload data. Only present if it's a DIP2 special transaction | -_Example from Dash Core 0.13.0_ +_Example from Dash Core 21.1.0_ Decode a signed one-input, two-output transaction: @@ -584,11 +585,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 b02ae52066542b4aec5cf45c7cae3183d7bd3227 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914b02ae52066542b4aec5cf45c7cae3183d7bd322788ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "ycNwAN4DQ7Xnw5XLKg84SR4U1GE22FfLNQ" - ] + "address": "ycNwAN4DQ7Xnw5XLKg84SR4U1GE22FfLNQ", + "type": "pubkeyhash" } }, { @@ -598,11 +596,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 252c9de3a0ebd5c95886187b24969d4ccdb5576e OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914252c9de3a0ebd5c95886187b24969d4ccdb5576e88ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yPi1JKw5fn8bMFsCCtnkGagogW6GXwGktZ" - ] + "address": "yPi1JKw5fn8bMFsCCtnkGagogW6GXwGktZ", + "type": "pubkeyhash" } } ] @@ -644,11 +639,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 cbd7bfcc50351180132b2c0698cb90ad74c473c7 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914cbd7bfcc50351180132b2c0698cb90ad74c473c788ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yeuGUfPMrbEqAS2Pw1wonYgEPbM4LAA9LK" - ] + "address": "yeuGUfPMrbEqAS2Pw1wonYgEPbM4LAA9LK", + "type": "pubkeyhash" } }, { @@ -658,11 +650,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 88a060bc2dfe05780ae4dcb6c98b12436c35a939 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a91488a060bc2dfe05780ae4dcb6c98b12436c35a93988ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yYmrsYP3XYMZr1cGtha3QzmuNB1C7CfyhV" - ] + "address": "yYmrsYP3XYMZr1cGtha3QzmuNB1C7CfyhV", + "type": "pubkeyhash" } } ], @@ -700,13 +689,13 @@ _Result---the decoded script_ | ---------------- | ------------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `result` | object | Required
(exactly 1) | An object describing the decoded script, or JSON `null` if the script could not be decoded | | →
`asm` | string | Required
(exactly 1) | The redeem script in decoded form with non-data-pushing opcodes listed. May be empty | -| →
`reqSigs` | number (int) | Optional
(0 or 1) | 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) | +| →
`reqSigs` | number (int) | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

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) | | →
`type` | string | Optional
(0 or 1) | The type of script. This will be one of the following:
• `pubkey` for a P2PK script inside P2SH
• `pubkeyhash` for a P2PKH script inside P2SH
• `multisig` for a multisig script inside P2SH
• `nonstandard` for unknown scripts | -| →
`addresses` | array | Optional
(0 or 1) | A P2PKH addresses used in this script, or the computed P2PKH addresses of any pubkeys in this script. This array will not be returned for `nonstandard` script types | +| →
`addresses` | array | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

A P2PKH addresses used in this script, or the computed P2PKH addresses of any pubkeys in this script. This array will not be returned for `nonstandard` script types | | → →
Address | string | Required
(1 or more) | A P2PKH address | | →
`p2sh` | string (hex) | Required
(exactly 1) | The P2SH address of this redeem script | -_Example from Dash Core 18.0.0_ +_Example from Dash Core 21.0.0_ A 2-of-3 P2SH multisig pubkey script: @@ -722,13 +711,7 @@ Result: ```json { "asm": "2 02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29 0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88 03251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d0 3 OP_CHECKMULTISIG", - "reqSigs": 2, "type": "multisig", - "addresses": [ - "yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb", - "yWAk1cDVvsRdPYjnzcFkySJux75yaCE7xz", - "yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87" - ], "p2sh": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW" } ``` @@ -987,9 +970,10 @@ _Result (if verbose=`true`)---the decoded transaction_ | → → →
`scriptPubKey` | object | Required
(exactly 1) | An object describing the pubkey script | | → → → →
`asm` | string | Required
(exactly 1) | The pubkey script in decoded form with non-data-pushing opcodes listed | | → → → →
`hex` | string (hex) | Required
(exactly 1) | The pubkey script encoded as hex | -| → → → →
`reqSigs` | number (int) | Optional
(0 or 1) | The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) | +| → → → →
`reqSigs` | number (int) | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The number of signatures required; this is always `1` for P2PK, P2PKH, and P2SH (including P2SH multisig because the redeem script is not available in the pubkey script). It may be greater than 1 for bare multisig. This value will not be returned for `nulldata` or `nonstandard` script types (see the `type` key below) | | → → → →
`type` | string | Optional
(0 or 1) | The type of script. This will be one of the following:
• `pubkey` for a P2PK script
• `pubkeyhash` for a P2PKH script
• `scripthash` for a P2SH script
• `multisig` for a bare multisig script
• `nulldata` for nulldata scripts
• `nonstandard` for unknown scripts | -| → → → →
`addresses` | string : array | Optional
(0 or 1) | The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types | +| → → →
`address` | string | Optional
(0 or 1) | Dash address (only if a well-defined address exists) | +| → → → →
`addresses` | string : array | Optional
(0 or 1) | **Deprecated in Dash Core 21.0.0** (returned only if config option -deprecatedrpc=addresses is passed)

The P2PKH or P2SH addresses used in this transaction, or the computed P2PKH address of any pubkeys in this transaction. This array will not be returned for `nulldata` or `nonstandard` script types | | → → → → →
Address | string | Required
(1 or more) | A P2PKH or P2SH address | | →
`extraPayloadSize` | number (int) | Optional
(0 or 1) | _Added in Dash Core 0.13.0.0_

Size of the DIP2 extra payload. Only present if it's a DIP2 special transaction | | →
`extraPayload` | string (hex) | Optional
(0 or 1) | _Added in Dash Core 0.13.0.0_

Hex encoded DIP2 extra payload data. Only present if it's a DIP2 special transaction | @@ -1003,32 +987,32 @@ _Result (if verbose=`true`)---the decoded transaction_ | →
`instantlock_internal` | bool | Required
(exactly 1) | If set to `true`, this transaction has an [InstantSend](../resources/glossary.md#instantsend) lock | | →
`chainlock` | bool | Required
(exactly 1) | _Added in Dash Core 0.14.0_

If set to `true`, this transaction is in a block that is locked (not susceptible to a chain re-org) | -_Examples from Dash Core 0.14.0_ +_Examples from Dash Core 21.1.0_ A classical transaction in serialized transaction format: ```bash dash-cli getrawtransaction \ - f4de3be04efa18e203c9d0b7ad11bb2517f5889338918ed300a374f5bd736ed7 + 88a3fe6bf2ab4425dbf57d75ce761efa2e45556ec36b4fd5b6af6c00f01ebd63 ``` Result (wrapped): ```text -02000000015d0b26079696875e9fc3cb480420aae3c8b1da628fbb14cc718066\ -df7fe7c5fd010000006a47304402202cfa683981898ad9adb8953423a38f7185\ -ed41e163aa195d608fbe5bc3034910022034e2376aaed1c6576c0dad79d626ee\ -27f706baaed86dabb105979c3e6f6e1cb9012103d14eb001cf0908f3a2333d17\ -1f6236497a82318a6a6f649b4d7fd8e5c8922e08feffffff021e3f4b4c000000\ -001976a914b02ae52066542b4aec5cf45c7cae3183d7bd322788ac00f9029500\ -0000001976a914252c9de3a0ebd5c95886187b24969d4ccdb5576e88ac943d0000 +02000000016634e15fe22fe84554833f109916fced5af30fac0849a211f17f326\ +162280f14010000006a47304402207b8f61bebe3560b6ef70de3e10b59bdc6093\ +1d09cf0626026bfe3064dcfcf1c00220048ad98398cb294fa19335110db3ce5a4\ +66b74cbbf234bf2b4855b264a03ef790121027b90f229e7027758f0c8b39d2d48\ +5b88ed5b63b34e58e0dad2a07e3e8eb03373feffffff0278f5110400000000197\ +6a9148907e625c343ac9c6b56e8180f73af1d23350d0c88acd007290e00000000\ +1976a914dd01754e43690f41feef2cc7974bc2e5101e9f2788accf880d00 ``` Get the same transaction in JSON: ```bash dash-cli getrawtransaction \ -f4de3be04efa18e203c9d0b7ad11bb2517f5889338918ed300a374f5bd736ed7 \ +88a3fe6bf2ab4425dbf57d75ce761efa2e45556ec36b4fd5b6af6c00f01ebd63 \ 1 ``` @@ -1036,67 +1020,61 @@ Result: ```json { - "txid": "f4de3be04efa18e203c9d0b7ad11bb2517f5889338918ed300a374f5bd736ed7", + "txid": "88a3fe6bf2ab4425dbf57d75ce761efa2e45556ec36b4fd5b6af6c00f01ebd63", "version": 2, "type": 0, "size": 225, - "locktime": 15764, + "locktime": 886991, "vin": [ { - "txid": "fdc5e77fdf668071cc14bb8f62dab1c8e3aa200448cbc39f5e87969607260b5d", + "txid": "140f286261327ff111a24908ac0ff35aedfc1699103f835445e82fe25fe13466", "vout": 1, "scriptSig": { - "asm": "304402202cfa683981898ad9adb8953423a38f7185ed41e163aa195d608fbe5bc3034910022034e2376aaed1c6576c0dad79d626ee27f706baaed86dabb105979c3e6f6e1cb9[ALL] 03d14eb001cf0908f3a2333d171f6236497a82318a6a6f649b4d7fd8e5c8922e08", - "hex": "47304402202cfa683981898ad9adb8953423a38f7185ed41e163aa195d608fbe5bc3034910022034e2376aaed1c6576c0dad79d626ee27f706baaed86dabb105979c3e6f6e1cb9012103d14eb001cf0908f3a2333d171f6236497a82318a6a6f649b4d7fd8e5c8922e08" + "asm": "304402207b8f61bebe3560b6ef70de3e10b59bdc60931d09cf0626026bfe3064dcfcf1c00220048ad98398cb294fa19335110db3ce5a466b74cbbf234bf2b4855b264a03ef79[ALL] 027b90f229e7027758f0c8b39d2d485b88ed5b63b34e58e0dad2a07e3e8eb03373", + "hex": "47304402207b8f61bebe3560b6ef70de3e10b59bdc60931d09cf0626026bfe3064dcfcf1c00220048ad98398cb294fa19335110db3ce5a466b74cbbf234bf2b4855b264a03ef790121027b90f229e7027758f0c8b39d2d485b88ed5b63b34e58e0dad2a07e3e8eb03373" }, - "value": 37.80000000, - "valueSat": 3780000000, - "address": "yTsGq4wV8WF5GKLaYV2C43zrkr2sfTtysT", + "value": 3.05867613, + "valueSat": 305867613, + "address": "yeuA2vwH1Zba2pGs3NaeJh53ZuW97h2jXJ", "sequence": 4294967294 } ], "vout": [ { - "value": 12.79999774, - "valueSat": 1279999774, + "value": 0.68285816, + "valueSat": 68285816, "n": 0, "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 b02ae52066542b4aec5cf45c7cae3183d7bd3227 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914b02ae52066542b4aec5cf45c7cae3183d7bd322788ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "ycNwAN4DQ7Xnw5XLKg84SR4U1GE22FfLNQ" - ] + "asm": "OP_DUP OP_HASH160 8907e625c343ac9c6b56e8180f73af1d23350d0c OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9148907e625c343ac9c6b56e8180f73af1d23350d0c88ac", + "address": "yYoztKLNFLvbNYAPMUGoa5iHz5SBtNLEK8", + "type": "pubkeyhash" }, - "spentTxId": "85b40136f077cded9587022645fde82389e2f01b0bec697d8cd22ccab930f3d3", - "spentIndex": 19, - "spentHeight": 20631 + "spentTxId": "194e514c9814f7e34be3f8c696fff5871bda40bef2f87be1ff8075f691ef6e0b", + "spentIndex": 0, + "spentHeight": 887750 }, { - "value": 25.00000000, - "valueSat": 2500000000, + "value": 2.37570000, + "valueSat": 237570000, "n": 1, "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 252c9de3a0ebd5c95886187b24969d4ccdb5576e OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914252c9de3a0ebd5c95886187b24969d4ccdb5576e88ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yPi1JKw5fn8bMFsCCtnkGagogW6GXwGktZ" - ] + "asm": "OP_DUP OP_HASH160 dd01754e43690f41feef2cc7974bc2e5101e9f27 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914dd01754e43690f41feef2cc7974bc2e5101e9f2788ac", + "address": "ygU1vv8a2fhiM2gYUF1GjQAcjxgZUKY5MD", + "type": "pubkeyhash" }, - "spentTxId": "90aa8902dbab71c07a5ac06dfe45c5e5fa1f032788b5f916951d0969c9feef39", - "spentIndex": 1, - "spentHeight": 24630 + "spentTxId": "b9748455ee0bc7d3142a621b7a1f41d1b03a40283922d54cd4d168c16d20102a", + "spentIndex": 0, + "spentHeight": 888363 } ], - "hex": "02000000015d0b26079696875e9fc3cb480420aae3c8b1da628fbb14cc718066df7fe7c5fd010000006a47304402202cfa683981898ad9adb8953423a38f7185ed41e163aa195d608fbe5bc3034910022034e2376aaed1c6576c0dad79d626ee27f706baaed86dabb105979c3e6f6e1cb9012103d14eb001cf0908f3a2333d171f6236497a82318a6a6f649b4d7fd8e5c8922e08feffffff021e3f4b4c000000001976a914b02ae52066542b4aec5cf45c7cae3183d7bd322788ac00f90295000000001976a914252c9de3a0ebd5c95886187b24969d4ccdb5576e88ac943d0000", - "blockhash": "0000000005f395d62a40ef9f2a13000bd4076e2131c8671db8333a5b31e4403f", - "height": 15765, - "confirmations": 153657, - "time": 1546278750, - "blocktime": 1546278750, + "hex": "02000000016634e15fe22fe84554833f109916fced5af30fac0849a211f17f326162280f14010000006a47304402207b8f61bebe3560b6ef70de3e10b59bdc60931d09cf0626026bfe3064dcfcf1c00220048ad98398cb294fa19335110db3ce5a466b74cbbf234bf2b4855b264a03ef790121027b90f229e7027758f0c8b39d2d485b88ed5b63b34e58e0dad2a07e3e8eb03373feffffff0278f51104000000001976a9148907e625c343ac9c6b56e8180f73af1d23350d0c88acd007290e000000001976a914dd01754e43690f41feef2cc7974bc2e5101e9f2788accf880d00", + "blockhash": "0000009f3480f5e2b6821af57ccbfeb064d9e18b6e9e669aad238f2b0059df1a", + "height": 886992, + "confirmations": 192439, + "time": 1692025132, + "blocktime": 1692025132, "instantlock": true, "instantlock_internal": false, "chainlock": true @@ -1153,11 +1131,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 cbd7bfcc50351180132b2c0698cb90ad74c473c7 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914cbd7bfcc50351180132b2c0698cb90ad74c473c788ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yeuGUfPMrbEqAS2Pw1wonYgEPbM4LAA9LK" - ] + "address": "yeuGUfPMrbEqAS2Pw1wonYgEPbM4LAA9LK", + "type": "pubkeyhash" }, "spentTxId": "1790b286922d1a439bdc056939bc902a222f9d66ee63d8427805617eedf835bd", "spentIndex": 83, @@ -1170,11 +1145,8 @@ Result: "scriptPubKey": { "asm": "OP_DUP OP_HASH160 88a060bc2dfe05780ae4dcb6c98b12436c35a939 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a91488a060bc2dfe05780ae4dcb6c98b12436c35a93988ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "yYmrsYP3XYMZr1cGtha3QzmuNB1C7CfyhV" - ] + "address": "yYmrsYP3XYMZr1cGtha3QzmuNB1C7CfyhV", + "type": "pubkeyhash" } } ], @@ -1189,7 +1161,7 @@ Result: "hex": "03000500010000000000000000000000000000000000000000000000000000000000000000ffffffff2703ae50011a4d696e656420627920416e74506f6f6c2021000b01201da9196f0000000007000000ffffffff02809e4730000000001976a914cbd7bfcc50351180132b2c0698cb90ad74c473c788ac809e4730000000001976a91488a060bc2dfe05780ae4dcb6c98b12436c35a93988ac00000000460200ae50010078e5c08b39960887bf95185c381bdb719e60b6925fa12af78a8824fade927387c757acb6bac63da84f9245e20cfd5d830382ac634d434725ca6349ab5db920a3", "blockhash": "00000000007b0fb99e36713cf08012482478ee496e6dcb4007ad2e806306e62b", "height": 86190, - "confirmations": 83233, + "confirmations": 993241, "time": 1556114577, "blocktime": 1556114577, "instantlock": true, From d914a4441747cea174028d507a40f88edf95f40b Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 16:34:43 -0400 Subject: [PATCH 7/9] docs(rpc): update getpeerinfo --- docs/api/remote-procedure-calls-network.md | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/api/remote-procedure-calls-network.md b/docs/api/remote-procedure-calls-network.md index 4b7861fb..c6a30d4c 100644 --- a/docs/api/remote-procedure-calls-network.md +++ b/docs/api/remote-procedure-calls-network.md @@ -534,7 +534,9 @@ The [`getpeerinfo` RPC](../api/remote-procedure-calls-network.md#getpeerinfo) re | → →
`version` | number (int) | Required
(exactly 1) | The protocol version number used by this node. See the [protocol versions section](../reference/p2p-network-protocol-versions.md) for more information | | → →
`subver` | string | Required
(exactly 1) | The user agent this node sends in its [`version` message](../reference/p2p-network-control-messages.md#version). This string will have been sanitized to prevent corrupting the JSON results. May be an empty string | | → →
`inbound` | bool | Required
(exactly 1) | Set to `true` if this node connected to us (inbound); set to `false` if we connected to this node (outbound) | -| → →
`addnode` | bool | Required
(exactly 1) | Set to `true` if this node was added via the [`addnode` RPC](../api/remote-procedure-calls-network.md#addnode). | +| → →
`bip152_hb_to` | bool | Required
(exactly 1) | Whether we selected peer as (compact blocks) high-bandwidth peer | +| → →
`bip152_hb_from` | bool | Required
(exactly 1) | Whether peer selected us as (compact blocks) high-bandwidth peer | +| → →
`addnode` | bool | Required
(exactly 1) | **DEPRECATED, returned only if the config option -deprecatedrpc=getpeerinfo_addnode is passed**
Set to `true` if this node was added via the [`addnode` RPC](../api/remote-procedure-calls-network.md#addnode). | | → →
`masternode` | bool | Required
(exactly 1) | *Added in Dash Core 0.16.0*
Whether connection was due to masternode connection attempt | | → →
`banscore` | number (int) | Required
(exactly 1) | *DEPRECATED, returned only if config option -deprecatedrpc=banscore is passed*
The ban score we've assigned the node based on any misbehavior it's made. By default, Dash Core disconnects when the ban score reaches `100` | | → →
`startingheight` | number (int) | Required
(exactly 1) | The height of the remote node's block chain when it connected to us as reported in its [`version` message](../reference/p2p-network-control-messages.md#version) | @@ -542,16 +544,16 @@ The [`getpeerinfo` RPC](../api/remote-procedure-calls-network.md#getpeerinfo) re | → →
`synced_blocks` | number (int) | Required
(exactly 1) | The highest-height block we have in common with this node based on P2P [`inv` messages](../reference/p2p-network-data-messages.md#inv) this node sent us. If no block [`inv` messages](../reference/p2p-network-data-messages.md#inv) have been received from this node, this will be set to `-1` | | → →
`inflight` | array | Required
(exactly 1) | An array of blocks which have been requested from this peer. May be empty | | → → →
Blocks | number (int) | Optional
(0 or more) | The height of a block being requested from the remote peer | -| `addr_relay_enabled` | bool | Required
(exactly 1) | Whether we participate in address relay with this peer. | -| `addr_processed` | number (int) | Required
(exactly 1) | The total number of addresses processed, excluding those dropped due to rate limiting. | -| `addr_rate_limited` | number (int) | Required
(exactly 1) | The total number of addresses dropped due to rate limiting. | -| → →
`whitelisted` | bool | Required
(exactly 1) | Set to `true` if the remote peer has been whitelisted; otherwise, set to `false`. Whitelisted peers will not be banned if their ban score exceeds the maximum (100 by default). By default, peers connecting from localhost are whitelisted | +| → →
`addr_relay_enabled` | bool | Required
(exactly 1) | Whether we participate in address relay with this peer. | +| → →
`addr_processed` | number (int) | Required
(exactly 1) | The total number of addresses processed, excluding those dropped due to rate limiting. | +| → →
`addr_rate_limited` | number (int) | Required
(exactly 1) | The total number of addresses dropped due to rate limiting. | +| → →
`whitelisted` | bool | Required
(exactly 1) | **DEPRECATED, returned only if config option -deprecatedrpc=whitelisted is passed**
Set to `true` if the remote peer has been whitelisted; otherwise, set to `false`. Whitelisted peers will not be banned if their ban score exceeds the maximum (100 by default). By default, peers connecting from localhost are whitelisted | | → →
`permissions` | array | Required
(exactly 1) | _Added in Dash Core 18.0.0_
Any special permissions that have been granted to this peer | | → →
`bytessent_per_msg` | string :
object | Required
(exactly 1) | *Added in Bitcoin Core 0.13.0*

Information about total sent bytes aggregated by message type | | → → →
Message Type | number (int) | Required
(1 or more) | Total sent bytes aggregated by message type. One field for every used message type | | → →
`bytesrecv_per_msg` | string :
object | Required
(exactly 1) | *Added in Bitcoin Core 0.13.0*

Information about total received bytes aggregated by message type | | → → →
Message Type | number (int) | Required
(1 or more) | Total received bytes aggregated by message type. One field for every used message type | -| `connection_type` | string | Required
(exactly 1) | **Added in Dash Core 20.1.0**
Type of connection:
outbound-full-relay, block-relay-only, inbound, manual, addr-fetch, feeler.
Describes how the connection was established.
**Note: This output is subject to change in future releases as connection behaviors are refined.** | +| `connection_type` | string | Required
(exactly 1) | **Added in Dash Core 20.1.0**
Type of connection:
outbound-full-relay, block-relay-only, inbound, manual, addr-fetch, feeler.
Describes how the connection was established. Set to `true` if this node was added via the [`addnode` RPC](../api/remote-procedure-calls-network.md#addnode).
**Note: This output is subject to change in future releases as connection behaviors are refined.** | *Example from Dash Core 21.0.0* @@ -585,12 +587,13 @@ Result (edited to show only a single entry, with IP addresses changed to "bytesrecv": 486133, "conntime": 1715200196, "timeoffset": 0, - "pingtime": 0.11961, - "minping": 0.100297, - "version": 70231, - "subver": "/Dash Core:21.0.0(dcg-masternode-61)/", + "pingtime": 0.105995, + "minping": 0.095181, + "version": 70232, + "subver": "/Dash Core:21.0.0(dcg-masternode-7)/", "inbound": false, - "addnode": false, + "bip152_hb_to": false, + "bip152_hb_from": false, "masternode": false, "startingheight": 1022323, "synced_headers": 1022323, @@ -601,7 +604,6 @@ Result (edited to show only a single entry, with IP addresses changed to "addr_relay_enabled": false, "addr_processed": 0, "addr_rate_limited": 0, - "whitelisted": false, "permissions": [ ], "bytessent_per_msg": { @@ -641,7 +643,7 @@ Result (edited to show only a single entry, with IP addresses changed to }, "connection_type": "block-relay-only" } -} +] ``` *See also* From 00b2824c92bc0d184cc2131cd127150189ca04c8 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 16:48:04 -0400 Subject: [PATCH 8/9] docs(rpc): update sendmany and sendtoaddress --- .../remote-procedure-call-quick-reference.md | 4 +- docs/api/remote-procedure-calls-wallet.md | 48 +++++++++++++++---- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/docs/api/remote-procedure-call-quick-reference.md b/docs/api/remote-procedure-call-quick-reference.md index 865f8d27..e84918e7 100644 --- a/docs/api/remote-procedure-call-quick-reference.md +++ b/docs/api/remote-procedure-call-quick-reference.md @@ -202,8 +202,8 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [RescanBlockChain](../api/remote-procedure-calls-wallet.md#rescanblockchain): rescans the local blockchain for wallet related transactions. _New in Dash Core 0.16.0_ * [ScanTxOutset](../api/remote-procedure-calls-wallet.md#scantxoutset): scans the unspent transaction output set for entries that match certain output descriptors. _New in Dash Core 18.0.0_ * [Send](../api/remote-procedure-calls-wallet.md#send): sends a transaction with specified outputs. **New in Dash Core 21.0.0** -* [SendMany](../api/remote-procedure-calls-wallet.md#sendmany): creates and broadcasts a transaction which sends outputs to multiple addresses. **Updated in Dash Core 20.0.0** -* [SendToAddress](../api/remote-procedure-calls-wallet.md#sendtoaddress): spends an amount to a given address. **Updated in Dash Core 20.0.0** +* [SendMany](../api/remote-procedure-calls-wallet.md#sendmany): creates and broadcasts a transaction which sends outputs to multiple addresses. **Updated in Dash Core 21.0.0** +* [SendToAddress](../api/remote-procedure-calls-wallet.md#sendtoaddress): spends an amount to a given address. **Updated in Dash Core 21.0.0** * [SetCoinJoinAmount](../api/remote-procedure-calls-wallet.md#setcoinjoinamount): sets the amount of DASH to be processed _New in Dash Core 0.13.0_ * [SetCoinJoinRounds](../api/remote-procedure-calls-wallet.md#setcoinjoinrounds): sets the number of rounds to use _New in Dash Core 0.13.0_ * [SetTxFee](../api/remote-procedure-calls-wallet.md#settxfee): sets the transaction fee per kilobyte paid by transactions created by this wallet. diff --git a/docs/api/remote-procedure-calls-wallet.md b/docs/api/remote-procedure-calls-wallet.md index ed0f0323..63fad10e 100644 --- a/docs/api/remote-procedure-calls-wallet.md +++ b/docs/api/remote-procedure-calls-wallet.md @@ -2923,11 +2923,27 @@ _Parameter #10---fee estimate mode_ | ---- | ---- | -------- | ----------- | | `estimate_mode` | string | Optional
(0 or 1) | The fee estimate mode, must be one of:
`unset`
`economical`
`conservative`
`DASH/kB`
`duff/B` | -_Result---a TXID of the sent transaction_ +_Parameter #11---verbose_ -| Name | Type | Presence | Description | -| -------- | ------ | ----------------------- | ------------------------------------------------------------------ | -| `result` | string | Required
(exactly 1) | The TXID of the sent transaction, encoded as hex in RPC byte order | +| Name | Type | Presence | Description | +| ------- | ------- | ----------------------- | ---------------------------------------------------------- | +| verbose | boolean | Optional
(0 or 1) | If `true`, return extra information about the transaction. Default is `false` | + +_Result---execution result_ + +If `verbose` is not set or set to `false`: + +| Name | Type | Presence | Description | +| ---- | ------ | ----------------------- | ------------------------------------------------- | +| hex | string | Required
(exactly 1) | The transaction id for the send. Only one transaction is created regardless of the number of addresses | + +If `verbose` is set to `true`: + +| Name | Type | Presence | Description | +| ------------- | ------------ | ----------------------- | ------------------------------------------------- | +| result | json object | Required
(exactly 1) | A JSON object containing transaction details | +| → txid | string | Required
(exactly 1) | The transaction id for the send. Only one transaction is created regardless of the number of addresses | +| → fee reason | string | Required
(exactly 1) | The transaction fee reason | _Example from Dash Core 0.17.0_ @@ -3053,11 +3069,27 @@ _Parameter #10---avoids partial respends_ | ------------- | ------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `avoid_reuse` | boolean | Optional
(0 or 1) | Avoid spending from dirty addresses; addresses are considered dirty if they have previously been used in a transaction. | -_Result---a TXID of the sent transaction_ +_Parameter #11---verbose_ + +| Name | Type | Presence | Description | +| ------- | ------- | ----------------------- | ---------------------------------------------------------- | +| verbose | boolean | Optional
(0 or 1) | If `true`, return extra information about the transaction. Default is `false` | + +_Result---execution result_ + +If `verbose` is not set or set to `false`: + +| Name | Type | Presence | Description | +| ---- | ------ | ----------------------- | ------------------------------------------------- | +| hex | string | Required
(exactly 1) | The transaction id for the send | + +If `verbose` is set to `true`: -| Name | Type | Presence | Description | -| -------- | ------ | ----------------------- | ------------------------------------------------------------------ | -| `result` | string | Required
(exactly 1) | The TXID of the sent transaction, encoded as hex in RPC byte order | +| Name | Type | Presence | Description | +| ------------- | ------------ | ----------------------- | ------------------------------------------------- | +| result | json object | Required
(exactly 1) | A JSON object containing transaction details | +| → txid | string | Required
(exactly 1) | The transaction id for the send | +| → fee reason | string | Required
(exactly 1) | The transaction fee reason | _Example from Dash Core 0.12.2_ From f487cc05e39c507d827020e3c1a4454bb0219c17 Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 7 Aug 2024 17:02:55 -0400 Subject: [PATCH 9/9] docs(rpc): add sethdseed --- .../remote-procedure-call-quick-reference.md | 2 + docs/api/remote-procedure-calls-wallet.md | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/api/remote-procedure-call-quick-reference.md b/docs/api/remote-procedure-call-quick-reference.md index e84918e7..194161fc 100644 --- a/docs/api/remote-procedure-call-quick-reference.md +++ b/docs/api/remote-procedure-call-quick-reference.md @@ -204,6 +204,8 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [Send](../api/remote-procedure-calls-wallet.md#send): sends a transaction with specified outputs. **New in Dash Core 21.0.0** * [SendMany](../api/remote-procedure-calls-wallet.md#sendmany): creates and broadcasts a transaction which sends outputs to multiple addresses. **Updated in Dash Core 21.0.0** * [SendToAddress](../api/remote-procedure-calls-wallet.md#sendtoaddress): spends an amount to a given address. **Updated in Dash Core 21.0.0** +* [SetHDSeed](../api/remote-procedure-calls-wallet.md#sethdseed): sets or generates a new HD wallet seed **New in Dash Core 21.0.0** +* [SetLabel](../api/remote-procedure-calls-wallet.md#setlabel): sets the label associated with the given address. * [SetCoinJoinAmount](../api/remote-procedure-calls-wallet.md#setcoinjoinamount): sets the amount of DASH to be processed _New in Dash Core 0.13.0_ * [SetCoinJoinRounds](../api/remote-procedure-calls-wallet.md#setcoinjoinrounds): sets the number of rounds to use _New in Dash Core 0.13.0_ * [SetTxFee](../api/remote-procedure-calls-wallet.md#settxfee): sets the transaction fee per kilobyte paid by transactions created by this wallet. diff --git a/docs/api/remote-procedure-calls-wallet.md b/docs/api/remote-procedure-calls-wallet.md index 63fad10e..45655dc0 100644 --- a/docs/api/remote-procedure-calls-wallet.md +++ b/docs/api/remote-procedure-calls-wallet.md @@ -3160,6 +3160,50 @@ _See also_ * [Send](../api/remote-procedure-calls-wallet.md#send): sends a transaction with specified outputs. * [SendMany](../api/remote-procedure-calls-wallet.md#sendmany): creates and broadcasts a transaction which sends outputs to multiple addresses. +## SetHDSeed + +> 📘 +> +> Requires [wallet](../resources/glossary.md#wallet) support (**unavailable on masternodes**). + +_Added in Dash Core 21.0.0_ + +The `sethdseed` RPC sets or generates a new HD wallet seed. Non-HD wallets will not be upgraded to +HD wallets. Wallets that are already HD cannot be updated to a new HD seed. + +**Note:** You will need to make a new backup of your wallet after setting the HD wallet seed. +Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted. + +_Parameter #1---newkeypool_ + +| Name | Type | Presence | Description | +| ----------- | ------- | ----------------------- | ----------- | +| newkeypool | boolean | Optional
(0 or 1) | Whether to flush old unused addresses, including change addresses, from the keypool and regenerate it. Default is `true`. If `true`, the next address from `getnewaddress` and change address from `getrawchangeaddress` will be from this new seed. If `false`, addresses from the existing keypool will be used until it has been depleted. | + +_Parameter #2---seed_ + +| Name | Type | Presence | Description | +| ---- | ------ | ----------------------- | ----------- | +| seed | string | Optional
(0 or 1) | The WIF private key to use as the new HD seed. The seed value can be retrieved using the `dumpwallet` command. It is the private key marked `hdseed=1`. Default is a random seed. | + +_Result---execution result_ + +| Name | Type | Presence | Description | +| ---- | -------- | ----------------------- | ----------- | +| null | json null| Required
(exactly 1) | No result | + +_Examples_ + +Set a new HD seed: + +```bash +dash-cli sethdseed +``` + +_See also_ + +* [UpgradeToHD](../api/remote-procedure-calls-wallet.md#upgradetohd): upgrades non-HD wallets to HD. + ## SetLabel > 📘