Dash Developer Reference
Find technical details and API documentation.
- Block Chain
- Transactions
- Wallets
- P2P Network
- Improvement Proposals
- Dash Core APIs
- Hash Byte Order
- Remote Procedure Calls (RPCs)
- Quick Reference
- RPC Summary Table
- RPCs
- AbandonTransaction
- AddMultiSigAddress
- AddNode
- AddWitnessAddress
- BackupWallet
- BumpFee
- ClearBanned
- CreateMultiSig
- CreateRawTransaction
- Debug
- DecodeRawTransaction
- DecodeScript
- DisconnectNode
- DumpHDInfo
- DumpPrivKey
- DumpWallet
- EncryptWallet
- EstimateFee
- EstimatePriority
- EstimateSmartFee
- EstimateSmartPriority
- FundRawTransaction
- Generate
- GenerateToAddress
- GetAccountAddress
- GetAccount
- GetAddedNodeInfo
- GetAddressBalance
- GetAddressDeltas
- GetAddressesByAccount
- GetAddressMempool
- GetAddressTxids
- GetAddressUtxos
- GetBalance
- GetBestBlockHash
- GetBlock
- GetBlockChainInfo
- GetBlockCount
- GetBlockHash
- GetBlockHashes
- GetBlockHeader
- GetBlockHeaders
- GetBlockTemplate
- GetChainTips
- GetConnectionCount
- GetDifficulty
- GetGenerate
- GetGovernanceInfo
- GetHashesPerSec
- GetInfo
- GetMemoryInfo
- GetMemPoolAncestors
- GetMemPoolDescendants
- GetMemPoolEntry
- GetMemPoolInfo
- GetMiningInfo
- GetNetTotals
- GetNetworkHashPS
- GetNetworkInfo
- GetNewAddress
- GetPeerInfo
- GetPoolInfo
- GetRawChangeAddress
- GetRawMemPool
- GetRawTransaction
- GetReceivedByAccount
- GetReceivedByAddress
- GetSpentInfo
- GetSuperblockBudget
- GetTransaction
- GetTxOut
- GetTxOutProof
- GetTxOutSetInfo
- GetUnconfirmedBalance
- GetWalletInfo
- GetWork
- GObject
- Help
- ImportAddress
- ImportElectrumWallet
- ImportMulti
- ImportPrivKey
- ImportPrunedFunds
- ImportPubKey
- ImportWallet
- InstantSendToAddress
- KeePass
- KeyPoolRefill
- ListAccounts
- ListAddressGroupings
- ListBanned
- ListLockUnspent
- ListReceivedByAccount
- ListReceivedByAddress
- ListSinceBlock
- ListTransactions
- ListUnspent
- LockUnspent
- Masternode
- MasternodeBroadcast
- MasternodeList
- MnSync
- Move
- Ping
- PreciousBlock
- PrivateSend
- PrioritiseTransaction
- PruneBlockChain
- RemovePrunedFunds
- SendFrom
- SendMany
- SendRawTransaction
- SendToAddress
- SetAccount
- SetBan
- SetGenerate
- SetNetworkActive
- SetTxFee
- SignMessage
- SignMessageWithPrivKey
- SignRawTransaction
- SentinelPing
- Spork
- Stop
- SubmitBlock
- ValidateAddress
- VerifyChain
- VerifyMessage
- VerifyTxOutProof
- VoteRaw
- WalletLock
- WalletPassphrase
- WalletPassphraseChange
- HTTP REST
The Developer Reference aims to provide technical details and API information to help you start building Dash-based applications, but it is not a specification. To make the best use of this documentation, you may want to install the current version of Dash Core, either from source or from a pre-compiled executable.
Questions about Dash development are best asked in one of the Dash development communities. Errors or suggestions related to documentation on dash-docs.github.io can be submitted as an issue.
In the following documentation, some strings have been shortened or wrapped: “[…]” indicates extra data was removed, and lines ending in a single backslash “\” are continued below. If you hover your mouse over a paragraph, cross-reference links will be shown in blue. If you hover over a cross-reference link, a brief definition of the term will be displayed in a tooltip.
Not A Specification
The dash-docs.github.io Developer Documentation describes how Dash works to help educate new Dash developers, but it is not a specification—and it never will be.
Dash security depends on consensus. Should your program diverge from consensus, its security is weakened or destroyed. The cause of the divergence doesn’t matter: it could be a bug in your program, it could be an error in this documentation which you implemented as described, or it could be you do everything right but other software on the network behaves unexpectedly as in the case of Bitcoin’s v0.8 chain fork. The specific cause will not matter to the users of your software whose wealth is lost.
The only correct specification of consensus behavior is the actual behavior of programs on the network which maintain consensus. As that behavior is subject to arbitrary inputs in a large variety of unique environments, it cannot ever be fully documented here or anywhere else.
In addition, we also warn you that this documentation has not been extensively reviewed by Dash experts and so likely contains numerous errors. At the bottom of the menu on the left, you will find links that allow you to report an issue or to edit the documentation on GitHub. Please use those links if you find any errors or important missing information.
Block Chain
The following subsections briefly document core block details.
Block Headers
Block headers are serialized in the 80-byte format described below and then hashed as part of the proof-of-work algorithm, making the serialized header format part of the consensus rules.
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | version | int32_t | The block version number indicates which set of block validation rules to follow. See the list of block versions below. |
32 | previous block header hash | char[32] | An X11() hash in internal byte order of the previous block’s header. This ensures no previous block can be changed without also changing this block’s header. |
32 | merkle root hash | char[32] | A SHA256(SHA256()) hash in internal byte order. The merkle root is derived from the hashes of all transactions included in this block, ensuring that none of those transactions can be modified without modifying the header. See the merkle trees section below. |
4 | time | uint32_t | The block time is a Unix epoch time when the miner started hashing the header (according to the miner). Must be strictly greater than the median time of the previous 11 blocks. Full nodes will not accept blocks with headers more than two hours in the future according to their clock. |
4 | nBits | uint32_t | An encoded version of the target threshold this block’s header hash must be less than or equal to. See the nBits format described below. |
4 | nonce | uint32_t | An arbitrary number miners change to modify the header hash in order to produce a hash less than or equal to the target threshold. If all 32-bit values are tested, the time can be updated or the coinbase transaction can be changed and the merkle root updated. |
The hashes are in internal byte order; the other values are all in little-endian order.
An example header in hex:
02000000 ........................... Block version: 2
b6ff0b1b1680a2862a30ca44d346d9e8
910d334beb48ca0c0000000000000000 ... Hash of previous block's header
9d10aa52ee949386ca9385695f04ede2
70dda20810decd12bc9b048aaab31471 ... Merkle root
24d95a54 ........................... Unix time: 1415239972
30c31b18 ........................... Target: 0x1bc330 * 256**(0x18-3)
fe9f0864 ........................... Nonce
Block Versions
-
Version 1 was used by Dash for the Genesis Block only.
-
Version 2 was introduced with the first block following the Genesis Block (January 2014). As described in BIP34, valid version 2 blocks require a block height parameter in the coinbase.
-
Version 3 blocks were introduced in Dash Core 0.11.2 (March 2015) as a soft fork (Block 244,834 was the first version 3 block).
When the fork reach full enforcement, it required strict DER encoding of all ECDSA signatures in new blocks as described in BIP66. Transactions that do not use strict DER encoding had previously been non-standard since Dash Core 0.8.0.
-
Version 4 blocks specified in BIP65 and introduced in Bitcoin Core 0.11.2 (November 2015) as a soft fork became active in December 2015. These blocks now support the new
OP_CHECKLOCKTIMEVERIFY
opcode described in that BIP.
The mechanism used for the version 2, 3, and 4 upgrades is commonly called IsSuperMajority() after the function added to Dash Core to manage those soft forking changes. See BIP34 for a full description of this method.
As of this writing, a newer method called version bits is being designed to manage future soft forking changes, although it’s not known whether version 4 will be the last soft fork to use the IsSuperMajority() function. Draft BIP9 describes the version bits design as of this writing, although it is still being actively edited and may substantially change while in the draft state.
Merkle Trees
The merkle root is constructed using all the TXIDs of transactions in this block, but first the TXIDs are placed in order as required by the consensus rules:
-
The coinbase transaction’s TXID is always placed first.
-
Any input within this block can spend an output which also appears in this block (assuming the spend is otherwise valid). However, the TXID corresponding to the output must be placed at some point before the TXID corresponding to the input. This ensures that any program parsing block chain transactions linearly will encounter each output before it is used as an input.
If a block only has a coinbase transaction, the coinbase TXID is used as the merkle root hash.
If a block only has a coinbase transaction and one other transaction, the TXIDs of those two transactions are placed in order, concatenated as 64 raw bytes, and then SHA256(SHA256()) hashed together to form the merkle root.
If a block has three or more transactions, intermediate merkle tree rows are formed. The TXIDs are placed in order and paired, starting with the coinbase transaction’s TXID. Each pair is concatenated together as 64 raw bytes and SHA256(SHA256()) hashed to form a second row of hashes. If there are an odd (non-even) number of TXIDs, the last TXID is concatenated with a copy of itself and hashed. If there are more than two hashes in the second row, the process is repeated to create a third row (and, if necessary, repeated further to create additional rows). Once a row is obtained with only two hashes, those hashes are concatenated and hashed to produce the merkle root.
TXIDs and intermediate hashes are always in internal byte order when they’re concatenated, and the resulting merkle root is also in internal byte order when it’s placed in the block header.
Target nBits
The target threshold is a 256-bit unsigned integer which a header hash must be equal to or below in order for that header to be a valid part of the block chain. However, the header field nBits provides only 32 bits of space, so the target number uses a less precise format called “compact” which works like a base-256 version of scientific notation:
As a base-256 number, nBits can be quickly parsed as bytes the same way you might parse a decimal number in base-10 scientific notation:
Although the target threshold should be an unsigned integer, the original nBits implementation inherits properties from a signed data class, allowing the target threshold to be negative if the high bit of the significand is set. This is useless—the header hash is treated as an unsigned number, so it can never be equal to or lower than a negative target threshold. Dash Core deals with this in two ways:
-
When parsing nBits, Dash Core converts a negative target threshold into a target of zero, which the header hash can equal (in theory, at least).
-
When creating a value for nBits, Dash Core checks to see if it will produce an nBits which will be interpreted as negative; if so, it divides the significand by 256 and increases the exponent by 1 to produce the same number with a different encoding.
Some examples taken from the Dash Core test cases:
nBits | Target | Notes |
---|---|---|
0x01003456 | 0x00 | |
0x01123456 | 0x12 | |
0x02008000 | 0x80 | |
0x05009234 | 0x92340000 | |
0x04923456 | -0x12345600 | High bit set (0x80 in 0x92). |
0x04123456 | 0x12345600 | Inverse of above; no high bit. |
Difficulty 1, the minimum allowed difficulty, is represented on mainnet and the current testnet by the nBits value 0x1e0ffff0. Regtest mode uses a different difficulty 1 value—0x207fffff, the highest possible value below uint32_max which can be encoded; this allows near-instant building of blocks in regtest mode.
Serialized Blocks
Under current consensus rules, a block is not valid unless its serialized size is less than or equal to 1 MB. All fields described below are counted towards the serialized size.
Bytes | Name | Data Type | Description |
80 | block header | block_header | The block header in the format described in the block header section. |
Varies | txn_count | compactSize uint | The total number of transactions in this block, including the coinbase transaction. |
Varies | txns | raw transaction | Every transaction in this block, one after another, in raw transaction format. Transactions must appear in the data stream in the same order their TXIDs appeared in the first row of the merkle tree. See the merkle tree section for details. |
The first transaction in a block must be a coinbase transaction which should collect and spend any transaction fees paid by transactions included in this block.
Until the coin limit (~18 million Dash) is hit, all blocks are entitled to receive a block subsidy of newly created Dash value. The newly created value should be spent in the coinbase transaction.
The block subsidy declines by ~7.1% per year until all Dash is mined. Subsidy calculations are performed by the Dash Core GetBlockSubsidy() function.
Together, the transaction fees and block subsidy are called the block reward. A coinbase transaction is invalid if it tries to spend more value than is available from the block reward.
The block reward is divided into three parts: Miners, Masternodes, and Superblocks.
Payee | Subsidy | Description |
---|---|---|
Miner | 45% | Payment for mining |
Masternode | 45% | Payment for masternode services (PrivateSend, InstantSend, Governance, etc.) |
Superblock | 10% | Payment for maintenance/expansion of the ecosystem (Core development, marketing, integration, etc.) |
Transactions
The following subsections briefly document core transaction details.
OpCodes
The opcodes used in the pubkey scripts of standard transactions are:
-
Various data pushing opcodes from 0x00 to 0x4e (1–78). These aren’t typically shown in examples, but they must be used to push signatures and public keys onto the stack. See the link below this list for a description.
-
OP_TRUE
/OP_1
(0x51) andOP_2
throughOP_16
(0x52–0x60), which push the values 1 through 16 to the stack. -
OP_CHECKSIG
(0xac) consumes a signature and a full public key, and pushes true onto the stack if the transaction data specified by the SIGHASH flag was converted into the signature using the same ECDSA private key that generated the public key. Otherwise, it pushes false onto the stack. -
OP_DUP
(0x76) pushes a copy of the topmost stack item on to the stack. -
OP_HASH160
(0xa9) consumes the topmost item on the stack, computes the RIPEMD160(SHA256()) hash of that item, and pushes that hash onto the stack. -
OP_EQUAL
(0x87) consumes the top two items on the stack, compares them, and pushes true onto the stack if they are the same, false if not. -
OP_VERIFY
(0x69) consumes the topmost item on the stack. If that item is zero (false) it terminates the script in failure. -
OP_EQUALVERIFY
(0x88) runsOP_EQUAL
and thenOP_VERIFY
in sequence. -
OP_CHECKMULTISIG
(0xae) consumes the value (n) at the top of the stack, consumes that many of the next stack levels (public keys), consumes the value (m) now at the top of the stack, and consumes that many of the next values (signatures) plus one extra value.The “one extra value” it consumes is the result of an off-by-one error in the Bitcoin Core implementation. This value is not used, so signature scripts prefix the list of secp256k1 signatures with a single OP_0 (0x00).
OP_CHECKMULTISIG
compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result.Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the signature script using the same order as their corresponding public keys were placed in the pubkey script or redeem script. See the
OP_CHECKMULTISIG
warning below for more details. -
OP_RETURN
(0x6a) terminates the script in failure when executed.
A complete list of opcodes can be found on the Bitcoin Wiki Script
Page, with an authoritative list in the opcodetype
enum
of the Dash Core script header file
Signature script modification warning:
Signature scripts are not signed, so anyone can modify them. This
means signature scripts should only contain data and data-pushing opcodes
which can’t be modified without causing the pubkey script to fail.
Placing non-data-pushing opcodes in the signature script currently
makes a transaction non-standard, and future consensus rules may forbid
such transactions altogether. (Non-data-pushing opcodes are already
forbidden in signature scripts when spending a P2SH pubkey script.)
OP_CHECKMULTISIG
warning: The multisig verification process
described above requires that signatures in the signature script be
provided in the same order as their corresponding public keys in
the pubkey script or redeem script. For example, the following
combined signature and pubkey script will produce the stack and
comparisons shown:
OP_0 <A sig> <B sig> OP_2 <A pubkey> <B pubkey> <C pubkey> OP_3
Sig Stack Pubkey Stack (Actually a single stack)
--------- ------------
B sig C pubkey
A sig B pubkey
OP_0 A pubkey
1. B sig compared to C pubkey (no match)
2. B sig compared to B pubkey (match #1)
3. A sig compared to A pubkey (match #2)
Success: two matches found
But reversing the order of the signatures with everything else the same will fail, as shown below:
OP_0 <B sig> <A sig> OP_2 <A pubkey> <B pubkey> <C pubkey> OP_3
Sig Stack Pubkey Stack (Actually a single stack)
--------- ------------
A sig C pubkey
B sig B pubkey
OP_0 A pubkey
1. A sig compared to C pubkey (no match)
2. A sig compared to B pubkey (no match)
Failure, aborted: two signature matches required but none found so
far, and there's only one pubkey remaining
Address Conversion
The hashes used in P2PKH and P2SH outputs are commonly encoded as Dash addresses. This is the procedure to encode those hashes and decode the addresses.
First, get your hash. For P2PKH, you RIPEMD-160(SHA256()) hash a ECDSA public key derived from your 256-bit ECDSA private key (random data). For P2SH, you RIPEMD-160(SHA256()) hash a redeem script serialized in the format used in raw transactions (described in a following sub-section). Taking the resulting hash:
-
Add an address version byte in front of the hash. The version bytes commonly used by Dash are:
-
0x4c for P2PKH addresses on the main Dash network (mainnet)
-
0x8c for P2PKH addresses on the Dash testing network (testnet)
-
0x10 for P2SH addresses on mainnet
-
0x13 for P2SH addresses on testnet
-
-
Create a copy of the version and hash; then hash that twice with SHA256:
SHA256(SHA256(version . hash))
-
Extract the first four bytes from the double-hashed copy. These are used as a checksum to ensure the base hash gets transmitted correctly.
-
Append the checksum to the version and hash, and encode it as a base58 string:
BASE58(version . hash . checksum)
Dash’s base58 encoding, called Base58Check may not match other implementations. Tier Nolan provided the following example encoding algorithm to the Bitcoin Wiki Base58Check encoding page under the Creative Commons Attribution 3.0 license:
code_string = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
x = convert_bytes_to_big_integer(hash_result)
output_string = ""
while(x > 0)
{
(x, remainder) = divide(x, 58)
output_string.append(code_string[remainder])
}
repeat(number_of_leading_zero_bytes_in_hash)
{
output_string.append(code_string[0]);
}
output_string.reverse();
Dash’s own code can be traced using the base58 header file.
To convert addresses back into hashes, reverse the base58 encoding, extract the checksum, repeat the steps to create the checksum and compare it against the extracted checksum, and then remove the version byte.
Raw Transaction Format
Dash transactions are broadcast between peers in a serialized byte format, called raw format. It is this form of a transaction which is SHA256(SHA256()) hashed to create the TXID and, ultimately, the merkle root of a block containing the transaction—making the transaction format part of the consensus rules.
Dash Core and many other tools print and accept raw transactions encoded as hex.
All transactions use the version 1 format described below. (Note: transactions in the block chain are allowed to list a higher version number to permit soft forks, but they are treated as version 1 transactions by current software.)
A raw transaction has the following top-level format:
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | version | uint32_t | Transaction version number; currently version 1. Programs creating transactions using newer consensus rules may use higher version numbers. |
Varies | tx_in count | compactSize uint | Number of inputs in this transaction. |
Varies | tx_in | txIn | Transaction inputs. See description of txIn below. |
Varies | tx_out count | compactSize uint | Number of outputs in this transaction. |
Varies | tx_out | txOut | Transaction outputs. See description of txOut below. |
4 | lock_time | uint32_t | A time (Unix epoch time) or block number. See the locktime parsing rules. |
A transaction may have multiple inputs and outputs, so the txIn and txOut structures may recur within a transaction. CompactSize unsigned integers are a form of variable-length integers; they are described in the CompactSize section.
TxIn: A Transaction Input (Non-Coinbase)
Each non-coinbase input spends an outpoint from a previous transaction. (Coinbase inputs are described separately after the example section below.)
Bytes | Name | Data Type | Description |
---|---|---|---|
36 | previous_output | outpoint | The previous outpoint being spent. See description of outpoint below. |
Varies | script bytes | compactSize uint | The number of bytes in the signature script. Maximum is 10,000 bytes. |
Varies | signature script | char[] | A script-language script which satisfies the conditions placed in the outpoint’s pubkey script. Should only contain data pushes; see the signature script modification warning. |
4 | sequence | uint32_t | Sequence number. Default for Dash Core and almost all other programs is 0xffffffff. |
Outpoint: The Specific Part Of A Specific Output
Because a single transaction can include multiple outputs, the outpoint structure includes both a TXID and an output index number to refer to specific output.
Bytes | Name | Data Type | Description |
---|---|---|---|
32 | hash | char[32] | The TXID of the transaction holding the output to spend. The TXID is a hash provided here in internal byte order. |
4 | index | uint32_t | The output index number of the specific output to spend from the transaction. The first output is 0x00000000. |
TxOut: A Transaction Output
Each output spends a certain number of duffs, placing them under control of anyone who can satisfy the provided pubkey script.
Bytes | Name | Data Type | Description |
---|---|---|---|
8 | value | int64_t | Number of duffs to spend. May be zero; the sum of all outputs may not exceed the sum of duffs previously spent to the outpoints provided in the input section. (Exception: coinbase transactions spend the block subsidy and collected transaction fees.) |
1+ | pk_script bytes | compactSize uint | Number of bytes in the pubkey script. Maximum is 10,000 bytes. |
Varies | pk_script | char[] | Defines the conditions which must be satisfied to spend this output. |
Example
The sample raw transaction itemized below is the one created in the Simple Raw Transaction section of the Developer Examples. It spends a previous pay-to-pubkey output by paying to a new pay-to-pubkey-hash (P2PKH) output.
01000000 ................................... Version
01 ......................................... Number of inputs
|
| 7b1eabe0209b1fe794124575ef807057
| c77ada2138ae4fa8d6c4de0398a14f3f ......... Outpoint TXID
| 00000000 ................................. Outpoint index number: 0
|
| 49 ....................................... Bytes in sig. script: 73
| | 48 ..................................... Push 72 bytes as data
| | | 30450221008949f0cb400094ad2b5eb3
| | | 99d59d01c14d73d8fe6e96df1a7150de
| | | b388ab8935022079656090d7f6bac4c9
| | | a94e0aad311a4268e082a725f8aeae05
| | | 73fb12ff866a5f01 ..................... Secp256k1 signature
|
| ffffffff ................................. Sequence number: UINT32_MAX
01 ......................................... Number of outputs
| f0ca052a01000000 ......................... Duffs (49.99990000 Dash)
|
| 19 ....................................... Bytes in pubkey script: 25
| | 76 ..................................... OP_DUP
| | a9 ..................................... OP_HASH160
| | 14 ..................................... Push 20 bytes as data
| | | cbc20a7664f2f69e5355aa427045bc15
| | | e7c6c772 ............................. PubKey hash
| | 88 ..................................... OP_EQUALVERIFY
| | ac ..................................... OP_CHECKSIG
00000000 ................................... locktime: 0 (a block height)
Coinbase Input: The Input Of The First Transaction In A Block
The first transaction in a block, called the coinbase transaction, must have exactly one input, called a coinbase. The coinbase input currently has the following format.
Bytes | Name | Data Type | Description |
---|---|---|---|
32 | hash (null) | char[32] | A 32-byte null, as a coinbase has no previous outpoint. |
4 | index (UINT32_MAX) | uint32_t | 0xffffffff, as a coinbase has no previous outpoint. |
Varies | script bytes | compactSize uint | The number of bytes in the coinbase script, up to a maximum of 100 bytes. |
Varies (4) | height | script | The block height of this block as required by BIP34. Uses script language: starts with a data-pushing opcode that indicates how many bytes to push to the stack followed by the block height as a little-endian unsigned integer. This script must be as short as possible, otherwise it may be rejected. The data-pushing opcode will be 0x03 and the total size four bytes until block 16,777,216 about 300 years from now. |
Varies | coinbase script | None | The coinbase field: Arbitrary data not exceeding 100 bytes minus the (4) height bytes. Miners commonly place an extra nonce in this field to update the block header merkle root during hashing. |
4 | sequence | uint32_t | Sequence number. |
Although the coinbase script is arbitrary data, if it includes the
bytes used by any signature-checking operations such as OP_CHECKSIG
,
those signature checks will be counted as signature operations (sigops)
towards the block’s sigop limit. To avoid this, you can prefix all data
with the appropriate push operation.
An itemized coinbase transaction:
01000000 .............................. Version
01 .................................... Number of inputs
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ... Previous outpoint TXID
| ffffffff ............................ Previous outpoint index
|
| 18 .................................. Bytes in coinbase: 24
| |
| | 03 ................................ Bytes in height
| | | b8240b .......................... Height: 730296
| |
| | 03b8240b049d29aa59080400077efa95
| | 0000052f6d70682f .................. Arbitrary data
| 00000000 ............................ Sequence
02 .................................... Output count
| Transaction Output 1
| | f20cbe0a00000000 .................... Duffs (1.80227314 Dash)
| | 1976a9142cd46be3ceeacca983e0fea3
| | b88f26b08a26c29b88ac ................ P2PKH script
|
| Transaction Output 2
| | eb0cbe0a00000000 .................... Duffs (1.80227307 Dash)
| | 1976a914868180414905937a68fadeb0
| | f33e64d102c9591a88ac ................ P2PKH script
|
| 00000000 ............................ Locktime
Note: currently the normal coinbase has 2 outputs (1 for the miner and 1 for the selected masternode). Superblocks (superblock example) have multiple outputs depending on the number of proposals being funded.
CompactSize Unsigned Integers
The raw transaction format and several peer-to-peer network messages use a type of variable-length integer to indicate the number of bytes in a following piece of data.
Dash Core code and this document refers to these variable length integers as compactSize. Many other documents refer to them as var_int or varInt, but this risks conflation with other variable-length integer encodings—such as the CVarInt class used in Dash Core for serializing data to disk. Because it’s used in the transaction format, the format of compactSize unsigned integers is part of the consensus rules.
For numbers from 0 to 252 (0xfc), compactSize unsigned integers look like regular unsigned integers. For other numbers up to 0xffffffffffffffff, a byte is prefixed to the number to indicate its length—but otherwise the numbers look like regular unsigned integers in little-endian order.
Value | Bytes Used | Format |
---|---|---|
>= 0 && <= 0xfc (252) | 1 | uint8_t |
>= 0xfd (253) && <= 0xffff | 3 | 0xfd followed by the number as uint16_t |
>= 0x10000 && <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t |
>= 0x100000000 && <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t |
For example, the number 515 is encoded as 0xfd0302.
Wallets
Deterministic Wallet Formats
Type 1: Single Chain Wallets
Type 1 deterministic wallets are the simpler of the two, which can create a single series of keys from a single seed. A primary weakness is that if the seed is leaked, all funds are compromised, and wallet sharing is extremely limited.
Type 2: Hierarchical Deterministic (HD) Wallets
For an overview of HD wallets, please see the developer guide section. For details, please see BIP32.
P2P Network
This section describes the Dash P2P network protocol (but it is not a specification). It does not describe the BIP70 payment protocol, the GetBlockTemplate mining protocol, or any network protocol never implemented in an official version of Dash Core.
All peer-to-peer communication occurs entirely over TCP.
Note: unless their description says otherwise, all multi-byte
integers mentioned in this section are transmitted in little-endian order.
Constants And Defaults
The following constants and defaults are taken from Dash Core’s chainparams.cpp source code file.
Network | Default Port | Magic Value | Start String | Max nBits |
---|---|---|---|---|
Mainnet | 9999 | 0xBD6B0CBF | 0xBF0C6BBD | 0x1e0ffff0 |
Testnet | 19999 | 0xFFCAE2CE | 0xCEE2CAFF | 0x1e0ffff0 |
Regtest | 19994 | 0xDCB7C1FC | 0xFCC1B7DC | 0x207fffff |
Note: the testnet start string and nBits above are for testnet3.
Command line parameters can change what port a node listens on (see
-help
). Start strings are hardcoded constants that appear at the start
of all messages sent on the Dash network; they may also appear in
data files such as Dash Core’s block database. The Magic Value and nBits
displayed above are in big-endian order; they’re sent over the network in
little-endian order. The Start String is simply the endian reversed Magic Value.
Dash Core’s chainparams.cpp also includes other constants useful to programs, such as the hash of the genesis blocks for the different networks.
Protocol Versions
The table below lists some notable versions of the P2P network protocol, with the most recent versions listed first. (If you know of a protocol version that implemented a major change but which is not listed here, please open an issue.)
As of Dash Core 0.12.2.0, the most recent protocol version is 70208.
Version | Initial Release | Major Changes |
---|---|---|
70208 | Dash Core 0.12.2.x (Nov 2017) |
• DIP-0001 (2MB blocks) • Fee reduction (10x) • InstantSend fix • PrivateSend improvements • Experimental HD wallet • Local Masternode support removed |
70206 | Dash Core 0.12.1.x (Mar 2017) |
• Switch to Bitcoin Core 0.12.1 • BIP-0065 (CheckLockTimeVerify) • BIP-0112 (CheckSequenceVerify) |
70103 | Dash Core 0.12.0.x (Aug 2015) |
• Switch to Bitcoin Core 0.10 • Decentralized budget system • New IX implementation |
70076 | Dash Core 0.11.2.x (Mar 2015) |
• Masternode enhancements • Mining/relay policy enhancements • BIP-66 - strict DER encoding for signatures |
70066 | Dash Core 0.11.1.x (Feb 2015) |
• InstantX fully implemented • Spork fully implemented • Masternode payment updates • Rebrand to Dash (0.11.1.26) |
70052 | Dash Core 0.11.0.x (Jan 2015) |
• Switch from fork of Litecoin 0.8 to Bitcoin 0.9.3 • Rebrand to Darkcoin Core |
70051 | Dash Core 0.10.0.x (Sep 2014) |
• Release of the originally closed source implementation of DarkSend |
70002 | Dash Core 0.9.0.x (Mar 2014) |
• Masternode implementation • Rebrand to Darkcoin |
70002 | Dash Core 0.8.7 (Jan 2014) |
Initial release of Dash (branded XCoin) as a fork of Litecoin 0.8 |
Historical Bitcoin protocol versions for reference shown below since Dash is a fork of Bitcoin Core.
Version | Initial Release | Major Changes |
---|---|---|
70012 | Bitcoin Core 0.12.0 (Feb 2016) |
BIP130: • Added sendheaders message. |
70011 | Bitcoin Core 0.12.0 (Feb 2016) |
BIP111: • filter* messages are disabled without NODE_BLOOM after and including this version. |
70002 | Bitcoin Core 0.9.0 (Mar 2014) |
• Send multiple inv messages in response to a mempool message if necessary BIP61: • Added reject message |
70001 | Bitcoin Core 0.8.0 (Feb 2013) |
• Added notfound message. BIP37: • Added filterload message. • Added filteradd message. • Added filterclear message. • Added merkleblock message. • Added relay field to version message • Added MSG_FILTERED_BLOCK inventory type to getdata message. |
60002 | Bitcoin Core 0.7.0 (Sep 2012) |
BIP35: • Added mempool message. • Extended getdata message to allow download of memory pool transactions |
60001 | Bitcoin Core 0.6.1 (May 2012) |
BIP31: • Added nonce field to ping message • Added pong message |
60000 | Bitcoin Core 0.6.0 (Mar 2012) |
BIP14: • Separated protocol version from Bitcoin Core version |
31800 | Bitcoin Core 0.3.18 (Dec 2010) |
• Added getheaders message and headers message. |
31402 | Bitcoin Core 0.3.15 (Oct 2010) |
• Added time field to addr message. |
311 | Bitcoin Core 0.3.11 (Aug 2010) |
• Added alert message. |
209 | Bitcoin Core 0.2.9 (May 2010) |
• Added checksum field to message headers. |
106 | Bitcoin Core 0.1.6 (Oct 2009) |
• Added receive IP address fields to version message. |
Message Headers
All messages in the network protocol use the same container format, which provides a required multi-field message header and an optional payload. The message header format is:
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | start string | char[4] | Magic bytes indicating the originating network; used to seek to next message when stream state is unknown. |
12 | command name | char[12] | ASCII string which identifies what message type is contained in the payload. Followed by nulls (0x00) to pad out byte count; for example: version\0\0\0\0\0 . |
4 | payload size | uint32_t | Number of bytes in payload. The current maximum number of bytes (MAX_SIZE ) allowed in the payload by Dash Core is 32 MiB—messages with a payload size larger than this will be dropped or rejected. |
4 | checksum | char[4] | Added in protocol version 209. First 4 bytes of SHA256(SHA256(payload)) in internal byte order. If payload is empty, as in verack and getaddr messages, the checksum is always 0x5df6e0e2 (SHA256(SHA256(<empty string>))). |
The following example is an annotated hex dump of a mainnet message
header from a verack
message which has no payload.
bf0c6bbd ................... Start string: Mainnet
76657261636b000000000000 ... Command name: verack + null padding
00000000 ................... Byte count: 0
5df6e0e2 ................... Checksum: SHA256(SHA256(<empty>))
Data Messages
The following network messages all request or provide data related to transactions and blocks.
Many of the data messages use inventories as unique identifiers for transactions and blocks. Inventories have a simple 36-byte structure:
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | type identifier | uint32_t | The type of object which was hashed. See list of type identifiers below. |
32 | hash | char[32] | SHA256(SHA256()) hash of the object in internal byte order. |
The currently-available type identifiers are:
Type Identifier | Name | Description |
---|---|---|
1 | MSG_TX |
The hash is a TXID. |
2 | MSG_BLOCK |
The hash is of a block header. |
3 | MSG_FILTERED_BLOCK |
The hash is of a block header; identical to MSG_BLOCK . When used in a getdata message, this indicates the response should be a merkleblock message rather than a block message (but this only works if a bloom filter was previously configured). Only for use in getdata messages. |
4 | MSG_TXLOCK_REQUEST |
The hash is an Instant Send transaction lock request. |
5 | MSG_TXLOCK_VOTE |
The hash is an Instant Send transaction vote. |
6 | MSG_SPORK |
The hash is Spork ID. |
7 | MSG_MASTERNODE_PAYMENT_VOTE |
The hash is a Masternode Payment Vote. |
8 | MSG_MASTERNODE_PAYMENT_BLOCK |
The hash is a Masternode Payment Block. |
8 | MSG_MASTERNODE_SCANNING_ERROR |
Replaced by MSG_MASTERNODE_PAYMENT_BLOCK |
9 | MSG_BUDGET_VOTE |
Deprecated |
10 | MSG_BUDGET_PROPOSAL |
Deprecated |
11 | MSG_BUDGET_FINALIZED |
Deprecated |
12 | MSG_BUDGET_FINALIZED_VOTE |
Deprecated |
13 | MSG_MASTERNODE_QUORUM |
Not Implemented |
14 | MSG_MASTERNODE_ANNOUNCE |
The hash is a Masternode Broadcast. |
15 | MSG_MASTERNODE_PING |
The hash is a Masternode Ping. |
16 | MSG_DSTX |
The hash is Private Send (Dark Send) Broadcast TX. |
17 | MSG_GOVERNANCE_OBJECT |
The hash is a Governance Object. |
18 | MSG_GOVERNANCE_OBJECT_VOTE |
The hash is a Governance Object Vote. |
19 | MSG_MASTERNODE_VERIFY |
The hash is a Masternode Verify. |
Type identifier zero and type identifiers greater than nineteen are reserved for future implementations. Dash Core ignores all inventories with one of these unknown types.
Block
The block
message transmits a single serialized block in the format
described in the serialized blocks section.
See that section for an example hexdump. It can be sent for two
different reasons:
-
GetData Response: Nodes will always send it in response to a
getdata
message that requests the block with an inventory type ofMSG_BLOCK
(provided the node has that block available for relay). -
Unsolicited: Some miners will send unsolicited
block
messages broadcasting their newly-mined blocks to all of their peers. Many mining pools do the same thing, although some may be misconfigured to send the block from multiple nodes, possibly sending the same block to some peers more than once.
GetBlocks
The getblocks
message requests an inv
message that provides block
header hashes starting from a particular point in the block chain. It
allows a peer which has been disconnected or started for the first time
to get the data it needs to request the blocks it hasn’t seen.
Peers which have been disconnected may have stale blocks in their
locally-stored block chain, so the getblocks
message allows the
requesting peer to provide the receiving peer with multiple header
hashes at various heights on their local chain. This allows the
receiving peer to find, within that list, the last header hash they had
in common and reply with all subsequent header hashes.
Note: the receiving peer itself may respond with an inv
message
containing header hashes of stale blocks. It is up to the requesting
peer to poll all of its peers to find the best block chain.
If the receiving peer does not find a common header hash within the
list, it will assume the last common block was the genesis block (block
zero), so it will reply with in inv
message containing header hashes
starting with block one (the first block after the genesis block).
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | version | uint32_t | The protocol version number; the same as sent in the version message. |
Varies | hash count | compactSize uint | The number of header hashes provided not including the stop hash. There is no limit except that the byte size of the entire message must be below the MAX_SIZE limit; typically from 1 to 200 hashes are sent. |
Varies | block header hashes | char[32] | One or more block header hashes (32 bytes each) in internal byte order. Hashes should be provided in reverse order of block height, so highest-height hashes are listed first and lowest-height hashes are listed last. |
32 | stop hash | char[32] | The header hash of the last header hash being requested; set to all zeroes to request an inv message with all subsequent header hashes (a maximum of 500 will be sent as a reply to this message; if you need more than 500, you will need to send another getblocks message with a higher-height header hash as the first entry in block header hash field). |
The following annotated hexdump shows a getblocks
message. (The
message header has been omitted.)
71110100 ........................... Protocol version: 70001
02 ................................. Hash count: 2
d39f608a7775b537729884d4e6633bb2
105e55a16a14d31b0000000000000000 ... Hash #1
5c3e6403d40837110a2e8afb602b1c01
714bda7ce23bea0a0000000000000000 ... Hash #2
00000000000000000000000000000000
00000000000000000000000000000000 ... Stop hash
GetData
The getdata
message requests one or more data objects from another
node. The objects are requested by an inventory, which the requesting
node typically previously received by way of an inv
message.
The response to a getdata
message can be a tx
message, block
message, merkleblock
message, ix
message, txlvote
message,
mnw
message, mnb
message, mnp
message, dstx
message, govobj
message,
govobjvote
message, mnv
message, or notfound
message.
This message cannot be used to request arbitrary data, such as historic
transactions no longer in the memory pool or relay set. Full nodes may
not even be able to provide older blocks if they’ve pruned old
transactions from their block database. For this reason, the getdata
message should usually only be used to request data from a node which
previously advertised it had that data by sending an inv
message.
The format and maximum size limitations of the getdata
message are
identical to the inv
message; only the message header differs.
GetHeaders
Added in protocol version 70077.
The getheaders
message requests a headers
message that provides block headers
starting from a particular point in the block chain. It allows a
peer which has been disconnected or started for the first time to get
the headers it hasn’t seen yet.
The getheaders
message is nearly identical to the getblocks
message,
with one minor difference: the inv
reply to the getblocks
message
will include no more than 500 block header hashes; the headers
reply
to the getheaders
message will include as many as 2,000 block headers.
Headers
Added in protocol version 31800 (of Bitcoin).
The headers
message sends block headers to a node which
previously requested certain headers with a getheaders
message. A headers
message can be empty.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | count | compactSize uint | Number of block headers up to a maximum of 2,000. Note: headers-first sync assumes the sending node will send the maximum number of headers whenever possible. |
Varies | headers | block_header | Block headers: each 80-byte block header is in the format described in the block headers section with an additional 0x00 suffixed. This 0x00 is called the transaction count, but because the headers message doesn’t include any transactions, the transaction count is always zero. |
The following annotated hexdump shows a headers
message. (The message
header has been omitted.)
01 ................................. Header count: 1
02000000 ........................... Block version: 2
b6ff0b1b1680a2862a30ca44d346d9e8
910d334beb48ca0c0000000000000000 ... Hash of previous block's header
9d10aa52ee949386ca9385695f04ede2
70dda20810decd12bc9b048aaab31471 ... Merkle root
24d95a54 ........................... Unix time: 1415239972
30c31b18 ........................... Target (bits)
fe9f0864 ........................... Nonce
00 ................................. Transaction count (0x00)
Inv
The inv
message (inventory message) transmits one or more inventories of
objects known to the transmitting peer. It can be sent unsolicited to
announce new transactions or blocks, or it can be sent in reply to a
getblocks
message or mempool
message.
The receiving peer can compare the inventories from an inv
message
against the inventories it has already seen, and then use a follow-up
message to request unseen objects.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | count | compactSize uint | The number of inventory entries. |
Varies | inventory | inventory | One or more inventory entries up to a maximum of 50,000 entries. |
The following annotated hexdump shows an inv
message with two
inventory entries. (The message header has been omitted.)
02 ................................. Count: 2
0f000000 ........................... Type: MSG_MASTERNODE_PING
dd6cc6c11211793b239c2e311f1496e2
2281b200b35233eaae465d2aa3c9d537 ... Hash (mnp)
05000000 ........................... Type: MSG_TXLOCK_VOTE
afc5b2f418f8c06c477a7d071240f5ee
ab17057f9ce4b50c2aef4fadf3729a2e ... Hash (txlvote)
MemPool
Added in protocol version 60002 (of Bitcoin).
The mempool
message requests the TXIDs of transactions that the
receiving node has verified as valid but which have not yet appeared in
a block. That is, transactions which are in the receiving node’s memory
pool. The response to the mempool
message is one or more inv
messages containing the TXIDs in the usual inventory format.
Sending the mempool
message is mostly useful when a program first
connects to the network. Full nodes can use it to quickly gather most or
all of the unconfirmed transactions available on the network; this is
especially useful for miners trying to gather transactions for their
transaction fees. SPV clients can set a filter before sending a
mempool
to only receive transactions that match that filter; this
allows a recently-started client to get most or all unconfirmed
transactions related to its wallet.
The inv
response to the mempool
message is, at best, one node’s
view of the network—not a complete list of unconfirmed transactions
on the network. Here are some additional reasons the list might not
be complete:
-
Before Bitcoin Core 0.9.0, the response to the
mempool
message was only oneinv
message. Aninv
message is limited to 50,000 inventories, so a node with a memory pool larger than 50,000 entries would not send everything. Later versions of Bitcoin Core send as manyinv
messages as needed to reference its complete memory pool. -
The
mempool
message is not currently fully compatible with thefilterload
message’sBLOOM_UPDATE_ALL
andBLOOM_UPDATE_P2PUBKEY_ONLY
flags. Mempool transactions are not sorted like in-block transactions, so a transaction (tx2) spending an output can appear before the transaction (tx1) containing that output, which means the automatic filter update mechanism won’t operate until the second-appearing transaction (tx1) is seen—missing the first-appearing transaction (tx2). It has been proposed in Bitcoin Core issue #2381 that the transactions should be sorted before being processed by the filter.
There is no payload in a mempool
message. See the message header
section for an example of a message without a payload.
MerkleBlock
Added in protocol version 70001 as described by BIP37.
The merkleblock
message is a reply to a getdata
message which
requested a block using the inventory type MSG_MERKLEBLOCK
. It is
only part of the reply: if any matching transactions are found, they will
be sent separately as tx
messages.
If a filter has been previously set with the filterload
message, the
merkleblock
message will contain the TXIDs of any transactions in the
requested block that matched the filter, as well as any parts of the
block’s merkle tree necessary to connect those transactions to the
block header’s merkle root. The message also contains a complete copy
of the block header to allow the client to hash it and confirm its
proof of work.
Bytes | Name | Data Type | Description |
---|---|---|---|
80 | block header | block_header | The block header in the format described in the block header section. |
4 | transaction count | uint32_t | The number of transactions in the block (including ones that don’t match the filter). |
Varies | hash count | compactSize uint | The number of hashes in the following field. |
Varies | hashes | char[32] | One or more hashes of both transactions and merkle nodes in internal byte order. Each hash is 32 bytes. |
Varies | flag byte count | compactSize uint | The number of flag bytes in the following field. |
Varies | flags | byte[] | A sequence of bits packed eight in a byte with the least significant bit first. May be padded to the nearest byte boundary but must not contain any more bits than that. Used to assign the hashes to particular nodes in the merkle tree as described below. |
The annotated hexdump below shows a merkleblock
message which
corresponds to the examples below. (The message header has been
omitted.)
01000000 ........................... Block version: 1
82bb869cf3a793432a66e826e05a6fc3
7469f8efb7421dc88067010000000000 ... Hash of previous block's header
7f16c5962e8bd963659c793ce370d95f
093bc7e367117b3c30c1f8fdd0d97287 ... Merkle root
76381b4d ........................... Time: 1293629558
4c86041b ........................... nBits: 0x04864c * 256**(0x1b-3)
554b8529 ........................... Nonce
07000000 ........................... Transaction count: 7
04 ................................. Hash count: 4
3612262624047ee87660be1a707519a4
43b1c1ce3d248cbfc6c15870f6c5daa2 ... Hash #1
019f5b01d4195ecbc9398fbf3c3b1fa9
bb3183301d7a1fb3bd174fcfa40a2b65 ... Hash #2
41ed70551dd7e841883ab8f0b16bf041
76b7d1480e4f0af9f3d4c3595768d068 ... Hash #3
20d2a7bc994987302e5b1ac80fc425fe
25f8b63169ea78e68fbaaefa59379bbf ... Hash #4
01 ................................. Flag bytes: 1
1d ................................. Flags: 1 0 1 1 1 0 0 0
Note: when fully decoded, the above merkleblock
message provided the
TXID for a single transaction that matched the filter. In the network
traffic dump this output was taken from, the full transaction belonging
to that TXID was sent immediately after the merkleblock
message as
a tx
message.
Parsing A MerkleBlock Message
As seen in the annotated hexdump above, the merkleblock
message
provides three special data types: a transaction count, a list of
hashes, and a list of one-bit flags.
You can use the transaction count to construct an empty merkle tree. We’ll call each entry in the tree a node; on the bottom are TXID nodes—the hashes for these nodes are TXIDs; the remaining nodes (including the merkle root) are non-TXID nodes—they may actually have the same hash as a TXID, but we treat them differently.
Keep the hashes and flags in the order they appear in the merkleblock
message. When we say “next flag” or “next hash”, we mean the next flag
or hash on the list, even if it’s the first one we’ve used so far.
Start with the merkle root node and the first flag. The table below describes how to evaluate a flag based on whether the node being processed is a TXID node or a non-TXID node. Once you apply a flag to a node, never apply another flag to that same node or reuse that same flag again.
Flag | TXID Node | Non-TXID Node |
---|---|---|
0 | Use the next hash as this node’s TXID, but this transaction didn’t match the filter. | Use the next hash as this node’s hash. Don’t process any descendant nodes. |
1 | Use the next hash as this node’s TXID, and mark this transaction as matching the filter. | The hash needs to be computed. Process the left child node to get its hash; process the right child node to get its hash; then concatenate the two hashes as 64 raw bytes and hash them to get this node’s hash. |
Any time you begin processing a node for the first time, evaluate the next flag. Never use a flag at any other time.
When processing a child node, you may need to process its children (the grandchildren of the original node) or further-descended nodes before returning to the parent node. This is expected—keep processing depth first until you reach a TXID node or a non-TXID node with a flag of 0.
After you process a TXID node or a non-TXID node with a flag of 0, stop processing flags and begin to ascend the tree. As you ascend, compute the hash of any nodes for which you now have both child hashes or for which you now have the sole child hash. See the merkle tree section for hashing instructions. If you reach a node where only the left hash is known, descend into its right child (if present) and further descendants as necessary.
However, if you find a node whose left and right children both have the same hash, fail. This is related to CVE-2012-2459.
Continue descending and ascending until you have enough information to obtain the hash of the merkle root node. If you run out of flags or hashes before that condition is reached, fail. Then perform the following checks (order doesn’t matter):
-
Fail if there are unused hashes in the hashes list.
-
Fail if there are unused flag bits—except for the minimum number of bits necessary to pad up to the next full byte.
-
Fail if the hash of the merkle root node is not identical to the merkle root in the block header.
-
Fail if the block header is invalid. Remember to ensure that the hash of the header is less than or equal to the target threshold encoded by the nBits header field. Your program should also, of course, attempt to ensure the header belongs to the best block chain and that the user knows how many confirmations this block has.
For a detailed example of parsing a merkleblock
message, please see
the corresponding merkle block examples section.
Creating A MerkleBlock Message
It’s easier to understand how to create a merkleblock
message after
you understand how to parse an already-created message, so we recommend
you read the parsing section above first.
Create a complete merkle tree with TXIDs on the bottom row and all the other hashes calculated up to the merkle root on the top row. For each transaction that matches the filter, track its TXID node and all of its ancestor nodes.
Start processing the tree with the merkle root node. The table below describes how to process both TXID nodes and non-TXID nodes based on whether the node is a match, a match ancestor, or neither a match nor a match ancestor.
TXID Node | Non-TXID Node | |
---|---|---|
Neither Match Nor Match Ancestor | Append a 0 to the flag list; append this node’s TXID to the hash list. | Append a 0 to the flag list; append this node’s hash to the hash list. Do not descend into its child nodes. |
Match Or Match Ancestor | Append a 1 to the flag list; append this node’s TXID to the hash list. | Append a 1 to the flag list; process the left child node. Then, if the node has a right child, process the right child. Do not append a hash to the hash list for this node. |
Any time you begin processing a node for the first time, a flag should be appended to the flag list. Never put a flag on the list at any other time, except when processing is complete to pad out the flag list to a byte boundary.
When processing a child node, you may need to process its children (the grandchildren of the original node) or further-descended nodes before returning to the parent node. This is expected—keep processing depth first until you reach a TXID node or a node which is neither a TXID nor a match ancestor.
After you process a TXID node or a node which is neither a TXID nor a match ancestor, stop processing and begin to ascend the tree until you find a node with a right child you haven’t processed yet. Descend into that right child and process it.
After you fully process the merkle root node according to the
instructions in the table above, processing is complete. Pad your flag
list to a byte boundary and construct the merkleblock
message using the
template near the beginning of this subsection.
NotFound
Added in protocol version 70001.
The notfound
message is a reply to a getdata
message which
requested an object the receiving node does not have available for
relay. (Nodes are not expected to relay historic transactions which
are no longer in the memory pool or relay set. Nodes may also have
pruned spent transactions from older blocks, making them unable to
send those blocks.)
The format and maximum size limitations of the notfound
message are
identical to the inv
message; only the message header differs.
Tx
The tx
message transmits a single transaction in the raw transaction
format. It can be sent in a variety of situations;
-
Transaction Response: Dash Core will send it in response to a
getdata
message that requests the transaction with an inventory type ofMSG_TX
. -
MerkleBlock Response: Dash Core will send it in response to a
getdata
message that requests a merkle block with an inventory type ofMSG_MERKLEBLOCK
. (This is in addition to sending amerkleblock
message.) Eachtx
message in this case provides a matched transaction from that block.
For an example hexdump of the raw transaction format, see the raw transaction section.
Control Messages
The following network messages all help control the connection between two peers or allow them to advise each other about the rest of the network.
Note that almost none of the control messages are authenticated in any way, meaning they can contain incorrect or intentionally harmful information. In addition, this section does not yet cover P2P protocol operation over the Tor network; if you would like to contribute information about Tor, please open an issue.
Addr
The addr
(IP address) message relays connection information
for peers on the network. Each peer which wants to accept incoming
connections creates an addr
message providing its connection
information and then sends that message to its peers unsolicited. Some
of its peers send that information to their peers (also unsolicited),
some of which further distribute it, allowing decentralized peer
discovery for any program already on the network.
An addr
message may also be sent in response to a getaddr
message.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | IP address count | compactSize uint | The number of IP address entries up to a maximum of 1,000. |
Varies | IP addresses | network IP address | IP address entries. See the table below for the format of a Dash network IP address. |
Each encapsulated network IP address currently uses the following structure:
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | time | uint32 | Added in protocol version 31402. A time in Unix epoch time format. Nodes advertising their own IP address set this to the current time. Nodes advertising IP addresses they’ve connected to set this to the last time they connected to that node. Other nodes just relaying the IP address should not change the time. Nodes can use the time field to avoid relaying old addr messages. Malicious nodes may change times or even set them in the future. |
8 | services | uint64_t | The services the node advertised in its version message. |
16 | IP address | char | IPv6 address in big endian byte order. IPv4 addresses can be provided as IPv4-mapped IPv6 addresses |
2 | port | uint16_t | Port number in big endian byte order. Note that Dash Core will only connect to nodes with non-standard port numbers as a last resort for finding peers. This is to prevent anyone from trying to use the network to disrupt non-Dash services that run on other ports. |
The following annotated hexdump shows part of an addr
message. (The
message header has been omitted and the actual IP address has been
replaced with a RFC5737 reserved IP address.)
fde803 ............................. Address count: 1000
d91f4854 ........................... Epoch time: 1414012889
0100000000000000 ................... Service bits: 01 (network node)
00000000000000000000ffffc0000233 ... IP Address: ::ffff:192.0.2.51
208d ............................... Port: 8333
[...] .............................. (999 more addresses omitted)
Alert
Added in protocol version 311. Removed by Bitcoin in protocol version 70013, but retained by Dash.
The alert
message warns nodes of problems that may affect them or the
rest of the network. Each alert
message is signed using a key controlled
by respected community members, mostly Dash Core developers.
To ensure all nodes can validate and forward alert
messages,
encapsulation is used. Developers create an alert using the data
structure appropriate for the versions of the software they want to
notify; then they serialize that data and sign it. The serialized data
and its signature make up the outer alert
message—allowing nodes
which don’t understand the data structure to validate the signature and
relay the alert to nodes which do understand it. The nodes which
actually need the message can decode the serialized data to access the
inner alert
message.
The outer alert
message has four fields:
Bytes | Name | Data Type | Description |
---|---|---|---|
Variable | alert bytes | compactSize uint | The number of bytes in following alert field. |
Variable | alert | uchar | The serialized alert. See below for a description of the current alert format. |
Variable | signature bytes | compactSize uint | The number of bytes in the following signature field. |
Variable | signature | uchar | A DER-encoded ECDSA (secp256k1) signature of the alert signed with the developer’s alert key. |
Although designed to be easily upgraded, the format of the inner
serialized alert has not changed since the alert
message was first
introduced in protocol version 311.
Bytes | Name | Data Type | Description |
---|---|---|---|
4 | version | int32_t | Alert format version. Version 1 from protocol version 311 through at least protocol version 70002. |
8 | relayUntil | int64_t | The time beyond which nodes should stop relaying this alert. Unix epoch time format. |
8 | expiration | int64_t | The time beyond which this alert is no longer in effect and should be ignored. Unix epoch time format. |
4 | ID | int32_t | A unique ID number for this alert. |
4 | cancel | int32_t | All alerts with an ID number less than or equal to this number should be canceled: deleted and not accepted in the future. |
Varies | setCancel count | compactSize uint | The number of IDs in the following setCancel field. May be zero. |
Varies | setCancel | int32_t | Alert IDs which should be canceled. Each alert ID is a separate int32_t number. |
4 | minVer | int32_t | This alert only applies to protocol versions greater than or equal to this version. Nodes running other protocol versions should still relay it. |
4 | maxVer | int32_t | This alert only applies to protocol versions less than or equal to this version. Nodes running other protocol versions should still relay it. |
Varies | user_agent count | compactSize uint | The number of user agent strings in the following setUser_agent field. May be zero. |
Varies | setUser_agent | compactSize uint + string | If this field is empty, it has no effect on the alert. If there is at least one entry is this field, this alert only applies to programs with a user agent that exactly matches one of the strings in this field. Each entry in this field is a compactSize uint followed by a string—the uint indicates how many bytes are in the following string. This field was originally called setSubVer; since BIP14, it applies to user agent strings as defined in the version message. |
4 | priority | int32_t | Relative priority compared to other alerts. |
Varies | comment bytes | compactSize uint | The number of bytes in the following comment field. May be zero. |
Varies | comment | string | A comment on the alert that is not displayed. |
Varies | statusBar bytes | compactSize uint | The number of bytes in the following statusBar field. May be zero. |
Varies | statusBar | string | The alert message that is displayed to the user. |
Varies | reserved bytes | compactSize uint | The number of bytes in the following reserved field. May be zero. |
Varies | reserved | string | Reserved for future use. Originally called RPC Error. |
The annotated hexdump below shows an alert
message. (The message
header has been omitted.)
73 ................................. Bytes in encapsulated alert: 115
01000000 ........................... Version: 1
3766404f00000000 ................... RelayUntil: 1329620535
b305434f00000000 ................... Expiration: 1330917376
f2030000 ........................... ID: 1010
f1030000 ........................... Cancel: 1009
00 ................................. setCancel count: 0
10270000 ........................... MinVer: 10000
48ee0000 ........................... MaxVer: 61000
00 ................................. setUser_agent bytes: 0
64000000 ........................... Priority: 100
00 ................................. Bytes In Comment String: 0
46 ................................. Bytes in StatusBar String: 70
53656520626974636f696e2e6f72672f
666562323020696620796f7520686176
652074726f75626c6520636f6e6e6563
74696e67206166746572203230204665
627275617279 ....................... Status Bar String: "See [...]"
00 ................................. Bytes In Reserved String: 0
47 ................................. Bytes in signature: 71
30450221008389df45f0703f39ec8c1c
c42c13810ffcae14995bb648340219e3
53b63b53eb022009ec65e1c1aaeec1fd
334c6b684bde2b3f573060d5b70c3a46
723326e4e8a4f1 ..................... Signature
Alert key compromise: Dash Core’s source code defines a
particular set of alert parameters that can be used to notify users that
the alert signing key has been compromised and that they should upgrade
to get a new alert public key. Once a signed alert containing those
parameters has been received, no other alerts can cancel or override it.
See the ProcessAlert()
function in the Dash Core alert.cpp source code for the parameters of this message.
FilterAdd
Added in protocol version 70001 as described by BIP37.
The filteradd
message tells the receiving peer to add a single element to
a previously-set bloom filter, such as a new public key. The element is
sent directly to the receiving peer; the peer then uses the parameters set
in the filterload
message to add the element to the bloom filter.
Because the element is sent directly to the receiving peer, there is no
obfuscation of the element and none of the plausible-deniability privacy
provided by the bloom filter. Clients that want to maintain greater
privacy should recalculate the bloom filter themselves and send a new
filterload
message with the recalculated bloom filter.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | element bytes | compactSize uint | The number of bytes in the following element field. |
Varies | element | uint8_t[] | The element to add to the current filter. Maximum of 520 bytes, which is the maximum size of an element which can be pushed onto the stack in a pubkey or signature script. Elements must be sent in the byte order they would use when appearing in a raw transaction; for example, hashes should be sent in internal byte order. |
Note: a filteradd
message will not be accepted unless a filter was
previously set with the filterload
message.
The annotated hexdump below shows a filteradd
message adding a TXID.
(The message header has been omitted.) This TXID appears in the same
block used for the example hexdump in the merkleblock
message; if that
merkleblock
message is re-sent after sending this filteradd
message,
six hashes are returned instead of four.
20 ................................. Element bytes: 32
fdacf9b3eb077412e7a968d2e4f11b9a
9dee312d666187ed77ee7d26af16cb0b ... Element (A TXID)
FilterClear
Added in protocol version 70001 as described by BIP37.
The filterclear
message tells the receiving peer to remove a
previously-set bloom filter. This also undoes the effect of setting the
relay field in the version
message to 0, allowing unfiltered access to
inv
messages announcing new transactions.
Dash Core does not require a filterclear
message before a
replacement filter is loaded with filterload
. It also doesn’t require
a filterload
message before a filterclear
message.
There is no payload in a filterclear
message. See the message header
section for an example of a message without a payload.
FilterLoad
Added in protocol version 70001 as described by BIP37.
The filterload
message tells the receiving peer to filter all relayed
transactions and requested merkle blocks through the provided filter.
This allows clients to receive transactions relevant to their wallet
plus a configurable rate of false positive transactions which can
provide plausible-deniability privacy.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | nFilterBytes | compactSize uint | Number of bytes in the following filter bit field. |
Varies | filter | uint8_t[] | A bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes. |
4 | nHashFuncs | uint32_t | The number of hash functions to use in this filter. The maximum value allowed in this field is 50. |
4 | nTweak | uint32_t | An arbitrary value to add to the seed value in the hash function used by the bloom filter. |
1 | nFlags | uint8_t | A set of flags that control how outpoints corresponding to a matched pubkey script are added to the filter. See the table in the Updating A Bloom Filter subsection below. |
The annotated hexdump below shows a filterload
message. (The message
header has been omitted.) For an example of how this payload was
created, see the filterload example.
02 ......... Filter bytes: 2
b50f ....... Filter: 1010 1101 1111 0000
0b000000 ... nHashFuncs: 11
00000000 ... nTweak: 0/none
00 ......... nFlags: BLOOM_UPDATE_NONE
Initializing A Bloom Filter
Filters have two core parameters: the size of the bit field and the number of hash functions to run against each data element. The following formulas from BIP37 will allow you to automatically select appropriate values based on the number of elements you plan to insert into the filter (n) and the false positive rate (p) you desire to maintain plausible deniability.
-
Size of the bit field in bytes (nFilterBytes), up to a maximum of 36,000:
(-1 / log(2)**2 * n * log(p)) / 8
-
Hash functions to use (nHashFuncs), up to a maximum of 50:
nFilterBytes * 8 / n * log(2)
Note that the filter matches parts of transactions (transaction elements), so the false positive rate is relative to the number of elements checked—not the number of transactions checked. Each normal transaction has a minimum of four matchable elements (described in the comparison subsection below), so a filter with a false-positive rate of 1 percent will match about 4 percent of all transactions at a minimum.
According to BIP37, the formulas and limits described above provide support for bloom filters containing 20,000 items with a false positive rate of less than 0.1 percent or 10,000 items with a false positive rate of less than 0.0001 percent.
Once the size of the bit field is known, the bit field should be initialized as all zeroes.
Populating A Bloom Filter
The bloom filter is populated using between 1 and 50 unique hash functions (the number specified per filter by the nHashFuncs field). Instead of using up to 50 different hash function implementations, a single implementation is used with a unique seed value for each function.
The seed is nHashNum * 0xfba4c795 + nTweak
as a uint32_t, where the values
are:
-
nHashNum is the sequence number for this hash function, starting at 0 for the first hash iteration and increasing up to the value of the nHashFuncs field (minus one) for the last hash iteration.
-
0xfba4c795 is a constant optimized to create large differences in the seed for different values of nHashNum.
-
nTweak is a per-filter constant set by the client to require the use of an arbitrary set of hash functions.
If the seed resulting from the formula above is larger than four bytes,
it must be truncated to its four most significant bytes (for example,
0x8967452301 & 0xffffffff → 0x67452301
).
The actual hash function implementation used is the 32-bit Murmur3 hash function.
Warning: the Murmur3 hash function has separate 32-bit and 64-bit
versions that produce different results for the same input. Only the
32-bit Murmur3 version is used with Dash bloom filters.
The data to be hashed can be any transaction element which the bloom filter can match. See the next subsection for the list of transaction elements checked against the filter. The largest element which can be matched is a script data push of 520 bytes, so the data should never exceed 520 bytes.
The example below from Dash Core bloom.cpp combines all the steps above to create the hash function template. The seed is the first parameter; the data to be hashed is the second parameter. The result is a uint32_t modulo the size of the bit field in bits.
MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (vData.size() * 8)
Each data element to be added to the filter is hashed by nHashFuncs
number of hash functions. Each time a hash function is run, the result
will be the index number (nIndex) of a bit in the bit field. That bit
must be set to 1. For example if the filter bit field was 00000000
and
the result is 5, the revised filter bit field is 00000100
(the first bit
is bit 0).
It is expected that sometimes the same index number will be returned more than once when populating the bit field; this does not affect the algorithm—after a bit is set to 1, it is never changed back to 0.
After all data elements have been added to the filter, each set of eight bits is converted into a little-endian byte. These bytes are the value of the filter field.
Comparing Transaction Elements To A Bloom Filter
To compare an arbitrary data element against the bloom filter, it is
hashed using the same parameters used to create the bloom filter.
Specifically, it is hashed nHashFuncs times, each time using the same
nTweak provided in the filter, and the resulting output is modulo the
size of the bit field provided in the filter field. After each hash is
performed, the filter is checked to see if the bit at that indexed
location is set. For example if the result of a hash is 5
and the
filter is 01001110
, the bit is considered set.
If the result of every hash points to a set bit, the filter matches. If any of the results points to an unset bit, the filter does not match.
The following transaction elements are compared against bloom filters. All elements will be hashed in the byte order used in blocks (for example, TXIDs will be in internal byte order).
-
TXIDs: the transaction’s SHA256(SHA256()) hash.
-
Outpoints: each 36-byte outpoint used this transaction’s input section is individually compared to the filter.
-
Signature Script Data: each element pushed onto the stack by a data-pushing opcode in a signature script from this transaction is individually compared to the filter. This includes data elements present in P2SH redeem scripts when they are being spent.
-
PubKey Script Data: each element pushed onto the the stack by a data-pushing opcode in any pubkey script from this transaction is individually compared to the filter. (If a pubkey script element matches the filter, the filter will be immediately updated if the
BLOOM_UPDATE_ALL
flag was set; if the pubkey script is in the P2PKH format and matches the filter, the filter will be immediately updated if theBLOOM_UPDATE_P2PUBKEY_ONLY
flag was set. See the subsection below for details.)
The following annotated hexdump of a transaction is from the raw
transaction format section; the elements which
would be checked by the filter are emphasized in bold. Note that this
transaction’s TXID (01000000017b1eab[...]
) would also be checked,
and that the outpoint TXID and index number below would be checked as a
single 36-byte element.
01000000 ................................... Version
01 ......................................... Number of inputs
|
| 7b1eabe0209b1fe794124575ef807057
| c77ada2138ae4fa8d6c4de0398a14f3f ......... Outpoint TXID
| 00000000 ................................. Outpoint index number
|
| 49 ....................................... Bytes in sig. script: 73
| | 48 ..................................... Push 72 bytes as data
| | | 30450221008949f0cb400094ad2b5eb3
| | | 99d59d01c14d73d8fe6e96df1a7150de
| | | b388ab8935022079656090d7f6bac4c9
| | | a94e0aad311a4268e082a725f8aeae05
| | | 73fb12ff866a5f01 ..................... Secp256k1 signature
|
| ffffffff ................................. Sequence number: UINT32_MAX
01 ......................................... Number of outputs
| f0ca052a01000000 ......................... Satoshis (49.99990000 BTC)
|
| 19 ....................................... Bytes in pubkey script: 25
| | 76 ..................................... OP_DUP
| | a9 ..................................... OP_HASH160
| | 14 ..................................... Push 20 bytes as data
| | | cbc20a7664f2f69e5355aa427045bc15
| | | e7c6c772 ............................. PubKey hash
| | 88 ..................................... OP_EQUALVERIFY
| | ac ..................................... OP_CHECKSIG
00000000 ................................... locktime: 0 (a block height)
Updating A Bloom Filter
Clients will often want to track inputs that spend outputs (outpoints) relevant to their wallet, so the filterload field nFlags can be set to allow the filtering node to update the filter when a match is found. When the filtering node sees a pubkey script that pays a pubkey, address, or other data element matching the filter, the filtering node immediately updates the filter with the outpoint corresponding to that pubkey script.
If an input later spends that outpoint, the filter will match it, allowing the filtering node to tell the client that one of its transaction outputs has been spent.
The nFlags field has three allowed values:
Value | Name | Description |
---|---|---|
0 | BLOOM_UPDATE_NONE | The filtering node should not update the filter. |
1 | BLOOM_UPDATE_ALL | If the filter matches any data element in a pubkey script, the corresponding outpoint is added to the filter. |
2 | BLOOM_UPDATE_P2PUBKEY_ONLY | If the filter matches any data element in a pubkey script and that script is either a P2PKH or non-P2SH pay-to-multisig script, the corresponding outpoint is added to the filter. |
In addition, because the filter size stays the same even though additional elements are being added to it, the false positive rate increases. Each false positive can result in another element being added to the filter, creating a feedback loop that can (after a certain point) make the filter useless. For this reason, clients using automatic filter updates need to monitor the actual false positive rate and send a new filter when the rate gets too high.
GetAddr
The getaddr
message requests an addr
message from the receiving
node, preferably one with lots of IP addresses of other receiving nodes.
The transmitting node can use those IP addresses to quickly update its
database of available nodes rather than waiting for unsolicited addr
messages to arrive over time.
There is no payload in a getaddr
message. See the message header
section for an example of a message without a payload.
GetSporks
The getsporks
message requests spork
messages from the receiving node.
There is no payload in a getsporks
message. See the message header
section for an example of a message without a payload.
Ping
The ping
message helps confirm that the receiving peer is still
connected. If a TCP/IP error is encountered when sending the ping
message (such as a connection timeout), the transmitting node can assume
that the receiving node is disconnected. The response to a ping
message is the pong
message.
Before protocol version 60000, the ping
message had no payload. As of
protocol version 60001 and all later versions, the message includes a
single field, the nonce.
Bytes | Name | Data Type | Description |
---|---|---|---|
8 | nonce | uint64_t | Added in protocol version 60001 as described by BIP31. Random nonce assigned to this ping message. The responding pong message will include this nonce to identify the ping message to which it is replying. |
The annotated hexdump below shows a ping
message. (The message
header has been omitted.)
0094102111e2af4d ... Nonce
Pong
Added in protocol version 60001 as described by BIP31.
The pong
message replies to a ping
message, proving to the pinging
node that the ponging node is still alive. Dash Core will, by
default, disconnect from any clients which have not responded to a
ping
message within 20 minutes.
To allow nodes to keep track of latency, the pong
message sends back
the same nonce received in the ping
message it is replying to.
The format of the pong
message is identical to the ping
message;
only the message header differs.
Reject
Added in protocol version 70002 as described by BIP61.
The reject
message informs the receiving node that one of its previous
messages has been rejected.
Bytes | Name | Data Type | Description |
---|---|---|---|
Varies | message bytes | compactSize uint | The number of bytes in the following message field. |
Varies | message | string | The type of message rejected as ASCII text without null padding. For example: “tx”, “block”, or “version”. |
1 | code | char | The reject message code. See the table below. |
Varies | reason bytes | compactSize uint | The number of bytes in the following reason field. May be 0x00 if a text reason isn’t provided. |
Varies | reason | string | The reason for the rejection in ASCII text. This should not be displayed to the user; it is only for debugging purposes. |
Varies | extra data | varies | Optional additional data provided with the rejection. For example, most rejections of tx messages or block messages include the hash of the rejected transaction or block header. See the code table below. |
The following table lists message reject codes. Codes are tied to the type of message they reply to; for example there is a 0x10 reject code for transactions and a 0x10 reject code for blocks.
Code | In Reply To | Extra Bytes | Extra Type | Description |
---|---|---|---|---|
0x01 | any message | 0 | N/A | Message could not be decoded. Be careful of reject message feedback loops where two peers each don’t understand each other’s reject messages and so keep sending them back and forth forever. |
0x10 | block message |
32 | char[32] | Block is invalid for some reason (invalid proof-of-work, invalid signature, etc). Extra data may include the rejected block’s header hash. |
0x10 | tx message |
32 | char[32] | Transaction is invalid for some reason (invalid signature, output value greater than input, etc.). Extra data may include the rejected transaction’s TXID. |
0x10 | ix message |
32 | char[32] | InstantSend transaction is invalid for some reason (invalid tx lock request, conflicting tx lock request, etc.). Extra data may include the rejected transaction’s TXID. |
0x11 | block message |
32 | char[32] | The block uses a version that is no longer supported. Extra data may include the rejected block’s header hash. |
0x11 | version message |
0 | N/A | Connecting node is using a protocol version that the rejecting node considers obsolete and unsupported. |
0x12 | tx message |
32 | char[32] | Duplicate input spend (double spend): the rejected transaction spends the same input as a previously-received transaction. Extra data may include the rejected transaction’s TXID. |
0x12 | version message |
0 | N/A | More than one version message received in this connection. |
0x40 | tx message |
32 | char[32] | The transaction will not be mined or relayed because the rejecting node considers it non-standard—a transaction type or version unknown by the server. Extra data may include the rejected transaction’s TXID. |
0x41 | tx message |
32 | char[32] | One or more output amounts are below the dust threshold. Extra data may include the rejected transaction’s TXID. |
0x42 | tx message |
char[32] | The transaction did not have a large enough fee or priority to be relayed or mined. Extra data may include the rejected transaction’s TXID. | |
0x43 | block message |
32 | char[32] | The block belongs to a block chain which is not the same block chain as provided by a compiled-in checkpoint. Extra data may include the rejected block’s header hash. |
Reject Codes
Code | Description |
---|---|
0x01 | Malformed |
0x10 | Invalid |
0x11 | Obsolete |
0x12 | Duplicate |
0x40 | Non-standard |
0x41 | Dust |
0x42 | Insufficient fee |
0x43 | Checkpoint |
The annotated hexdump below shows a reject
message. (The message
header has been omitted.)
02 ................................. Number of bytes in message: 2
7478 ............................... Type of message rejected: tx
12 ................................. Reject code: 0x12 (duplicate)
15 ................................. Number of bytes in reason: 21
6261642d74786e732d696e707574732d
7370656e74 ......................... Reason: bad-txns-inputs-spent
394715fcab51093be7bfca5a31005972
947baf86a31017939575fb2354222821 ... TXID
SendHeaders
The sendheaders
message tells the receiving peer to send new block
announcements using a headers
message rather than an inv
message.
There is no payload in a sendheaders
message. See the message header
section for an example of a message without a payload.
Spork
Sporks are a mechanism by which updated code is released to the network, but not immediately made active (or “enforced”). Enforcement of the updated code can be activated remotely. Should problems arise, the code can be deactivated in the same manner, without the need for a network-wide rollback or client update.
A spork
message may be sent in response to a getsporks
message.
The spork
message tells the receiving peer the status of the spork defined by
the SporkID field. Upon receiving a spork message, the client must verify the
signature before accepting the spork message as valid.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nSporkID | int | Required | ID assigned in spork.h |
8 | nValue | int64_t | Required | Value assigned to spork |
8 | nTimeSigned | int64_t | Required | Time the spork value was signed |
66 | vchSig | char[] | Required | Length (1 byte) + Signature (65 bytes) |
Defined Sporks (per src/spork.h
)
Spork ID | Number | Name | Description |
---|---|---|---|
10001 | 2 | INSTANTSEND_ENABLED |
Turns on and off InstantSend network wide |
10002 | 3 | INSTANTSEND_BLOCK_FILTERING |
Turns on and off InstantSend block filtering |
10004 | 5 | INSTANTSEND_MAX_VALUE |
Controls the max value for an InstantSend transaction (currently 2000 dash) |
10007 | 8 | MASTERNODE_PAYMENT_ENFORCEMENT |
Requires masternodes to be paid by miners when blocks are processed |
10008 | 9 | SUPERBLOCKS_ENABLED |
Superblocks are enabled (10% of the block reward allocated to fund the dash treasury for funding approved proposals) |
10009 | 10 | MASTERNODE_PAY_UPDATED_NODES |
Only current protocol version masternode’s will be paid (not older nodes) |
10011 | 12 | RECONSIDER_BLOCKS |
Forces reindex of a specified number of blocks to recover from unintentional network forks |
10012 | 13 | OLD_SUPERBLOCK_FLAG |
Deprecated. No network function since block 614820 |
10013 | 14 | REQUIRE_SENTINEL_FLAG |
Only masternode’s running sentinel will be paid |
To verify vchSig
, compare the hard-coded spork public key (strSporkPubKey
from src/chainparams.cpp
) with the public key recovered from
the spork
message’s hash and vchSig
value (implementation details for Dash
Core can be found in CPubKey::RecoverCompact
). The hash is a double SHA-256 hash of:
Network | Spork Pubkey (wrapped) |
---|---|
Mainnet | 04549ac134f694c0243f503e8c8a9a986f5de6610049c40b07816809b0d1 d06a21b07be27b9bb555931773f62ba6cf35a25fd52f694d4e1106ccd237 a7bb899fdd |
Testnet3 | 046f78dcf911fbd61910136f7f0f8d90578f68d0b3ac973b5040fb7afb50 1b5939f39b108b0569dca71488f5bbf498d92e4d1194f6f941307ffd95f7 5e76869f0e |
RegTest | Undefined |
The following annotated hexdump shows a spork
message.
11270000 .................................... Spork ID: Spork 2 InstantSend enabled (10001)
0000000000000000 ............................ Value (0)
2478da5900000000 ............................ Epoch time: 2017-10-08 19:10:28 UTC (1507489828)
41 .......................................... Signature length: 65
1b6762d3e70890b5cfaed5d1fd72121c
d32020c827a89f8128a00acd210f4ea4
1b36c26c3767f8a24f48663e189865ed
403ed1e850cdb4207cdd466419d9d183
45 .......................................... Masternode Signature
VerAck
The verack
message acknowledges a previously-received version
message, informing the connecting node that it can begin to send
other messages. The verack
message has no payload; for an example
of a message with no payload, see the message headers
section.
Version
The version
message provides information about the transmitting node
to the receiving node at the beginning of a connection. Until both peers
have exchanged version
messages, no other messages will be accepted.
If a version
message is accepted, the receiving node should send a
verack
message—but no node should send a verack
message
before initializing its half of the connection by first sending a
version
message.
Bytes | Name | Data Type | Required/Optional | Description |
---|---|---|---|---|
4 | version | int32_t | Required | The highest protocol version understood by the transmitting node. See the protocol version section. |
8 | services | uint64_t | Required | The services supported by the transmitting node encoded as a bitfield. See the list of service codes below. |
8 | timestamp | int64_t | Required | The current Unix epoch time according to the transmitting node’s clock. Because nodes will reject blocks with timestamps more than two hours in the future, this field can help other nodes to determine that their clock is wrong. |
8 | addr_recv services | uint64_t | Required | Added in protocol version 106. The services supported by the receiving node as perceived by the transmitting node. Same format as the ‘services’ field above. Dash Core will attempt to provide accurate information. |
16 | addr_recv IP address | char | Required | Added in protocol version 106. The IPv6 address of the receiving node as perceived by the transmitting node in big endian byte order. IPv4 addresses can be provided as IPv4-mapped IPv6 addresses. Dash Core will attempt to provide accurate information. |
2 | addr_recv port | uint16_t | Required | Added in protocol version 106. The port number of the receiving node as perceived by the transmitting node in big endian byte order. |
8 | addr_trans services | uint64_t | Required | The services supported by the transmitting node. Should be identical to the ‘services’ field above. |
16 | addr_trans IP address | char | Required | The IPv6 address of the transmitting node in big endian byte order. IPv4 addresses can be provided as IPv4-mapped IPv6 addresses. Set to ::ffff:127.0.0.1 if unknown. |
2 | addr_trans port | uint16_t | Required | The port number of the transmitting node in big endian byte order. |
8 | nonce | uint64_t | Required | A random nonce which can help a node detect a connection to itself. If the nonce is 0, the nonce field is ignored. If the nonce is anything else, a node should terminate the connection on receipt of a version message with a nonce it previously sent. |
Varies | user_agent bytes | compactSize uint | Required | Number of bytes in following user_agent field. If 0x00, no user agent field is sent. |
Varies | user_agent | string | Required if user_agent bytes > 0 | Renamed in protocol version 60000. User agent as defined by BIP14. Previously called subVer. Dash Core limits the length to 256 characters. |
4 | start_height | int32_t | Required | The height of the transmitting node’s best block chain or, in the case of an SPV client, best block header chain. |
1 | relay | bool | Optional | Added in protocol version 70001 as described by BIP37. Transaction relay flag. If 0x00, no inv messages or tx messages announcing new transactions should be sent to this client until it sends a filterload message or filterclear message. If the relay field is not present or is set to 0x01, this node wants inv messages and tx messages announcing new transactions. |
The following service identifiers have been assigned.
Value | Name | Description |
---|---|---|
0x00 | Unnamed | This node is not a full node. It may not be able to provide any data except for the transactions it originates. |
0x01 | NODE_NETWORK | This is a full node and can be asked for full blocks. It should implement all protocol features available in its self-reported protocol version. |
0x02 | NODE_GETUTXO | This node is capable of responding to the getutxo protocol request. Dash Core does not support this service. |
0x04 | NODE_BLOOM | This node is capable and willing to handle bloom-filtered connections. Dash Core nodes used to support this by default, without advertising this bit, but no longer do as of protocol version 70201 (= NO_BLOOM_VERSION) |
The following annotated hexdump shows a version
message. (The
message header has been omitted and the actual IP addresses have been
replaced with RFC5737 reserved IP addresses.)
3e120100 .................................... Protocol version: 70206
0500000000000000 ............................ Services: NODE_NETWORK (1) + NODE_BLOOM (4)
bc8f5e5400000000 ............................ Epoch time: 1415483324
0100000000000000 ............................ Receiving node's services
00000000000000000000ffffc61b6409 ............ Receiving node's IPv6 address
270f ........................................ Receiving node's port number
0500000000000000 ............................ Transmitting node's services
00000000000000000000ffffcb0071c0 ............ Transmitting node's IPv6 address
270f ........................................ Transmitting node's port number
128035cbc97953f8 ............................ Nonce
14 .......................................... Bytes in user agent string: 20
2f4461736820436f72653a302e31322e312e352f..... User agent: /Satoshi:0.9.2.1/
851f0b00 .................................... Start height: 728965
01 .......................................... Relay flag: true
InstantSend Messages
The following network messages all help control the InstantSend feature of Dash. InstantSend uses the masternode network to lock transaction inputs and enable secure, instantaneous transactions. For additional details, refer to the Developer Guide InstantSend section.
ix
The ix
message (transaction lock request) has the same structure as the tx
message.
The masternode network responds with txlvote
messages if the transaction inputs
can be locked.
txlvote
The txlvote
message (transaction lock vote)
is sent by masternodes to indicate approval of a transaction lock request
ix
message.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
32 | txHash | uint256 | Required | TXID of the transaction to lock |
36 | outPoint | outpoint | Required | The unspent outpoint to lock in this transaction |
36 | outpointMasternode | outpoint | Required | The outpoint of the masternode which is signing the vote |
66* | vchMasternodeSignature | char[] | Required | 66 bytes in most cases. Length (1 byte) + Signature (65 bytes) |
The following annotated hexdump shows a txlvote
message. (The
message header has been omitted.)
3c121fb4a12b2f715e2f70a9fa282115
be197dde14073959fb2a2b8e95a7418f ..... TXID
Outpoint to lock
| bb607995757c6a6efd6429215dcb3688
| b252d34d835c81fed310fd905f487020 ... Outpoint TXID
| 01000000 ........................... Outpoint index number: 1
Masternode Outpoint
| de9029c7e9b7eb7cd11f27ba670b2349
| 0c3f0717b86ed949c316874589405cd2 ... Outpoint TXID
| 00000000 ........................... Outpoint index number: 0
41 ................................... Signature length: 65
1ccc39ffb9c62111a8c82823d3ce61d2
380db4e8f76ec238d568908f37558a90
4e79566a53663de12ec2be1183c87d61
250e8ebd57be171be1d4b5e89b69c263
88 ................................... Masternode Signature
PrivateSend Messages
The following network messages all help control the PrivateSend (formerly DarkSend) coin mixing features built in to Dash and facilitated by the masternode network.
Since the messages are all related to a single process, this diagram shows them
sequentially numbered. The dssu
message (not shown) is sent by the
masternode in conjunction with some responses. For additional details, refer to
the Developer Guide PrivateSend section.
dsa
The dsa
message allows a node to join a mixing pool. A collateral fee is
required and may be forfeited if the client acts maliciously. The message
operates in two ways:
-
When sent to a masternode without a current mixing queue, it initiates the start of a new mixing queue
-
When sent to a masternode with a current mixing queue, it attempts to join the existing queue
Dash Core starts a new queue ~33% of the time and attempts to join an existing queue the remainder of the time.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nDenom | int | Required | Denomination that will be exclusively used when submitting inputs into the pool |
41+ | txCollateral | txIn | Required | Collateral TX that will be charged if this client acts maliciously |
The following annotated hexdump shows a dsa
message. (The message header has
been omitted.)
02000000 ................................... Denomination: 1 Dash (2)
Collateral Transaction
| Previous Output
| |
| | 010000000183bd1980c71c38f035db9b
| | 14d7f934f7d595181b3436e362899026 ....... Outpoint TXID
| | 19f3f7d3 ............................... Outpoint index number: 3556242201
|
| 83 ....................................... Bytes in sig. script: 131
|
| 000000006b483045022100f4d8fa0ae4132235fe
| cd540a62715ccfb1c9a97f8698d066656e30bb1e
| 1e06b90220301b4cc93f38950a69396ed89dfcc0
| 8e72ec8e6e7169463592a0bf504946d98b812102
| fa4b9c0f9e76e06d57c75cab9c8368a62a1ce8db
| 6eb0c25c3e0719ddd9ab549cffffffff01e09304
| 00000000001976a914f895 ................... Secp256k1 signature: None
|
| 6a4eb0e5 ................................. Sequence number: 3853536874
dsc
The dsc
message indicates a PrivateSend mixing session is complete.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nSessionID | int | Required | ID of the mixing session |
4 | nMessageID | int | Required | ID of the message describing the result of the mixing session |
Reference the Message IDs table under the dssu
message for descriptions of the
Message ID values.
The following annotated hexdump shows a dsc
message. (The
message header has been omitted.)
d9070700 ............................. Session ID: 791686
14000000 ............................. Message ID: MSG_SUCCESS (20)
dsf
The dsf
message is sent by the masternode as the final mixing transaction in
a PrivateSend mixing session. The masternode expects nodes in the mixing session
to respond with a dss
message.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nSessionID | int | Required | ID of the mixing session |
# | txFinal | tx message |
Required | Final mixing transaction with unsigned inputs |
The following annotated hexdump shows a dsf
message. (The
message header has been omitted.) Transaction inputs/outputs are only shown for
a single node (compare with the dsi
message and dss
message hexdumps).
86140c00 ............................. Session ID: 791686
Transaction Message
| 01000000 ................................. Version: 1
|
| 0f ......................................... Number of inputs: 15
|
| [...] ...................................... 5 transaction inputs omitted
|
| Transaction input #6
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 02000000 ................................. Outpoint index number: 0
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #7
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0f000000 ................................. Outpoint index number: 15
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #8
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0d000000 ................................. Outpoint index number: 13
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
|
| [...] ...................................... 7 more transaction inputs omitted
|
|
| 0f ......................................... Number of outputs: 15
|
| Transaction output #1
| | e8e4f50500000000 ......................... Duffs (1.00001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | 14826d7ba05cf76588a5503c03951dc9
| | | | 14c91b6c ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
|
| [...] ...................................... 3 transaction outputs omitted
|
|
| Transaction output #5
| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | 426614716e94812d483bca32374f6ac8
| | | | cd121b0d ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
|
| [...] ...................................... 9 transaction outputs omitted
|
|
| Transaction output #15
| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | f01197177de2358928196a543b2bbd97
| | | | 3c2ab002 ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
| 00000000 ................................... locktime: 0 (a block height)
dsi
The dsi
message replies to a dsq
message that has the Ready field set to 0x01.
The dsi
message contains user inputs for mixing along with the outputs and a
collateral. Once the masternode receives dsi
messages from all members of the
pool, it responds with a dsf
message.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
? | vecTxDSIn | CTxDSIn[] | Required | Vector of users inputs (CTxDSIn serialization is equal to CTxIn serialization) |
? | txCollateral | tx message |
Required | Collateral transaction which is used to prevent misbehavior and also to charge fees randomly |
? | vecTxDSOut | CTxDSOut[] | Required | Vector of user outputs (CTxDSOut serialization is equal to CTxOut serialization) |
The following annotated hexdump shows a dsi
message. (The message header has
been omitted.)
User inputs
| 03 ......................................... Number of inputs: 3
|
| Transaction input #1
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 02000000 ................................. Outpoint index number: 2
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #2
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0f000000 ................................. Outpoint index number: 15
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #3
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0d000000 ................................. Outpoint index number: 13
| |
| | 00 ....................................... Bytes in sig. script: 0
| | .......................................... Secp256k1 signature: None
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
Collateral Transaction
| 01000000 ................................... Version: 1
|
| 01 ......................................... Number of inputs: 1
|
| Previous Output
| |
| | 83bd1980c71c38f035db9b14d7f934f7
| | d595181b3436e36289902619f3f7d383 ......... Outpoint TXID
| | 00000000 ................................. Outpoint index number: 0
| |
| | 6b ....................................... Bytes in sig. script: 107
| |
| | 483045022100f4d8fa0ae4132235fecd540a
| | 62715ccfb1c9a97f8698d066656e30bb1e1e
| | 06b90220301b4cc93f38950a69396ed89dfc
| | c08e72ec8e6e7169463592a0bf504946d98b
| | 812102fa4b9c0f9e76e06d57c75cab9c8368
| | a62a1ce8db6eb0c25c3e0719ddd9ab549c ....... Secp256k1 signature
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| 01 ......................................... Number of outputs: 1
|
| | e093040000000000 ......................... 300,000 Duffs (0.003 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | f8956a4eb0e53b05ee6b30edfd2770b5
| | | | 26c1f1bb ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
| 00000000 ................................... locktime: 0 (a block height)
User outputs
| 03 ......................................... Number of outputs: 3
|
| Transaction output #1
| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | 14826d7ba05cf76588a5503c03951dc9
| | | | 14c91b6c ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
| Transaction output #2
| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | f01197177de2358928196a543b2bbd97
| | | | 3c2ab002 ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
| Transaction output #3
| | e8e4f50500000000 ......................... 100,001,000 Duffs (1.0001 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | 426614716e94812d483bca32374f6ac8
| | | | cd121b0d ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
dsq
The dsq
message provides nodes with mixing queue details and notifies them
when to sign final mixing TX messages.
If the message indicates the queue is not ready, the node verifies the message
is valid. It also verifies that the masternode is not flooding the network with
dsq
messages in an attempt to dominate the queuing process. It then relays the
message to its connected peers.
If the message indicates the queue is ready, the node responds with a dsi
message.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nDenom | int | Required | Denomination allowed in this mixing session |
41+ | vin | txIn | Required | Unspent output from masternode which is hosting this session |
8 | nTime | int64_t | Required | Time this dsq message was created |
1 | fReady | bool | Required | Indicates if the mixing pool is ready to be executed |
66* | vchSig | char[] | Required | Signature of this message by masternode verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) |
Denominations (per src/privatesend.cpp
)
Value | Denomination |
---|---|
1 | 10 Dash |
2 | 1 Dash |
4 | 0.1 Dash |
8 | 0.01 Dash |
The following annotated hexdump shows a dsq
message. (The
message header has been omitted.)
08000000 ............................. Denomination: 0.01 Dash (8)
Masternode Outpoint
| aeed0e77c6db30a616507a37a129bc88
| 1811f08afc51dd485d5322f36c1f04c5 ... Outpoint TXID
| 01000000 ........................... Outpoint index number: 1
1318a85900000000 ..................... Create Time: 2017-08-31 14:07:15 UTC
00 ................................... Ready: 0
41 ................................... Signature length: 65
1bd74386ea4e111197f1b4b4660c1415
13486745ca10ba0632426ed3a644d941
047e43c988680904d4a4fcf551d8813c
ec12d47ae9b00e870db294cd66708ab7
dc ................................... Masternode Signature
dss
The dss
message replies to a dsf
message sent by the masternode managing the
mixing session. The dsf
message provides the unsigned transaction inputs for
all members of the mixing pool. Each node verifies that the final transaction
matches what is expected. They then sign any transaction inputs belonging to
them and then relay them to the masternode via this dss
message.
Once the masternode receives and validates all dss
messages, it issues a
dsc
message. If a node does not respond to a dsf
message with signed
transaction inputs, it may forfeit the collateral it provided. This is to
minimize malicious behavior.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
# | inputs | txIn[] | Required | Signed inputs for mixing session |
The following annotated hexdump shows a dss
message. (The message header has
been omitted.) Note that these will be the same transaction inputs that were
supplied (unsiged) in the dsi
message.
User inputs
| 03 ......................................... Number of inputs: 3
|
| Transaction input #1
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 02000000 ................................. Outpoint index number: 2
| |
| | 6b ....................................... Bytes in sig. script: 107
| | 483045022100b3a861dca83463aabf5e4a14a286
| | 1b9c2e51e0dedd8a13552e118bf74eb4a68d0220
| | 4a91c416768d27e6bdcfa45d28129841dbcc728b
| | f0bbec9701cfc4e743d23adf812102cc4876c9da
| | 84417dec37924e0479205ce02529bb0ba88631d3
| | ccc9cfcdf00173 ........................... Secp256k1 signature
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #2
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0f000000 ................................. Outpoint index number: 15
| |
| | 6a ....................................... Bytes in sig. script: 106
| | 4730440220268f3b7799ca4ec132e511a4756019
| | c56016f7771561dc0597d84e9b1fa9fc08022067
| | 5199b9b3f9a7eba69b7bbb4aa2a413d955762f9d
| | 68be5a9c02c6772c8078fd812103258925f0dbbf
| | 9d5aa20a675459fa2e86c9f9061dee82a00dca73
| | 9080f051d891 ............................. Secp256k1 signature
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| Transaction input #3
| |
| | 36bdc3796c5630225f2c86c946e2221a
| | 9958378f5d08da380895c2656730b5c0 ......... Outpoint TXID
| | 0d000000 ................................. Outpoint index number: 13
| |
| | 6a ....................................... Bytes in sig. script: 106
| | 4730440220404bb067e0c94a2bd75c6798c1af8c
| | 95e8b92f5e437cff2bcb4660f24a34d06d02203a
| | b707bd371a84a9e7bd1fbe3b0c939fd23e0a9165
| | de78809b9310372a4b3879812103a9a6c5204811
| | a8cab04b595ed622a1fed6efd3b2d888fadd0c97
| | 3737fcdf2bc7 ............................. Secp256k1 signature
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
dssu
The dssu
message provides a mixing pool status update.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nMsgSessionID | int | Required | Session ID |
4 | nMsgState | int | Required | Current state of mixing process |
4 | nMsgEntriesCount | int | Required | Number of entries in the mixing pool |
4 | nMsgStatusUpdate | int | Required | Update state and/or signal if entry was accepted or not |
4 | nMsgMessageID | int | Required | ID of the typical masternode reply message |
Pool State
State | Description |
---|---|
0 | POOL_STATE_IDLE |
1 | POOL_STATE_QUEUE |
2 | POOL_STATE_ACCEPTING_ENTRIES |
3 | POOL_STATE_SIGNING |
4 | POOL_STATE_ERROR |
5 | POOL_STATE_SUCCESS |
Pool Status Update
Status | Description |
---|---|
0 | STATUS_REJECTED |
1 | STATUS_ACCEPTED |
Message IDs
Code | Description |
---|---|
0x00 | ERR_ALREADY_HAVE |
0x01 | ERR_DENOM |
0x02 | ERR_ENTRIES_FULL |
0x03 | ERR_EXISTING_TX |
0x04 | ERR_FEES |
0x05 | ERR_INVALID_COLLATERAL |
0x06 | ERR_INVALID_INPUT |
0x07 | ERR_INVALID_SCRIPT |
0x08 | ERR_INVALID_TX |
0x09 | ERR_MAXIMUM |
0x0A (10) | ERR_MN_LIST |
0x0B (11) | ERR_MODE |
0x0C (12) | ERR_NON_STANDARD_PUBKEY |
0x0D (13) | ERR_NOT_A_MN (Not used) |
0x0E (14) | ERR_QUEUE_FULL |
0x0F (15) | ERR_RECENT |
0x10 (16) | ERR_SESSION |
0x11 (17) | ERR_MISSING_TX |
0x12 (18) | ERR_VERSION |
0x13 (19) | MSG_NOERR |
0x14 (20) | MSG_SUCCESS |
0x15 (21) | MSG_ENTRIES_ADDED |
The following annotated hexdump shows a dssu
message. (The
message header has been omitted.)
86140c00 ............................. Session ID: 791686
02000000 ............................. State: POOL_STATE_ACCEPTING_ENTRIES (2)
03000000 ............................. Entries: 3
01000000 ............................. Status Update: STATUS_ACCEPTED (1)
13000000 ............................. Message ID: MSG_NOERR (0x13)
dstx
The dstx
message allows masternodes to broadcast subsidized transactions without
fees (to provide security in mixing).
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
# | tx | tx message |
Required | The transaction |
41 | vin | txIn | Required | Masternode unspent output |
66 | vchSig | char[] | Required | Signature of this message by masternode verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) |
8 | sigTime | int64_t | Require | Time this message was signed |
The following annotated hexdump shows a dstx
message. (The
message header has been omitted.)
Transaction Message
| 01000000 ................................. Version: 1
|
| 0b ......................................... Number of inputs: 11
|
| Transaction input #1
| |
| | 0adb782b2170018eada54534be880e70
| | 74ed8307a566731119b1782362af43ad ......... Outpoint TXID
| | 05000000 ................................. Outpoint index number: 5
| |
| | 6a ....................................... Bytes in sig. script: 106
| | 47304402204ed56f525ae6df707f9cbe
| | 55c78d82bbcc02daa1fb27b0bf54588a
| | 446dcc804102200c4e03c4a2b9a90aef
| | 9f01de7c28812a0e8b280e6c153b0bd8
| | 26d2ff660102e18121028c96903b2709
| | 7b331d55abd1f42d2ff6cc7c784ab839
| | 7c232b73a34a149a348e ..................... Secp256k1 signature
| |
| | ffffffff ................................. Sequence number: UINT32_MAX
|
| [...] ...................................... 10 more transaction inputs omitted
|
|
| 0b ......................................... Number of outputs: 11
|
| Transaction output #1
| | e8e4f50500000000 ......................... Duffs (1.00001000 Dash)
| |
| | 19 ....................................... Bytes in pubkey script: 25
| | | 76 ..................................... OP_DUP
| | | a9 ..................................... OP_HASH160
| | | 14 ..................................... Push 20 bytes as data
| | | | 0febbeaa8818b2c2f80fb8c98f90bdae
| | | | 41fe5c26 ............................. PubKey hash
| | | 88 ..................................... OP_EQUALVERIFY
| | | ac ..................................... OP_CHECKSIG
|
| [...] ...................................... 10 more transaction outputs omitted
|
|
| 00000000 ................................... locktime: 0 (a block height)
Masternode Unspent Output
| 387d522def2abfb9bdd15be899f074f3
| 49b414cef078ec642e1d14b42996b9fc ......... Outpoint TXID
| 00000000 ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature (None)
|
| ffffffff ................................. Sequence number: UINT32_MAX
1b6fb8f90f0df6e502bc10aab9604e49
2d14214e05331c9761c834d55c7536e3
3369e5909479ea88116aad7ea64587d9
59364326c97d7f249f7b9293e120a5b6
1c ................................... Masternode Signature
ece5a95900000000 ..................... Signature Timestamp
Masternode Messages
The following network messages enable the masternode features built in to Dash.
For additional details, refer to the Developer Guide Masternode Sync and Masternode Payment sections.
dseg
The dseg
message requests either the entire masternode list or a specific
entry. To request the list of all masternodes, use an empty txIn (TXID of all
zeros and an index of 0xFFFFFFFF). To request information about a specific
masternode, use the unspent output associated with that masternode.
The response to a dseg
message is an mnb
message inventory and an
mnp
message inventory for each requested masternode. Masternodes ignore this
request if they are not fully synced.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41 | vin | txIn | Required | Request options:All Entries - empty txInSingle Entry - Masternode’s unspent output which is holding 1000 DASH |
Note: Dash Core only allows nodes to request the entire list every 3 hours.
Additional requests sent prior to then may result in the node being banned.
The following annotated hexdump shows a dseg
message requesting all
masternodes. (The message header has been omitted.)
Masternode Unspent Output
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ......... Outpoint TXID
| ffffffff ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
The following annotated hexdump shows a dseg
message requesting a specific
masternode. (The message header has been omitted.)
Masternode Unspent Output
| 7fe33a2901aa654598ae0af572d4fbec
| ee97af2d0276f189d177dee5848ef3da ......... Outpoint TXID
| 00000000 ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
mnb
The mnb
message is sent whenever a masternode comes online or a client is
syncing. The masternode will send this message which describes the masternode
entry and how to validate messages from it.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41 | vin | txIn | Required | The unspent output which is holding 1000 DASH |
# | addr | CService | Required | IPv4 address of the masternode |
33-65 | pubKeyCollateralAddress | CPubKey | Required | CPubKey of the main 1000 DASH unspent output. Length determined by if it is a compressed public key or not. |
33-65 | pubKeyMasternode | CPubKey | Required | CPubKey of the secondary signing key (For all messaging other than the announce message). Length determined by if it is a compressed public key or not. |
66 | sig | char[] | Required | Signature of this message verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) |
8 | sigTime | int64_t | Required | Time which the signature was created |
4 | nProtocolVersion | int | Required | The protocol version of the masternode |
# | lastPing | mnp message |
Required | The last known ping of the masternode |
8 | nLastDsq | int64_t | Deprecated | The last time the masternode sent a dsq message (for mixing) (DEPRECATED) |
The following annotated hexdump shows a mnb
message. (The
message header has been omitted and the actual IP address has been replaced
with a RFC5737 reserved IP address.)
Masternode Unspent Output
| 3fbc7d4a8f68ba6ecb02a8db34d1f5b6
| 2dc105f0b5c3505243435cf815d02394 ......... Outpoint TXID
| 01000000 ................................. Outpoint index number: 1
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
Masternode Address
| 00000000000000000000ffffc0000233 ......... IP Address: ::ffff:192.0.2.51
| 270f ..................................... Port: 9999
Collateral Public Key
| 21 ....................................... Key Size: 33
| 02 ....................................... Key Type: 2 - Compressed (even)
| 02a47a6845936a4199e126d35399dd09
| 97c1aaf89a3fe70d474c53f29624a43a5b ....... Public Key
Masternode Public Key
| 41 ....................................... Key Size: 65
| 04 ....................................... Key Type: 4 - Uncompressed
| 04da252243305d604cab90480880af4a
| b5cea3a934c91393452e9b7b4c97a87e
| 198bc809916ac2c27436a1db9c28d0aa
| bfefec4dc3c2193835fd9a56c31150c633 ....... Public Key
Message Signature
| 41 ....................................... Bytes in signature: 65
| 1fb80f9ba8c110835e4a7dd4c8deccd7
| 89027663d00084d9a99ef579a9b5601f
| 40727b27e91aab2897a078f63976ae25
| 3ff8f01e56862e953278f432530f6ee080 ....... Signature
4728ef5800000000 ........................... Sig. Timestamp: 2017-04-13 07:27:03 UTC
3e120100 ................................... Protocol Version: 70206
Masternode Ping Message
| Masternode Unspent Output
| | 3fbc7d4a8f68ba6ecb02a8db34d1f5b6
| | 2dc105f0b5c3505243435cf815d02394 ........ Outpoint TXID
| | 01000000 ................................ Outpoint index number: 1
| |
| | 00 ...................................... Bytes in sig. script: 0
| | ......................................... Secp256k1 signature: None
| |
| | ffffffff ................................ Sequence number: UINT32_MAX
|
| 94fc0fad18b166c2fedf1a5dc0511372
| 26c353d57e086737ff05000000000000 ......... Chaintip block hash
|
| 66c1a95900000000 ......................... Sig. Timestamp: 2017-10-01 21:21:58 UTC
|
| Masternode Signature
| | 41 ..................................... Bytes in signature: 65
| | 1b3017c49a03e2d77083f3c92a8c2e4c
| | d815d068b6256498a719e3cb6a34f774
| | ec6434cfcbb7a5a51704350a05903287
| | eecc82e6b40ac2fcfa2df29ddaa6c4fc
| | b8 ..................................... Masternode Signature
mnget
The mnget
message requests masternode payment sync. The response to an
mnget
message is mnw
message inventories (up to the number asked for in the
request). Masternodes ignore this request if they are not fully synced.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nMnCount | int | Required | Number of masternode payment votes to request |
Note: Dash Core limits how frequently a masternode payment sync can be
requested. Frequent requests will result in the node being banned.
The following annotated hexdump shows a mnget
message. (The
message header has been omitted.)
a8170000 ................................... Count: 6056
mnp
The mnp
message is sent by masternodes every few minutes to ping the network
with a message that propagates across the whole network. Dash Core currently
uses a minimum masternode ping time of 10 minutes.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41 | vin | txIn | Required | The unspent output of the masternode (holding 1000 DASH) which is signing the message |
32 | blockHash | uint256 | Required | Block hash from 12 blocks ago (current chaintip minus 12). This offset allows nodes to be slightly out of sync. |
8 | sigTime | int64_t | Required | Time which the signature was created |
66* | vchSig | char[] | Required | Signature of this message by masternode - verifiable via pubKeyMasternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) |
The following annotated hexdump shows a mnp
message. (The
message header has been omitted.)
Masternode Unspent Output
| 0bfa3616099771bb5f36181ff4060a9b
| 9afe7b3e47d7f4327800f0f8ce586c6e ......... Outpoint TXID
| 01000000 ................................. Outpoint index number: 1
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
a26a68ebb733192c1c40f9b42f872ac0
e23d4c360e20d5ab6608000000000000 ........... Chaintip block hash
1bbfa95900000000 ........................... Sig. Timestamp: 2017-10-01 20:12:11 UTC
Masternode Signature
| 41 ....................................... Bytes in signature: 65
| 1c2b205bd6ba472d7a9495f049ef66dc
| f844154846e25f2389385ba2d3e95cde
| cf3ccf82bc26d94c6fdafcd7b965bb61
| db02d05483595196ea4d92b2e797612b
| 79 ....................................... Masternode Signature
mnv
The mnv
message is used by masternodes to verify each other. Several mnv
messages are exchanged in the process. This results in the IP address of
masternode 1 being validated as of the provided block height.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41 | vin1 | txIn | Required | The unspent output which is holding 1000 DASH for masternode 1 |
41 | vin2 | txIn | Required | The unspent output which is holding 1000 DASH for masternode 2 |
# | addr | CService | Required | IPv4 address and port of masternode 1 |
4 | nonce | int | Required | Random nonce |
4 | nBlockHeight | int | Required | Block height |
66 | vchSig1 | char[] | Required* Added in Step 2 |
Signature of this message by masternode 1 - verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) |
66 | vchSig2 | char[] | Required* Added in Step 3 |
Signature of this message by masternode 2 - verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) |
Initially, vin1
, vin2
, vchSig1
and vchSig2
are empty. They are
updated as the exchange of messages between the masternodes occurs as detailed
in the table below.
Masternode Verify Data Flow
Step | MN 2 (Verifier) | Direction | MN 1 (Being verified) | Description |
Verification request | mnv message with no signatures |
|||
1 | mnv message |
→ | Contains addr , nonce , and nBlockHeight .Sent by SendVerifyRequest(). |
|
2 | ← | mnv message |
Add vchSig1 (signature of the IP address + nonce + hash of the requested block).Sent by SendVerifyReply(). |
|
3 | mnv message |
→ | Verify vchSig1 Add vin1 , vin2 , and vchSig2 (signature of the IP address + nonce + hash of the requested block + vin1 prevout + vin2 prevout) and relay message to peers if valid.Sent by ProcessVerifyReply(). |
Nodes receiving a relayed mnv
message (one in which vin1
, vin2
, vchSig1
and vchSig2
are already present) use it to update the PoSe ban score. If the
ban score reaches MASTERNODE_POSE_BAN_MAX_SCORE
(5), the masternode will be
considered malicious and banned. If the received message is valid, nodes
receiving it will relay it on to their connected peers.
Important Notes:
* Dash Core limits how frequently a masternode verify request can be
requested. Frequent requests will result in the node being banned.
* Only masternodes in the top `MAX_POSE_RANK` (10) can send an `mnv` request
(to no more than `MAX_POSE_CONNECTIONS` (10)).
The following annotated hexdump shows a mnv
message. This is an example of the
initial request (Step 1) so it does not contain any signatures. (The message
header has been omitted.)
Masternode 1 Unspent Output (empty)
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ......... Outpoint TXID
| ffffffff ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
Masternode 2 Unspent Output (empty)
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ......... Outpoint TXID
| ffffffff ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
00000000000000000000ffff2d20ed4c ........... IP Address: ::ffff:45.32.237.76
4e1f ....................................... Port: 19999
9d090000 ................................... Nonce: 2641
ed5c0000 ................................... Block height: 23789
Masternode 1 Signature
| 00 ....................................... Bytes in signature: 0
| .......................................... Signature: Empty
Masternode 2 Signature
| 00 ....................................... Bytes in signature: 0
| .......................................... Signature: Empty
The following annotated hexdump shows a mnv
message. This is an example of the
initial response (Step 2) so it only contains the signature of masternode 1 (the
masternode being verified). (The message header has been omitted.)
Masternode 1 Unspent Output (empty)
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ......... Outpoint TXID
| ffffffff ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
Masternode 2 Unspent Output (empty)
| 00000000000000000000000000000000
| 00000000000000000000000000000000 ......... Outpoint TXID
| ffffffff ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
00000000000000000000ffff2d20ed4c ........... IP Address: ::ffff:45.32.237.76
4e1f ....................................... Port: 19999
9d090000 ................................... Nonce: 2641
ed5c0000 ................................... Block height: 23789
Masternode 1 Signature
| 41 ....................................... Bytes in signature: 65
| 1bf5bd6e6eda0cd32aafb826c4066fa5
| 4a53baa6f4211528e51716054b4df981
| d97a77e633947bbbfafd6882324b76a0
| 90c6e65c16ca1222db48f8558537c062
| f6 ....................................... Signature
Masternode 2 Signature
| 00 ....................................... Bytes in signature: 0
| .......................................... Signature: Empty
mnw
The mnw
message is used to pick the next winning masternode. When a new block
is found on the network, a masternode quorum will be determined and those 10
selected masternodes will issue the masternode payment vote message.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41 | vin | txIn | Required | The unspent output which is holding 1000 DASH |
4 | nBlockHeight | int | Required | The blockheight which the payee should be paid |
? | payeeAddress | CScript | Required | The address receiving payment |
66* | vchSig | char[] | Required | Signature of the masternode which is signing the message (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) |
The following annotated hexdump shows a mnw
message. (The
message header has been omitted.)
Masternode Unspent Output
| 0c1b5c5846792b25b05eeea9586d8c34
| ecb996c566bedb4ecf6a68fe8ffa9582 ......... Outpoint TXID
| 00000000 ................................. Outpoint index number: 0
|
| 00 ....................................... Bytes in sig. script: 0
| .......................................... Secp256k1 signature: None
|
| ffffffff ................................. Sequence number: UINT32_MAX
fb4f0a00 ................................... Block pay height: 675835
Payee Address
| 19 ....................................... Address Length: 25
| | 76 ..................................... OP_DUP
| | a9 ..................................... OP_HASH160
| | 14 ..................................... Push 20 bytes as data
| | | 1767c363646be7d8e4475c0aa85ea454
| | | 9fd102c4 ............................. Pubkey hash
| | 88 ..................................... OP_EQUALVERIFY
| | ac ..................................... OP_CHECKSIG
Masternode Signature
| 41 ....................................... Bytes in signature: 65
| 1c25da47190a83937fb5ef607235703a
| 7cdda155bf5a1ae6139929024750f899
| a90a4f57cdf9d54c9d9603c1f31009f8
| e257355b49c0484fb4c31bc412c73dd9
| 20 ....................................... Signature
mnwb
There is no message for mnwb
(inv
message only).
The following annotated hexdump shows an inv
message with a mnwb
inventory entry. (The message header has been omitted.)
01 ................................. Count: 1
08000000 ........................... Type: MSG_MASTERNODE_PAYMENT_BLOCK (8)
dd6cc6c11211793b239c2e311f1496e2
2281b200b35233eaae465d2aa3c9d537 ... Hash: mnwb
ssc
The ssc
message is used to track the sync status of masternode objects. This
message is sent in response to sync requests for the list of masternodes
(dseg
message), masternode payments (mnget
message), governance objects
(govsync
message), and governance object votes (govsync
message).
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
4 | nItemID | int | Required | Masternode Sync Item ID |
4 | nCount | int | Required | Number of items to sync |
Sync Item IDs
ID | Description | Response To |
---|---|---|
2 | MASTERNODE_SYNC_LIST | dseg message |
3 | MASTERNODE_SYNC_MNW | mnget message |
10 | MASTERNODE_SYNC_GOVOBJ | govsync message |
11 | MASTERNODE_SYNC_GOVOBJ_VOTE | govsync message with non-zero hash |
The following annotated hexdump shows a ssc
message. (The
message header has been omitted.)
02000000 ................................... Item ID: MASTERNODE_SYNC_LIST (2)
bf110000 ................................... Count: 4543
Governance Messages
The following network messages enable the Governance features built in to Dash. For additional details on the governance system, see this Budget System page.
For additional details, refer to the Developer Guide Governance section.
govobj
The govobj
message contains a governance object that is generally a proposal,
contract, or setting. Masternodes ignore this request if they are not fully synced.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
32 | nHashParent | uint256 | Required | Parent object (a hash of all zeros here indicates this is the root object, not a child object). |
4 | nRevision | int | Required | Object revision in the system |
8 | nTime | int64_t | Required | Time which this object was created |
32 | nCollateralHash | uint256 | Required* | Hash of the collateral fee transaction for proposals. Set to all zeros for Triggers/Watchdogs. |
0-16384 | strData | string | Required | Data field - can be used for anything (leading varint indicates size of data) |
4 | nObjectType | int | Required | Type of governance object: • 0 - Unknown• 1 - Proposal• 2 - Trigger• 3 - Watchdog |
41 | vinMasternode | CTxIn | Required* | Unspent output for the masternode which is signing this object. Set to all zeros for proposals since they can be created by non-masternodes. |
66* | vchSig | char[] | Required* | Signature of the masternode (Length (1 byte) + Signature (65 bytes)) Not required for proposals - they will have a length of 0x00 and no Signature. |
Governance Object Types (defined by src/governance-object.h)
Type | Name | Description |
---|---|---|
0 | GOVERNANCE_OBJECT_UNKNOWN |
|
1 | GOVERNANCE_OBJECT_PROPOSAL |
Submitted proposal (requires collateral transaction - currently 5 Dash) |
2 | GOVERNANCE_OBJECT_TRIGGER |
Masternode generated. Removed after activation/execution. Used for superblocks. |
3 | GOVERNANCE_OBJECT_WATCHDOG |
Masternode generated. Two hour expiration time. DEPRECATED since 12.2. |
The following annotated hexdump shows a govobj
message for a Proposal object.
Notice the presence of a non-zero collateral hash, a vinMasternode that is an
empty CTxIn (hash of all zeros, index/sequence of 0xffffffff, no Signature),
and no vchSig.
(The message header has been omitted.)
00000000000000000000000000000000
00000000000000000000000000000000 ..... Parent Hash (0 = root)
01000000 ............................. Revision: 1
c8dfd65900000000 ..................... Create timestamp: 2017-10-06 01:43:31 UTC
633611d2f3e7481325242f200c7f3485
e3a9b4b6301e7f7d18d87d8231f3880b ..... Collateral Hash
Data
| 3e02 ............................... Data length: 574
| 356235623232373 ... 376435643564 ... Data (truncated)
01000000 ............................. Object Type: GOVERNANCE_OBJECT_PROPOSAL (1)
Transaction input
| Previous Output
| | 00000000000000000000000000000000
| | 00000000000000000000000000000000 ... Outpoint TXID
| | ffffffff ........................... Outpoint index number: 0
| 00 ................................... Script length: 0
| ...................................... Signature: None
| ffffffff ............................. Sequence
00 ................................... Signature length: 0
| .................................... Masternode Signature (None required)
The following annotated hexdump shows a govobj
message for a Trigger object.
Notice the collateral hash of all zeros.
(The message header has been omitted.)
00000000000000000000000000000000
00000000000000000000000000000000 ..... Parent Hash (0 = root)
01000000 ............................. Revision: 1
911ea85900000000 ..................... Create timestamp: 2017-08-31 14:34:57 UTC
00000000000000000000000000000000
00000000000000000000000000000000 ..... Collateral Hash (None required)
Data
| ae11 ............................... Data length: 4526
| fdae11356235623 ... 376435643564 ... Data (truncated)
02000000 ............................. Object Type: GOVERNANCE_OBJECT_TRIGGER (2)
Transaction input
| Previous Output
| | ffefbe4959085907bcd2ba29e357a441
| | fa7b6e26e25896d8127332bba2419e97 ... Outpoint TXID
| | 00000000 ........................... Outpoint index number: 0
| 00 ................................... Script length: 0
| ...................................... Signature: None
| ffffffff ............................. Sequence
41 ................................... Signature length: 65
1ce3b782f66be8ae9fc4158680128864
341202b6006384083ab2d9cfa73795e2
6000668e84af4ef6a284a52b53843524
72037d51bd9079ffd5c087d9632865ee
75 ................................... Masternode Signature
govobjvote
The govobjvote
message is used to indicate the voting status of a governance
object. Voting status is comprised of the vote outcome (how the masternode
voted) and the vote signal (the network support status). A sufficient number of
yes votes results in the proposed funding being payed out in the next
superblock (assuming their are sufficient funds available in the budget).
The initial govobjvote
message is created by a masternode to vote on a
governance object (proposal, etc.). When the masternode votes, it broadcasts
the govobjvote
message to all its peers.
When a node receives a valid, new govobjvote
message, it relays the message
to all its connected peers to propagate the vote.
Additionally, nodes can request govobjvote
messages for specific governance
objects via a govsync
message. Masternodes ignore requests for votes if they
are not fully synced.
Dash Core limits how frequently a masternode can vote on a governance object.
A masternode's vote will not be processed if it has been less than 60 minutes
since its last vote on that object. Additionally, invalid votes can result in
the node being banned.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
41+ | vinMasternode | CTxIn | Required | Unspent output for the masternode which is voting |
32 | nParentHash | uint256 | Required | Object (govobj ) being voted on (proposal, contract, setting or final budget) |
4 | nVoteOutcome | int | Required | None (0), Yes (1), No (2), Abstain (3) |
4 | nVoteSignal | int | Required | None (0), Funding (1), Valid (2), Delete (3), Endorsed (4) |
8 | nTime | int64_t | Required | Time the vote was created |
66* | vchSig | char[] | Required | Signature of the masternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) |
Governance Object Vote Signals (defined by src/governance-object.h)
Value | Name | Description |
---|---|---|
1 | Funding | Minimum network support has been reached for this object to be funded (doesn’t mean it will for sure though) |
2 | Valid | Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc.) |
3 | Delete | Minimum network support has been reached saying this object should be deleted from the system entirely |
4 | Endorsed | Minimum network support has been reached flagging this object as endorsed by an elected representative body |
The following annotated hexdump shows a govobjvote
message. (The
message header has been omitted.)
Transaction input
| Previous Output
| | 57566a0ef85e6cac3415ced67b0b07e1
| | 781bafb853650d7c9d56d8bc132cc3b4 ... Outpoint TXID
| | 00000000 ........................... Outpoint index number: 0
| 00 ................................... Script length: 0
| ...................................... Signature: None
| ffffffff ............................. Sequence
ad9579d5c181eee904156df1c88b050f
b8b4d39e5fda71f015996dbf14a51bff...... Parent Hash (0 = root)
01000000 ............................. Vote Outcome: VOTE_OUTCOME_NONE (1)
02000000 ............................. Vote Signal: VOTE_SIGNAL_VALID (2)
b517a85900000000 ..................... Vote Create Timestamp: 2017-08-31 14:05:41 UTC
00000000000000000000000000000000 ..... Collateral Hash
1b049113a81fe913f061ad295561d267
00b8135a021ab0356a1e89b18d663d0b
dc45e9c09ee0427223e332b52e8d709e
6d64e86b6435d7bdf207d8f23b6ae0db
6f ................................... Masternode Signature
govsync
The govsync
message is used to request syncing of governance objects
(govobj
message and govobjvote
message) with peers. Masternodes ignore this
request if they are not fully synced.
This message responds in one of two ways depending on the request:
-
Object Sync - When a masternode receives a
govsync
message with a hash of all zeros, it responds with onessc
message forgovobj
objects and one forgovobjvote
objects. The masternode also sends aninv
message (MSG_GOVERNANCE_OBJECT - 0x17) for all validgovobj
governance objects. Governance object votes are excluded in this type of response. -
Vote Sync - When a masternode receives a
govsync
message with a specific hash, it responds with onessc
message forgovobj
objects and one forgovobjvote
objects. The masternode also sends both agovobj
inventory message (MSG_GOVERNANCE_OBJECT - 0x17) andgovobjvote
inventory messages (MSG_GOVERNANCE_OBJECT_VOTE - 0x18) for the single governance object requested.
Bytes | Name | Data type | Required | Description |
---|---|---|---|---|
32 | nHash | uint256 | Required | Hash of governance object to request Set to all zeros to request all objects (excludes votes) |
# | filter | CBloomFilter | Required | Can be set to all zeros. Only supported since protocol version 70206 |
Dash Core limits how frequently the first type of sync (object sync) can be
requested. Frequent requests will result in the node being banned.
The following annotated hexdump shows a govsync
message. (The
message header has been omitted.)
2e46ea5418e097a3dbcccbee3cf2a911
6fb94ba635153f276dcb2123efcb73ff ..... Hash
00000000000000000000 ................. Bloom Filter
Deprecated Messages
The following network messages have been deprecated and should no longer be used.
mnvs
Masternode Budget Sync - Deprecated since 12.1
mvote
Masternode Budget Vote - Deprecated since 12.1
mprop
Masternode Budget Proposal - Deprecated since 12.1
fbs
Masternode Budget Final - Deprecated since 12.1
fbvote
Masternode Budget Final Vote - Deprecated since 12.1
mn quorum
Not Implemented
Improvement Proposals
Dash (DIPs)
Similar to Bitcoin’s BIPs, a Dash Improvement Proposal (DIP) is a design document for providing information to the Dash community, or describing a new feature for Dash processes/environment. The DIP should provide a concise technical specification of the feature and a rationale for the feature.
DIP Summary Table
Information from Dash DIP repository.
Number | Layer | Title | Type | Status |
---|---|---|---|---|
1 | Consensus | Initial Scaling of the Network | Standard | Active |
Bitcoin (BIPs)
A Bitcoin Improvement Proposal (BIP) is a design document providing information to the Bitcoin community, or describing a new feature for Bitcoin or its processes or environment.
Since Dash is forked from Bitcoin, some BIPs are applicable to both. The following
table provides a list of the BIPs that are relevant to Dash. Some BIPs may only
be partially implemented or modified to meet Dash requirements. The Dash Status
column indicates if any changes were made.
BIP Summary Table
Dash-specific BIP information derived from Dash developer QuantumExplorer’s BIP repository.
* These BIPs are not Bitcoin or Dash specific (i.e. BIP-0044 Multi-Account Hierarchy for Deterministic Wallets). Generally relates to the Application Layer and not specifically the reference client.
Dash Core APIs
Hash Byte Order
Dash Core RPCs accept and return the byte-wise reverse of computed
SHA-256 hash values. For example, the Unix sha256sum
command displays the
SHA256(SHA256()) hash of mainnet block 300,000’s header as:
> /bin/echo -n '020000007ef055e1674d2e6551dba41cd214debbee34aeb544c7ec670000000000000000d3998963f80c5bab43fe8c26228e98d030edf4dcbe48a666f5c39e2d7a885c9102c86d536c890019593a470d' | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b
5472ac8b1187bfcf91d6d218bbda1eb2405d7c55f1f8cc820000000000000000
The result above is also how the hash appears in the previous-header-hash part of block 300,001’s header:
020000005472ac8b1187bfcf91d6d218bbda1eb2405d7c55f1f8cc82000\ 0000000000000ab0aaa377ca3f49b1545e2ae6b0667a08f42e72d8c24ae\ 237140e28f14f3bb7c6bcc6d536c890019edd83ccf
However, Dash Core’s RPCs use the byte-wise reverse for hashes, so if you
want to get information about block 675,776 using the getblock
RPC,
you need to reverse the requested hash:
> dash-cli getblock \
000000000000327a66cd1011b2d1defd1417b7d9e39b439e8e67ba996ee92602
(Note: hex representation uses two characters to display each byte of data, which is why the reversed string looks somewhat mangled.)
The rationale for the reversal is unknown, but it likely stems from Dash Core’s use of hashes (which are byte arrays in C++) as integers for the purpose of determining whether the hash is below the network target. Whatever the reason for reversing header hashes, the reversal also extends to other hashes used in RPCs, such as TXIDs and merkle roots.
As header hashes and TXIDs are widely used as global identifiers in other Dash software, this reversal of hashes has become the standard way to refer to certain objects. The table below should make clear where each byte order is used.
Data | Internal Byte Order | RPC Byte Order |
---|---|---|
Example: SHA256(SHA256(0x00)) | Hash: 1406…539a | Hash: 9a53…0614 |
Header Hashes: SHA256(SHA256(block header)) | Used when constructing block headers | Used by RPCs such as getblock ; widely used in block explorers |
Merkle Roots: SHA256(SHA256(TXIDs and merkle rows)) | Used when constructing block headers | Returned by RPCs such as getblock |
TXIDs: SHA256(SHA256(transaction)) | Used in transaction inputs | Used by RPCs such as gettransaction and transaction data parts of getblock ; widely used in wallet programs |
P2PKH Hashes: RIPEMD160(SHA256(pubkey)) | Used in both addresses and pubkey scripts | N/A: RPCs use addresses which use internal byte order |
P2SH Hashes: RIPEMD160(SHA256(redeem script)) | Used in both addresses and pubkey scripts | N/A: RPCs use addresses which use internal byte order |
Note: RPCs which return raw results, such as getrawtransaction
or the
raw mode of getblock
, always display hashes as they appear in blocks
(internal byte order).
The code below may help you check byte order by generating hashes from raw hex.
#!/usr/bin/env python
from sys import byteorder
from hashlib import sha256
## You can put in $data an 80-byte block header to get its header hash,
## or a raw transaction to get its txid
data = "00".decode("hex")
hash = sha256(sha256(data).digest()).digest()
print "Warning: this code only tested on a little-endian x86_64 arch"
print
print "System byte order:", byteorder
print "Internal-Byte-Order Hash: ", hash.encode('hex_codec')
print "RPC-Byte-Order Hash: ", hash[::-1].encode('hex_codec')
Remote Procedure Calls (RPCs)
Dash Core provides a remote procedure call (RPC) interface for various administrative tasks, wallet operations, and queries about network and block chain data.
If you start Dash Core using dash-qt
, the RPC interface is disabled by
default. To enable it, set server=1
in dash.conf
or supply the -server
argument when invoking the program. If you start Dash Core using dashd
,
the RPC interface is enabled by default.
The interface requires the user to provide a password for authenticating RPC
requests. This password can be set either using the rpcpassword
property in
dash.conf
or by supplying the -rpcpassword
program argument. Optionally a
username can be set using the rpcuser
configuration value. See the Examples
Page for more information about setting Dash Core configuration
values.
Open-source client libraries for the RPC interface are readily available in most
modern programming languages, so you probably don’t need to write your own from
scratch. Dash Core also ships with its own compiled C++ RPC client,
dash-cli
, located in the bin
directory alongside dashd
and
dash-qt
. The dash-cli
program can be used as a command-line interface
(CLI) to Dash Core or for making RPC calls from applications written in
languages lacking a suitable native client. The remainder of this section
describes the Dash Core RPC protocol in detail.
The Dash Core RPC service listens for HTTP POST
requests on port 9998 in
mainnet mode, 19998 in testnet, or 18332 in regtest mode. The port number can be changed
by setting rpcport
in dash.conf
. By default the RPC service binds to your
server’s localhost loopback
network interface so it’s not accessible from other servers.
Authentication is implemented using HTTP basic
authentication. RPC
HTTP requests must include a Content-Type
header set to text/plain
and a
Content-Length
header set to the size of the request body.
The format of the request body and response data is based on version 1.0 of the
JSON-RPC specification. Specifically,
the HTTP POST
data of a request must be a JSON object with the following
format:
Name | Type | Presence | Description |
---|---|---|---|
Request | object | Required (exactly 1) |
The JSON-RPC request object |
→ jsonrpc |
number (real) | Optional (0 or 1) |
Version indicator for the JSON-RPC request. Currently ignored by Dash Core. |
→ id |
string | Optional (0 or 1) |
An arbitrary string that will be returned with the response. May be omitted or set to an empty string (“”) |
→ method |
string | Required (exactly 1) |
The RPC method name (e.g. getblock ). See the RPC section for a list of available methods. |
→ params |
array | Optional (0 or 1) |
An array containing positional parameter values for the RPC. May be an empty array or omitted for RPC calls that don’t have any required parameters. |
→ → Parameter |
any | Optional (0 or more) |
A parameter. May be any JSON type allowed by the particular RPC method |
In the table above and in other tables describing RPC input and output, we use the following conventions
-
“→” indicates an argument that is the child of a JSON array or JSON object. For example, “→ → Parameter” above means Parameter is the child of the
params
array which itself is a child of the Request object. -
Plain-text names like “Request” are unnamed in the actual JSON object
-
Code-style names like
params
are literal strings that appear in the JSON object. -
“Type” is the JSON data type and the specific Dash Core type.
-
“Presence” indicates whether or not a field must be present within its containing array or object. Note that an optional object may still have required children.
The HTTP response data for a RPC request is a JSON object with the following format:
Name | Type | Presence | Description |
---|---|---|---|
Response | object | Required (exactly 1) |
The JSON-RPC response object. |
→ result |
any | Required (exactly 1) |
The RPC output whose type varies by call. Has value null if an error occurred. |
→ error |
null/object | Required (exactly 1) |
An object describing the error if one occurred, otherwise null . |
→ → code |
number (int) | Required (exactly 1) |
The error code returned by the RPC function call. See rpcprotocol.h for a full list of error codes and their meanings. |
→ → message |
string | Required (exactly 1) |
A text description of the error. May be an empty string (“”). |
→ id |
string | Required (exactly 1) |
The value of id provided with the request. Has value null if the id field was omitted in the request. |
As an example, here is the JSON-RPC request object for the hash of the genesis block:
{
"method": "getblockhash",
"params": [0],
"id": "foo"
}
The command to send this request using dash-cli
is:
dash-cli getblockhash 0
Alternatively, we could POST
this request using the cURL command-line program
as follows:
curl --user 'my_username:my_secret_password' --data-binary '''
{
"method": "getblockhash",
"params": [0],
"id": "foo"
}''' \
--header 'Content-Type: text/plain;' localhost:9998
The HTTP response data for this request would be:
{
"result": "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6",
"error": null,
"id": "foo"
}
Note: In order to minimize its size, the raw JSON response from Dash Core
doesn’t include any extraneous whitespace characters. Here we’ve added
whitespace to make the object more readable. Speaking of which, dash-cli
also transforms the raw response to make it more human-readable. It:
- Adds whitespace indentation to JSON objects
- Expands escaped newline characters (“\n”) into actual newlines
- Returns only the value of the
result
field if there’s no error - Strips the outer double-quotes around
result
s of type string - Returns only the
error
field if there’s an error
Continuing with the example above, the output from the dash-cli
command would be simply:
00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6
If there’s an error processing a request, Dash Core sets the result
field
to null
and provides information about the error in the error
field. For
example, a request for the block hash at block height -1 would be met with the
following response (again, whitespace added for clarity):
{
"result": null,
"error": {
"code": -8,
"message": "Block height out of range"
},
"id": "foo"
}
If dash-cli
encounters an error, it exits with a non-zero status code and
outputs the error
field as text to the process’s standard error
stream:
error code: -8
error message:
Block height out of range
The RPC interface supports request
batching as described in version 2.0 of the JSON-RPC
specification. To initiate multiple
RPC requests within a single HTTP request, a client can POST
a JSON array
filled with Request objects. The HTTP response data is then a JSON array filled
with the corresponding Response objects. Depending on your usage pattern,
request batching may provide significant performance gains. The dash-cli
RPC client does not support batch requests.
curl --user 'my_username:my_secret_password' --data-binary '''
[
{
"method": "getblockhash",
"params": [0],
"id": "foo"
},
{
"method": "getblockhash",
"params": [1],
"id": "foo2"
}
]''' \
--header 'Content-Type: text/plain;' localhost:9998
To keep this documentation compact and readable, the examples for each of the
available RPC calls will be given as dash-cli
commands:
dash-cli [options] <method name> <param1> <param2> ...
This translates into an JSON-RPC Request object of the form:
{
"method": "<method name>",
"params": [ "<param1>", "<param2>", "..." ],
"id": "foo"
}
Warning: if you write
programs using the JSON-RPC interface, you must ensure they handle high-precision
real numbers correctly. See the Proper Money Handling
Bitcoin Wiki article for details and example code.
Quick Reference
RPC Summary Table
Type part of the Name or Type of an RPC to filter the list:
Addressindex RPCs
These RPCs are all Dash-specific and not found in Bitcoin Core
- GetAddressBalance: returns the balance for address(es).
- GetAddressDeltas: returns all changes for an address.
- GetAddressMempool: returns all mempool deltas for an address.
- GetAddressTxids: returns the txids for an address(es).
- GetAddressUtxos: returns all unspent outputs for an address.
Block Chain RPCs
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. Updated in Bitcoin Core 0.13.0
- GetBlockChainInfo: provides information about the current state of the block chain. Updated in Bitcoin Core 0.12.1
- GetBlockCount: returns the number of blocks in the local best block chain.
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBlockHashes: returns array of hashes of blocks within the timestamp range provided (requires
timestampindex
to be enabled). New in Dash Core 0.12.1 - GetBlockHeader: gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header. New in Bitcoin Core 0.12.0
- GetBlockHeaders: returns an array of items with information about the requested number of blockheaders starting from the requested hash. New in Dash Core 0.12.1
- GetChainTips: returns information about the highest-height block (tip) of each local block chain. Updated in Dash Core 0.12.1
- GetDifficulty: returns the proof-of-work difficulty as a multiple of the minimum difficulty.
- GetMemPoolInfo: returns information about the node’s current transaction memory pool. Updated in Bitcoin Core 0.12.0
- GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object. Updated in Bitcoin Core 0.13.0
- GetSpentInfo: returns the txid and index where an output is spent (requires
spentindex
to be enabled). New in Dash Core 0.12.1 - GetTxOut: returns details about an unspent transaction output (UTXO).
- GetTxOutProof: returns a hex-encoded proof that one or more specified transactions were included in a block. New in Bitcoin Core 0.11.0
- 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.
- VerifyChain: verifies each entry in the local block chain database.
- VerifyTxOutProof: verifies that a proof points to one or more transactions in a block, returning the transactions the proof commits to and throwing an RPC error if the block is not in our best block chain. New in Bitcoin Core 0.11.0
Not implemented in Dash
- Not Implemented GetMemPoolAncestors: returns all in-mempool ancestors for a transaction in the mempool. New in Bitcoin Core 0.13.0
- Not Implemented GetMemPoolDescendants: returns all in-mempool descendants for a transaction in the mempool. New in Bitcoin Core 0.13.0
- Not Implemented GetMemPoolEntry: returns mempool data for given transaction (must be in mempool). New in Bitcoin Core 0.13.0
- Not Implemented PreciousBlock: treats a block as if it were received before others with the same work. New in Bitcoin Core 0.14.0
- Not Implemented PruneBlockChain: prunes the blockchain up to a specified height or timestamp. New in Bitcoin Core 0.14.0
Control RPCs
- Debug: changes the debug category from the console.
- GetInfo: prints various information about the node and the network. Deprecated
- Help: lists all available public RPC commands, or gets help for the specified RPC. Commands which are unavailable will not be listed, such as wallet RPCs if wallet support is disabled.
- Stop: safely shuts down the Dash Core server.
Dash RPCs
- GetGovernanceInfo: returns an object containing governance parameters.
- GetPoolInfo: returns an object containing mixing pool related information.
- GetSuperblockBudget: returns the absolute maximum sum of superblock payments allowed.
- GObject: provides a set of commands for managing governance objects and displaying information about them.
- Masternode: provides a set of commands for managing masternodes and displaying information about them.
- MasternodeBroadcast: provides a set of commands to create and relay masternode broadcast messages.
- MasternodeList: returns a list of masternodes in different modes.
- MnSync: returns the sync status, updates to the next step or resets it entirely.
- PrivateSend: controls the mixing process.
- SentinelPing: sends a Sentinel Ping to the network.
- Spork: reads or updates spork settings on the network.
- VoteRaw: compiles and relays a governance vote with provided external signature instead of signing vote internally
Generating RPCs
- Generate: mines blocks immediately (before the RPC call returns). New in Bitcoin Core 0.11.0, Updated in Bitcoin Core 0.13.0
- GetGenerate: returns if the server is set to generate coins or not.
- SetGenerate: enables or disables hashing to attempt to find the next block.
- Not Implemented GenerateToAddress: mines blocks immediately to a specified address. New in Bitcoin Core 0.13.0
Mining RPCs
- GetBlockTemplate: gets a block template or proposal for use with mining software.
- GetMiningInfo: returns various mining-related information. Updated in Bitcoin Core 0.14.0
- GetNetworkHashPS: returns the estimated network hashes per second based on the last n blocks.
- PrioritiseTransaction: adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)
- SubmitBlock: accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs.
Network RPCs
- AddNode: attempts to add or remove a node from the addnode list, or to try a connection to a node once. Updated in Bitcoin Core 0.14.0
- ClearBanned: clears list of banned nodes. New in Bitcoin Core 0.12.0
- DisconnectNode: immediately disconnects from a specified node. New in Bitcoin Core 0.12.0
- GetAddedNodeInfo: returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the
addnode
RPC will have their information displayed. Updated in Bitcoin Core 0.14.0 - GetConnectionCount: returns the number of connections to other nodes.
- GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time. Updated in Bitcoin Core 0.12.0
- GetNetworkInfo: returns information about the node’s connection to the network. Updated in Bitcoin Core 0.13.0
- GetPeerInfo: returns data about each connected network node. Updated in Bitcoin Core 0.13.0
- ListBanned: lists all banned IPs/Subnets. New in Bitcoin Core 0.12.0
- Ping: sends a P2P ping message to all connected nodes to measure ping time. Results are provided by the
getpeerinfo
RPC pingtime and pingwait fields as decimal seconds. The P2Pping
message is handled in a queue with all other commands, so it measures processing backlog, not just network ping. - SetBan: attempts add or remove a IP/Subnet from the banned list. New in Bitcoin Core 0.12.0
- SetNetworkActive: disables/enables all P2P network activity. New in Bitcoin Core 0.14.0
Raw Transaction RPCs
- 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.
- DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction. Updated in Bitcoin Core 0.13.0
- DecodeScript: decodes a hex-encoded P2SH redeem script.
- FundRawTransaction: adds inputs to a transaction until it has enough in value to meet its out value. New in Bitcoin Core 0.12.0, Updated in Bitcoin Core 0.14.0
- 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 Bitcoin Core 0.14.0 - SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
- SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
Utility RPCs
- CreateMultiSig: creates a P2SH multi-signature address.
- EstimateFee: estimates the transaction fee per kilobyte that needs to be paid for a transaction to begin confirmation within a certain number of blocks.
- EstimatePriority: estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.
- EstimateSmartFee: estimates the transaction fee per kilobyte that needs to be paid for a transaction to begin confirmation within a certain number of blocks and returns the number of blocks for which the estimate is valid. Deprecated
- EstimateSmartPriority: estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction and returns the number of blocks for which the estimate is valid. Deprecated
- ValidateAddress: returns information about the given Dash address. Updated in Bitcoin Core 0.13.0
-
VerifyMessage: verifies a signed message.
- Not Implemented GetMemoryInfo: returns information about memory usage.
Wallet RPCs
Note: the wallet RPCs are only available if Dash Core was built with wallet support, which is the default.
- AbandonTransaction: marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent. New in Bitcoin Core 0.12.0
- AddMultiSigAddress: adds a P2SH multisig address to the wallet.
- BackupWallet: safely copies
wallet.dat
to the specified file, which can be a directory or a path with filename. - DumpHDInfo: returns an object containing sensitive private info about this HD wallet New in Dash Core 0.12.2
- DumpPrivKey: returns the wallet-import-format (WIP) private key corresponding to an address. (But does not remove it from the wallet.)
- DumpWallet: creates or overwrites a file with all wallet keys in a human-readable format.
- EncryptWallet: encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.
- GetAccount: returns the name of the account associated with the given address. Deprecated
- GetAccountAddress: returns the current Dash address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address. Deprecated
- GetAddressesByAccount: returns a list of every address assigned to a particular account. Deprecated
- GetBalance: gets the balance in decimal dash across all accounts or for a particular account.
- GetNewAddress: returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
- GetRawChangeAddress: returns a new Dash address for receiving change. This is for use with raw transactions, not normal use.
- GetReceivedByAccount: returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions. Deprecated
- GetReceivedByAddress: returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetTransaction: gets detailed information about an in-wallet transaction. Updated in Bitcoin Core 0.12.0
- GetUnconfirmedBalance: returns the wallet’s total unconfirmed balance.
- GetWalletInfo: provides information about the wallet.
- 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.
- ImportElectrumWallet: imports keys from an Electrum wallet export file (.csv or .json) New in Dash Core 0.12.1
- ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the
dumpprivkey
RPC. - ImportPubKey: imports a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend
- ImportWallet: imports private keys from a file in wallet dump file format (see the
dumpwallet
RPC). 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. - InstantSendToAddress: InstantSend an amount to a given address.
- KeePass: provides commands for configuring and managing KeePass authentication New in Darkcoin Core 0.11.0
- KeyPoolRefill: fills the cache of unused pre-generated keys (the keypool).
- ListAccounts: lists accounts and their balances. Deprecated
- 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.
- ListLockUnspent: returns a list of temporarily unspendable (locked) outputs.
- ListReceivedByAccount: lists the total number of dash received by each account. Deprecated
- ListReceivedByAddress: lists the total number of dash received by each address.
- ListSinceBlock: gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.
- ListTransactions: returns the most recent transactions that affect the wallet. Updated in Bitcoin Core 0.12.1
- ListUnspent: returns an array of unspent transaction outputs belonging to this wallet. Updated in Bitcoin Core 0.13.0
- LockUnspent: temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails.
- Move: moves a specified amount from one account in your wallet to another using an off-block-chain transaction. Deprecated
- SendFrom: spends an amount from a local account to a dash address. Deprecated
- SendMany: creates and broadcasts a transaction which sends outputs to multiple addresses.
- SendToAddress: spends an amount to a given address.
- SetAccount: puts the specified address in the given account. Deprecated
- SetTxFee: sets the transaction fee per kilobyte paid by transactions created by this wallet.
- SignMessage: signs a message with the private key of an address.
- WalletLock: removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call
walletpassphrase
again before being able to call any methods which require the wallet to be unlocked. - WalletPassphrase: stores the wallet decryption key in memory for the indicated number of seconds. Issuing the
walletpassphrase
command while the wallet is already unlocked will set a new unlock time that overrides the old one. -
WalletPassphraseChange: changes the wallet passphrase from ‘old passphrase’ to ‘new passphrase’.
- Not Implemented AddWitnessAddress: adds a witness address for a script (with pubkey or redeem script known). New in Bitcoin Core 0.13.0
- Not Implemented BumpFee: replaces an unconfirmed wallet transaction that signaled RBF with a new transaction that pays a higher fee. New in Bitcoin Core 0.14.0
- Not Implemented ImportMulti: imports addresses or scripts (with private keys, public keys, or P2SH redeem scripts) and optionally performs the minimum necessary rescan for all imports. New in Bitcoin Core 0.14.0
- Not Implemented ImportPrunedFunds: imports funds without the need of a rescan. Meant for use with pruned wallets. New in Bitcoin Core 0.13.0
- Not Implemented RemovePrunedFunds: deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. New in Bitcoin Core 0.13.0
- Not Implemented SignMessageWithPrivKey: signs a message with a given private key. New in Bitcoin Core 0.13.0
Removed RPCs
- GetHashesPerSec: was removed in Bitcoin Core 0.11.0 and is not part of Dash.
- GetWork: was removed in Bitcoin Core 0.10.0. and is not part of Dash
RPCs
Warning: the block chain and memory pool can include arbitrary data
which several of the commands below will return in hex format. If you
convert this data to another format in an executable context, it could
be used in an exploit. For example, displaying a pubkey script as
ASCII text in a webpage could add arbitrary Javascript to that page and
create a cross-site scripting (XSS) exploit. To avoid problems, please
treat block chain and memory pool data as an arbitrary input from an
untrusted source.
AbandonTransaction
Added in Bitcoin Core 0.12.0
The abandontransaction
RPC marks an in-wallet transaction and all its in-wallet descendants as abandoned. This allows their inputs to be respent.
Parameter #1—a transaction identifier (TXID)
Name | Type | Presence | Description |
---|---|---|---|
TXID | string (hex) | Required (exactly 1) |
The TXID of the transaction that you want to abandon. The TXID must be encoded as hex in RPC byte order |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
JSON null when the transaction and all descendants were abandoned |
Example from Dash Core 0.12.2
Abandons the transaction on your node.
dash-cli abandontransaction fa3970c341c9f5de6ab13f128cbfec58d732e736a505fe32137ad551c799ecc4
Result (no output from dash-cli
because result is set to null
).
See also
- SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
AddMultiSigAddress
Requires wallet support.
The addmultisigaddress
RPC adds a P2SH multisig address to the wallet.
Parameter #1—the number of signatures required
Name | Type | Presence | Description |
---|---|---|---|
Required | number (int) | Required (exactly 1) |
The minimum (m) number of signatures required to spend this m-of-n multisig script |
Parameter #2—the full public keys, or addresses for known public keys
Name | Type | Presence | Description |
---|---|---|---|
Keys Or Addresses | array | Required (exactly 1) |
An array of strings with each string being a public key or address |
→ Key Or Address |
string | Required (1 or more) |
A public key against which signatures will be checked. Alternatively, this may be a P2PKH address belonging to the wallet—the corresponding public key will be substituted. There must be at least as many keys as specified by the Required parameter, and there may be more keys |
Parameter #3—the account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Optional (0 or 1) |
The account name in which the address should be stored. Default is the default account, “” (an empty string) |
Result—a P2SH address printed and stored in the wallet
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base58) | Required (exactly 1) |
The P2SH multisig address. The address will also be added to the wallet, and outputs paying that address will be tracked by the wallet |
Example from Dash Core 0.12.2
Adding a 2-of-3 P2SH multisig address to the “test account” by mixing two P2PKH addresses and one full public key:
dash-cli -testnet addmultisigaddress 2 '''
[
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88",
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
]
''' \
'test account'
Result:
8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW
(New P2SH multisig address also stored in wallet.)
See also
- CreateMultiSig: creates a P2SH multi-signature address.
- DecodeScript: decodes a hex-encoded P2SH redeem script.
- Pay-To-Script-Hash (P2SH)
AddNode
The addnode
RPC attempts to add or remove a node from the addnode list, or to try a connection to a node once.
Parameter #1—hostname/IP address and port of node to add or remove
Name | Type | Presence | Description |
---|---|---|---|
node |
string | Required (exactly 1) |
The node to add as a string in the form of <IP address>:<port> . |
Parameter #2—whether to add or remove the node, or to try only once to connect
Name | Type | Presence | Description |
---|---|---|---|
command |
string | Required (exactly 1) |
What to do with the IP address above. Options are: • add to add a node to the addnode list. Up to 8 nodes can be added additional to the default 8 nodes. Not limited by -maxconnections • remove to remove a node from the list. If currently connected, this will disconnect immediately• onetry to immediately attempt connection to the node even if the outgoing connection slots are full; this will only attempt the connection once |
Result—null
plus error on failed remove
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always JSON null whether the node was added, removed, tried-and-connected, or tried-and-not-connected. The JSON-RPC error field will be set only if you try adding a node that was already added or removing a node that is not on the addnodes list |
Example from Dash Core 0.12.2
Try connecting to the following node.
dash-cli -testnet addnode 192.0.2.113:19999 onetry
Result (no output from dash-cli
because result is set to null
).
See also
- GetAddedNodeInfo: returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the
addnode
RPC will have their information displayed.
AddWitnessAddress
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
BackupWallet
Requires wallet support.
The backupwallet
RPC safely copies wallet.dat
to the specified file, which can be a directory or a path with filename.
Parameter #1—destination directory or filename
Name | Type | Presence | Description |
---|---|---|---|
Destination | string | Required (exactly 1) |
A filename or directory name. If a filename, it will be created or overwritten. If a directory name, the file wallet.dat will be created or overwritten within that directory |
Result—null
or error
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always null whether success or failure. The JSON-RPC error and message fields will be set if a failure occurred |
Example from Dash Core 0.12.2
dash-cli -testnet backupwallet /tmp/backup.dat
See also
- DumpWallet: creates or overwrites a file with all wallet keys in a human-readable format.
- ImportWallet: imports private keys from a file in wallet dump file format (see the
dumpwallet
RPC). 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.
BumpFee
Added in Bitcoin Core 0.14.0
Not implemented in Dash Core (as of 0.12.2)
ClearBanned
Added in Bitcoin Core 0.12.0
The clearbanned
RPC clears list of banned nodes.
Parameters: none
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
JSON null when the list was cleared |
Example from Dash Core 0.12.2
Clears the ban list.
dash-cli clearbanned
Result (no output from dash-cli
because result is set to null
).
See also
- ListBanned: lists all banned IPs/Subnets.
- SetBan: attempts add or remove a IP/Subnet from the banned list.
CreateMultiSig
The createmultisig
RPC creates a P2SH multi-signature address.
Parameter #1—the number of signatures required
Name | Type | Presence | Description |
---|---|---|---|
Required | number (int) | Required (exactly 1) |
The minimum (m) number of signatures required to spend this m-of-n multisig script |
Parameter #2—the full public keys, or addresses for known public keys
Name | Type | Presence | Description |
---|---|---|---|
Keys Or Addresses | array | Required (exactly 1) |
An array of strings with each string being a public key or address |
→ Key Or Address |
string | Required (1 or more) |
A public key against which signatures will be checked. If wallet support is enabled, this may be a P2PKH address belonging to the wallet—the corresponding public key will be substituted. There must be at least as many keys as specified by the Required parameter, and there may be more keys |
Result—P2SH address and hex-encoded redeem script
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object describing the multisig address |
→address |
string (base58) | Required (exactly 1) |
The P2SH address for this multisig redeem script |
→redeemScript |
string (hex) | Required (exactly 1) |
The multisig redeem script encoded as hex |
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:
dash-cli -testnet createmultisig 2 '''
[
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88",
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
]
'''
Result:
{
"address": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW",
"redeemScript": "522102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29210311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d882103251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d053ae"
}
See also
- AddMultiSigAddress: adds a P2SH multisig address to the wallet.
- DecodeScript: decodes a hex-encoded P2SH redeem script.
- Pay-To-Script-Hash (P2SH)
CreateRawTransaction
The createrawtransaction
RPC 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.
Parameter #1—Inputs
Name | Type | Presence | Description |
---|---|---|---|
Transactions | array | Required (exactly 1) |
An array of objects, each one to be used as an input to the transaction |
→ Input | object | Required (1 or more) |
An object describing a particular input |
→ →txid |
string (hex) | Required (exactly 1) |
The TXID of the outpoint to be spent encoded as hex in RPC byte order |
→ →vout |
number (int) | Required (exactly 1) |
The output index number (vout) of the outpoint to be spent; the first output in a transaction is index 0 |
→ →Sequence |
number (int) | Optional (0 or 1) |
NOT IMPLEMENTED IN DASH. The sequence number to use for the input |
Parameter #2—P2PKH or P2SH addresses and amounts
Name | Type | Presence | Description |
---|---|---|---|
Outputs | object | Required (exactly 1) |
The addresses and amounts to pay |
→ Address/Amount |
string : number (Dash) | Required (1 or more) |
A key/value pair with the address to pay as a string (key) and the amount to pay that address (value) in Dash |
Parameter #3—locktime
Name | Type | Presence | Description |
---|---|---|---|
Locktime | numeric (int) | Optional (0 or 1) |
Added in Bitcoin Core 0.12.0 Indicates the earliest time a transaction can be added to the block chain |
Result—the unsigned raw transaction in hex
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (Exactly 1) |
The resulting unsigned raw transaction in serialized transaction format encoded as hex. If the transaction couldn’t be generated, this will be set to JSON null and the JSON-RPC error field may contain an error message |
Example from Dash Core 0.12.2
dash-cli -testnet createrawtransaction '''
[
{
"txid": "061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b",
"vout" : 1
}
]''' \
'{"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 800, "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh":74.99}' '0'
Result (wrapped):
01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e06\
0100000000ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3\
cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b4\
28a488ac00000000
See also
- DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction.
- SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
- SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
- Serialized Transaction Format
Debug
The debug
RPC changes the debug category from the console.
Parameter #1—debug category
Name | Type | Presence | Description |
---|---|---|---|
Debug category | string | Required (1 or more) |
The debug category to activate. Use a comma to specify multiple categories. Categories will be one of the following: • 0 - Disables all categories • 1 - Enables all categories • addrman • alert • bench • coindb • db • lock • rand • rpc • selectcoins • mempool • mempoolrej • net • proxy • prune • http • libevent • tor • zmq • dash • privatesend • instantsend • masternode • spork • keepass • mnpayments • gobject |
Example from Dash Core 0.12.2
dash-cli -testnet debug "net,mempool"
Result:
Debug mode: net,mempool
See also: none
DecodeRawTransaction
The decoderawtransaction
RPC decodes a serialized transaction hex string into a JSON object describing the transaction.
Parameter #1—serialized transaction in hex
Name | Type | Presence | Description |
---|---|---|---|
Serialized Transaction | string (hex) | Required (exactly 1) |
The transaction to decode in serialized transaction format |
Result—the decoded transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object describing the decoded transaction, or JSON null if the transaction could not be decoded |
→txid |
string (hex) | Required (exactly 1) |
The transaction’s TXID encoded as hex in RPC byte order |
→size |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The serialized transaction size |
→version |
number (int) | Required (exactly 1) |
The transaction format version number |
→locktime |
number (int) | Required (exactly 1) |
The transaction’s locktime: either a Unix epoch date or block height; see the Locktime parsing rules |
→vin |
array | Required (exactly 1) |
An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0 |
→ → Input |
object | Required (1 or more) |
An object describing one of this transaction’s inputs. May be a regular input or a coinbase |
→ → →txid |
string | Optional (0 or 1) |
The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction |
→ → →vout |
number (int) | Optional (0 or 1) |
The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0 . Not present if this is a coinbase transaction |
→ → →scriptSig |
object | Optional (0 or 1) |
An object describing the signature script of this input. Not present if this is a coinbase transaction |
→ → → →asm |
string | Required (exactly 1) |
The signature script in decoded form with non-data-pushing opcodes listed |
→ → → →hex |
string (hex) | Required (exactly 1) |
The signature script encoded as hex |
→ → →coinbase |
string (hex) | Optional (0 or 1) |
The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction |
→ → →value |
number (Dash) | Optional (exactly 1) |
The number of Dash paid to this output. May be 0 .Only present if spentindex enabled |
→ → →valueSat |
number (duffs) | Optional (exactly 1) |
The number of duffs paid to this output. May be 0 .Only present if spentindex enabled |
→ → → →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.Only present if spentindex enabled |
→ → → → → Address |
string | Required (1 or more) |
A P2PKH or P2SH address |
→ → →sequence |
number (int) | Required (exactly 1) |
The input sequence number |
→vout |
array | Required (exactly 1) |
An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0 |
→ → Output |
object | Required (1 or more) |
An object describing one of this transaction’s outputs |
→ → →value |
number (Dash) | Required (exactly 1) |
The number of Dash paid to this output. May be 0 |
→ → →valueSat |
number (duffs) | Required (exactly 1) |
The number of duffs paid to this output. May be 0 |
→ → →n |
number (int) | Required (exactly 1) |
The output index number of this output within this 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) |
→ → → →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 | Required (1 or more) |
A P2PKH or P2SH address |
Example from Dash Core 0.12.2
Decode a signed one-input, two-output transaction:
dash-cli decoderawtransaction 01000000016b490886c0198b028c6c5cb145c4eb3b10\
55a224a7a105aadeff41b69ec91e060100000069463043022033a61c56fa0867ed67b76b02\
3204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4\
182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e\
8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa9\
9504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b6\
4486dc43400c0226b428a488ac00000000
Result:
{
"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"
]
}
}
]
}
See also
- 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.
- SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
- SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
DecodeScript
The decodescript
RPC decodes a hex-encoded P2SH redeem script.
Parameter #1—a hex-encoded redeem script
Name | Type | Presence | Description |
---|---|---|---|
Redeem Script | string (hex) | Required (exactly 1) |
The redeem script to decode as a hex-encoded serialized script |
Result—the decoded script
Name | Type | Presence | Description |
---|---|---|---|
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) |
→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 |
→ → 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 0.12.2
A 2-of-3 P2SH multisig pubkey script:
dash-cli -testnet decodescript 522102eacba539d92eb88d4e73bb32\
749d79f53f6e8d7947ac40a71bd4b26c13b6ec29210311f97539724e0de38fb1\
ff79f5148e5202459d06ed07193ab18c730274fd0d882103251f25a5c0291446\
d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d053ae
Result:
{
"asm": "2 02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29 0311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d88 03251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d0 3 OP_CHECKMULTISIG",
"reqSigs": 2,
"type": "multisig",
"addresses": [
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"yWAk1cDVvsRdPYjnzcFkySJux75yaCE7xz",
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
],
"p2sh": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW"
}
See also
- CreateMultiSig: creates a P2SH multi-signature address.
- Pay-To-Script-Hash (P2SH)
DisconnectNode
Added in Bitcoin Core 0.12.0
The disconnectnode
RPC immediately disconnects from a specified node.
Parameter #1—hostname/IP address and port of node to disconnect
Name | Type | Presence | Description |
---|---|---|---|
node |
string | Required (exactly 1) |
The node you want to disconnect from as a string in the form of <IP address>:<port> .Updated in Bitcoin Core 0.14.1 |
Result—null
on success or error on failed disconnect
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
JSON null when the node was disconnected |
Example from Dash Core 0.12.2
Disconnects following node from your node.
dash-cli -testnet disconnectnode 192.0.2.113:19999
Result (no output from dash-cli
because result is set to null
).
See also
- AddNode: attempts to add or remove a node from the addnode list, or to try a connection to a node once.
- GetAddedNodeInfo: returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the
addnode
RPC will have their information displayed.
DumpHDInfo
The dumphdinfo
RPC returns an object containing sensitive private info about this HD wallet
Parameters: none
Result—HD wallet information
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
An object containing sensitive private info about this HD wallet. |
→ hdseed |
string | Required (exactly 1) |
The BIP-32 HD seed (in hex) |
→ mnemonic |
string | Required (exactly 1) |
The BIP-39 mnemonic for this HD wallet (English words) |
→ mnemonicpassphrase |
string | Required (exactly 1) |
The BIP-39 mnemonic passphrase for this HD wallet (may be empty) |
Example from Dash Core 0.12.2
dash-cli -testnet dumphdinfo
Result (truncated for security reasons):
{
"hdseed": "20c63c3fb298ebd52de3 ...",
"mnemonic": "cost circle shiver ...",
"mnemonicpassphrase": ""
}
See also: none
DumpPrivKey
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The dumpprivkey
RPC returns the wallet-import-format (WIP) private key corresponding to an address. (But does not remove it from the wallet.)
Parameter #1—the address corresponding to the private key to get
Name | Type | Presence | Description |
---|---|---|---|
P2PKH Address | string (base58) | Required (exactly 1) |
The P2PKH address corresponding to the private key you want returned. Must be the address corresponding to a private key in this wallet |
Result—the private key
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base58) | Required (exactly 1) |
The private key encoded as base58check using wallet import format |
Example from Dash Core 0.12.2
dash-cli -testnet dumpprivkey ycBuREgSskHHkWLxDa9A5WppCki6PfFycL
Result:
cQZZ4awQvcXXyES3CmUJqSgeTobQm9t9nyUr337kvUtsWsnvvMyw
See also
- ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the
dumpprivkey
RPC. - DumpWallet: creates or overwrites a file with all wallet keys in a human-readable format.
DumpWallet
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The dumpwallet
RPC creates or overwrites a file with all wallet keys in a human-readable format.
Parameter #1—a filename
Name | Type | Presence | Description |
---|---|---|---|
Filename | string | Required (exactly 1) |
The file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten |
Result—null
or error
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always null whether success or failure. The JSON-RPC error and message fields will be set if a failure occurred |
Example from Dash Core 0.12.2
Create a wallet dump and then print its first 10 lines.
dash-cli -testnet dumpwallet /tmp/dump.txt
head /tmp/dump.txt
Results (only showing the first 10 lines):
# Wallet dump created by Dash Core v0.12.2.1 (2017-11-11 10:02:45 +0300)
# * Created on 2017-11-28T19:52:46Z
# * Best block at time of backup was 33750 (0000000005d5d1651f3b52d7a7158e350261519c52a28527c6053a8f5989a5a4),
# mined on 2017-11-28T19:48:05Z
cQZZ4awQvcXXyES3CmUJqSgeTobQm9t9nyUr337kvUtsWsnvvMyw 2017-11-28T18:21:36Z label=test%20label # addr=ycBuREgSskHHkWLxDa9A5WppCki6PfFycL
cTBRPnJoPjEMh67v1zes437v8Po5bFLDWKgEudTJMhVaLs1ZVGJe 2017-11-28T18:21:37Z reserve=1 # addr=yNsWkgPLN1u7p5dfWYnasYdgirU2J3tjUj
cRkkwrFnQUrih3QiT87sNy1AxyfjzqVYSyVYuL3qnJcSiQfE4QJa 2017-11-28T18:21:37Z reserve=1 # addr=yRkHzRbRKn8gBp5826mbaBvxLuBBNDVQg3
cQM7KoqQjHCCTrDhnfBEY1vpW9W65zRvaQeTb41UbFb6WX8Q8UkQ 2017-11-28T18:21:37Z reserve=1 # addr=yVEdefApUYiDLHApvvWCK5afTtJeQada8Y
cTGSKYaQTQabnjNSwCqpjYXiucVujTXiwp9dzmJV9cNAiayAJusi 2017-11-28T18:21:37Z reserve=1 # addr=ybQYgp21ZyZK8JuMLb2CVwG4TaWrXVXD5M
See also
- BackupWallet: safely copies
wallet.dat
to the specified file, which can be a directory or a path with filename. - ImportWallet: imports private keys from a file in wallet dump file format (see the
dumpwallet
RPC). 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.
EncryptWallet
Requires wallet support.
The encryptwallet
RPC encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.
Warning: if using this RPC on the command line, remember
that your shell probably saves your command lines (including the value
of the passphrase parameter). In addition, there is no RPC to completely
disable encryption. If you want to return to an unencrypted wallet, you
must create a new wallet and restore your data from a backup made with
the
dumpwallet
RPC.
Parameter #1—a passphrase
Name | Type | Presence | Description |
---|---|---|---|
Passphrase | string | Required (exactly 1) |
The passphrase to use for the encrypted wallet. Must be at least one character |
Result—a notice (with program shutdown)
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
A notice that the server is stopping and that you need to make a new backup. The wallet is now encrypted |
Example from Dash Core 0.12.2
dash-cli -testnet encryptwallet "test"
Result:
Wallet encrypted; Dash Core server stopping, restart to run with encrypted wallet.
The keypool has been flushed and a new HD seed was generated (if you are using
HD). You need to make a new backup.
See also
- WalletPassphrase: stores the wallet decryption key in memory for the indicated number of seconds. Issuing the
walletpassphrase
command while the wallet is already unlocked will set a new unlock time that overrides the old one. - WalletLock: removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call
walletpassphrase
again before being able to call any methods which require the wallet to be unlocked. - WalletPassphraseChange: changes the wallet passphrase from ‘old passphrase’ to ‘new passphrase’.
EstimateFee
The estimatefee
RPC estimates the transaction fee per kilobyte that needs to be paid for a transaction to begin confirmation within a certain number of blocks.
Parameter #1—how many blocks the transaction may wait before being included
Name | Type | Presence | Description |
---|---|---|---|
Blocks | number (int) | Required (exactly 1) |
The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block. Has to be between 1 and 25 blocks |
Result—the fee the transaction needs to pay per kilobyte
Name | Type | Presence | Description |
---|---|---|---|
result |
number (Dash) | Required (exactly 1) |
The estimated fee the transaction should pay in order to be included within the specified number of blocks. If the node doesn’t have enough information to make an estimate, the value -1 will be returned |
Examples from Dash Core 0.12.2
dash-cli estimatefee 6
Result:
0.00044345
Requesting data the node can’t calculate (out of range):
dash-cli estimatefee 100
Result:
-1
See also
- SetTxFee: sets the transaction fee per kilobyte paid by transactions created by this wallet.
EstimatePriority
Added in Bitcoin Core 0.10.0.
The estimatepriority
RPC estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction. This should not to be confused with the prioritisetransaction
RPC which will remain supported for adding fee deltas to transactions.
Warning:
estimatepriority
has been removed from Bitcoin and will no longer be available in the next major release (planned for Bitcoin Core 0.15.0). Still present in Dash Core.
Transaction priority is relative to a transaction’s byte size.
Parameter #1—how many blocks the transaction may wait before being included as a free high-priority transaction
Name | Type | Presence | Description |
---|---|---|---|
Blocks | number (int) | Required (exactly 1) |
The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block based purely on its priority |
Result—the priority a transaction needs
Name | Type | Presence | Description |
---|---|---|---|
result |
number (real) | Required (exactly 1) |
The estimated priority the transaction should have in order to be included within the specified number of blocks. If the node doesn’t have enough information to make an estimate, the value -1 will be returned |
Examples from Dash Core 0.12.2
dash-cli estimatepriority 6
Result:
718158904.10958910
Requesting data the node can’t calculate yet:
dash-cli estimatepriority 100
Result:
-1
See also
- EstimateFee: estimates the transaction fee per kilobyte that needs to be paid for a transaction to begin confirmation within a certain number of blocks.
EstimateSmartFee
The estimatesmartfee
RPC estimates the transaction fee per kilobyte that needs to be paid for a transaction to begin confirmation within a certain number of blocks and returns the number of blocks for which the estimate is valid.
Parameter #1—how many blocks the transaction may wait before being included
Name | Type | Presence | Description |
---|---|---|---|
Blocks | number (int) | Required (exactly 1) |
The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block. Has to be between 1 and 25 blocks |
Result—the fee the transaction needs to pay per kilobyte
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
JSON Object containing estimate information |
→feerate |
number (Dash) | Required (exactly 1) |
The estimated fee the transaction should pay in order to be included within the specified number of blocks. If the node doesn’t have enough information to make an estimate, the value -1 will be returned |
→blocks |
number | Required (exactly 1) |
Block number where the estimate was found |
Examples from Dash Core 0.12.2
dash-cli estimatesmartfee 6
Result:
{
"feerate": 0.00044345,
"blocks": 6
}
Requesting data the node can’t calculate (out of range):
dash-cli estimatesmartfee 100
Result:
{
"feerate": -1,
"blocks": 100
}
See also
- SetTxFee: sets the transaction fee per kilobyte paid by transactions created by this wallet.
EstimateSmartPriority
The estimatesmartpriority
RPC estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction and returns the number of blocks for which the estimate is valid. This should not to be confused with the prioritisetransaction
RPC which will remain supported for adding fee deltas to transactions.
Warning:
estimatesmartpriority
has been removed from Bitcoin and will no longer be available in the next major release (planned for Bitcoin Core 0.15.0). While still present in Dash Core, the interface should be considered unstable and may disappear or change. Use the RPC listed in the “See Also” subsection below instead.
Transaction priority is relative to a transaction’s byte size.
Parameter #1—how many blocks the transaction may wait before being included as a free high-priority transaction
Name | Type | Presence | Description |
---|---|---|---|
Blocks | number (int) | Required (exactly 1) |
The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block based purely on its priority |
Result—the priority a transaction needs
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
JSON Object containing estimate information |
→priority |
number | Required (exactly 1) |
The estimated priority the transaction should be in order to be included within the specified number of blocks. If the node doesn’t have enough information to make an estimate, the value -1 will be returned |
→blocks |
number | Required (exactly 1) |
Block number where the estimate was found |
Examples from Dash Core 0.12.2
dash-cli estimatesmartpriority 6
Result:
{
"priority": 718158904
"blocks": 25
}
Requesting data the node can’t calculate yet:
dash-cli estimatesmartpriority 100
Result:
{
"priority": -1,
"blocks": 100
}
See also
- EstimatePriority: estimates the priority that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.
FundRawTransaction
Requires wallet support.
The fundrawtransaction
RPC adds inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add one change output to the outputs.
Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that.
All existing inputs must have their previous output transaction be in the wallet.
Parameter #1—The hex string of the raw transaction
Name | Type | Presence | Description |
---|---|---|---|
Hexstring | string (hex) | Required (exactly 1) |
The hex string of the raw transaction |
Parameter #2—Additional options
Name | Type | Presence | Description |
---|---|---|---|
includeWatching |
bool | Optional (0 or 1) |
Inputs from watch-only addresses are also considered. The default is false |
The following options from Bitcoin are not implemented in Dash Core.
Name | Type | Presence | Description |
---|---|---|---|
Options | Object | Optional (0 or 1) |
Added in Bitcoin Core 0.13.0 Additional options |
→ changeAddress |
string | Optional (0 or 1) |
The bitcoin address to receive the change. If not set, the address is chosen from address pool |
→ changePosition |
nummeric (int) | Optional (0 or 1) |
The index of the change output. If not set, the change position is randomly chosen |
→ lockUnspent |
bool | Optional (0 or 1) |
The selected outputs are locked after running the rpc call. The default is false |
→ reserveChangeKey |
bool | Optional (0 or 1) |
Added in Bitcoin Core 0.14.0 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). |
→ feeRate |
numeric (bitcoins) | Optional (0 or 1) |
The specific feerate you are willing to pay(BTC per KB). If not set, the wallet determines the fee |
→ subtractFeeFromOutputs |
array | Optional (0 or 1) |
A json array of integers. The fee will be equally deducted from the amount of each specified output. The outputs are specified by their zero-based index, before any change output is added. |
→ → Output index |
numeric (int) | Optional (0 or more) |
A output index number (vout) from which the fee should be subtracted. If multiple vouts are provided, the total fee will be divided by the numer of vouts listed and each vout will have that amount subtracted from it |
Result—information about the created transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object including information about the created transaction |
→ hex |
string (hex) | Required (Exactly 1) |
The resulting unsigned raw transaction in serialized transaction format encoded as hex |
→ fee |
numeric (bitcoins) | Required (Exactly 1) |
Fee in BTC the resulting transaction pays |
→ changepos |
numeric (int) | Required (Exactly 1) |
The position of the added change output, or -1 if no change output was added |
Example from Dash Core 0.12.2
dash-cli -testnet fundrawtransaction 01000000000100205fa012000000\
1976a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac00000000
Result:
{
"hex": "01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000000feffffff023e1207bf010000001976a914bd652a167e7ad674f7815dc549bea9c57a7f919b88ac00205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388ac00000000",
"changepos": 0,
"fee": 0.00000226
}
See also
- 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.
- DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction.
- SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
- SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
- Serialized Transaction Format
Generate
Requires wallet support. Can only be used on the regtest network.
The generate
RPC mines blocks immediately (before the RPC call returns).
Parameter #1—the number of blocks to generate
Name | Type | Presence | Description |
---|---|---|---|
numblocks |
number (int) | Required (exactly 1) |
The number of blocks to generate. The RPC call will not return until all blocks have been generated. |
Result—the generated block header hashes
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing the block header hashes of the generated blocks (may be empty if used with generate 0 ) |
→ Header Hashes |
string (hex) | Required (1 or more) |
The hashes of the headers of the blocks generated in regtest mode, as hex in RPC byte order |
Example from Dash Core 0.12.2
Using regtest mode, generate 2 blocks:
dash-cli -regtest generate 2
Result:
[
"55a4c47da8151c0823eec22c41ebc6d690a0288302179625bae9eb6f36808266",
"3f07b9aa4e3bcd5518610945c4a6b32699acac71b1762605ff79ba553111fc79"
]
See also
- GenerateToAddress: mines blocks immediately to a specified address.
- GetBlockTemplate: gets a block template or proposal for use with mining software.
- GetGenerate: returns if the server is set to generate coins or not.
- GetMiningInfo: returns various mining-related information.
- SetGenerate: enables or disables hashing to attempt to find the next block.
GenerateToAddress
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
GetAccountAddress
Requires wallet support.
The getaccountaddress
RPC returns the current Dash address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address.
Warning:
getaccountaddress
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—an account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Required (exactly 1) |
The name of an account. Use an empty string (“”) for the default account. If the account doesn’t exist, it will be created |
Result—a Dash address
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base58) | Required (exactly 1) |
An address, belonging to the account specified, which has not yet received any payments |
Example from Dash Core 0.12.2
Get an address for the default account:
dash-cli -testnet getaccountaddress ""
Result:
yNUQ6RzTpNj5GP5ebdRcusJ7K9JJKx6VvV
See also
- GetNewAddress: returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
- GetRawChangeAddress: returns a new Dash address for receiving change. This is for use with raw transactions, not normal use.
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
GetAccount
Requires wallet support.
The getaccount
RPC returns the name of the account associated with the given address.
Warning:
setaccount
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—a Dash address
Name | Type | Presence | Description |
---|---|---|---|
Address | string (base58) | Required (exactly 1) |
A P2PKH or P2SH Dash address belonging either to a specific account or the default account (“”) |
Result—an account name
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The name of an account, or an empty string (“”, the default account) |
Example from Dash Core 0.12.2
dash-cli -testnet getaccount yMTFRnrfJ4NpnYVeidDNHVwT7uuNsVjevq
Result:
doc test
See also
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
GetAddedNodeInfo
The getaddednodeinfo
RPC returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the addnode
RPC will have their information displayed.
Parameter #1—whether to display connection information
Name | Type | Presence | Description |
---|---|---|---|
Dummy | bool | Required (exactly 1) |
Kept for historical purposes but ignored Removed in Bitcoin Core 0.14.0 |
Parameter #2—what node to display information about
Name | Type | Presence | Description |
---|---|---|---|
node |
string | Optional (0 or 1) |
The node to get information about in the same <IP address>:<port> format as the addnode RPC. If this parameter is not provided, information about all added nodes will be returned |
Result—a list of added nodes
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing objects describing each added node. If no added nodes are present, the array will be empty. Nodes added with onetry will not be returned |
→ Added Node |
object | Optional (0 or more) |
An object containing details about a single added node |
→ →addednode |
string | Required (exactly 1) |
An added node in the same <IP address>:<port> format as used in the addnode RPC. |
→ →connected |
bool | Optional (0 or 1) |
This will be set to true if the node is currently connected and false if it is not |
→ →addresses |
array | Required (exactly 1) |
This will be an array of addresses belonging to the added node |
→ → → Address |
object | Optional (0 or more) |
An object describing one of this node’s addresses |
→ → → →address |
string | Required (exactly 1) |
An IP address and port number of the node. If the node was added using a DNS address, this will be the resolved IP address |
→ → → →connected |
string | Required (exactly 1) |
Whether or not the local node is connected to this addnode using this IP address. Valid values are: • false for not connected• inbound if the addnode connected to us• outbound if we connected to the addnode |
Example from Dash Core 0.12.2
dash-cli getaddednodeinfo true
Result (real hostname and IP address replaced with RFC5737 reserved address):
[
{
"addednode": "192.0.2.113:19999",
"connected": true,
"addresses": [
{
"address": "192.0.2.113:19999",
"connected": "outbound"
}
]
}
]
See also
- AddNode: attempts to add or remove a node from the addnode list, or to try a connection to a node once.
- GetPeerInfo: returns data about each connected network node.
GetAddressBalance
Requires wallet support and -addressindex
Dash Core command-line/configuration-file parameter to be enabled.
The getaddressbalance
RPC returns the balance for address(es).
Parameter #1—an array of addresses
Name | Type | Presence | Description |
---|---|---|---|
addresses |
object | Required (exactly 1) |
An array of P2PKH or P2SH Dash address(es) |
→Address | string (base58) | Required (1 or more) |
The base58check encoded address |
Result—the current balance in duffs and the total number of duffs received (including change)
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object listing the current balance and total amount received (including change), or an error if any address is invalid |
→balance |
string | Required (exactly 1) |
The current balance in duffs |
→received |
string | Required (exactly 1) |
The total number of duffs received (including change) |
Example from Dash Core 0.12.2
Get the balance for an address:
dash-cli getaddressbalance '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"]}'
Result:
{
"balance": 0,
"received": 10000100
}
See also
- GetBalance: gets the balance in decimal dash across all accounts or for a particular account.
- GetUnconfirmedBalance: returns the wallet’s total unconfirmed balance.
GetAddressDeltas
Requires wallet support and -addressindex
Dash Core command-line/configuration-file parameter to be enabled.
The getaddressdeltas
RPC returns all changes for an address.
Parameter #1—an array of addresses
Name | Type | Presence | Description |
---|---|---|---|
addresses |
object | Required (exactly 1) |
An array of P2PKH or P2SH Dash address(es) |
→Address | string (base58) | Required (1 or more) |
The base58check encoded address |
Parameter #2—the start block height
Name | Type | Presence | Description |
---|---|---|---|
start |
number (int) | Optional (exactly 1) |
The start block height |
Parameter #3—the end block height
Name | Type | Presence | Description |
---|---|---|---|
end |
number (int) | Optional (exactly 1) |
The end block height |
Result—information about all changes for the address(es)
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of JSON objects, with each object describing a transaction involving one of the requested addresses |
→ Delta |
object | Required (1 or more) |
An object describing a particular address delta |
→→satoshis |
number | Required (exactly 1) |
The difference of duffs |
→→txid |
string | Required (exactly 1) |
The related txid |
→→blockindex |
number | Required (exactly 1) |
The related input or output index |
→→height |
number | Required (exactly 1) |
The block height |
→→address |
string | Required (exactly 1) |
The base58check encoded address |
Example from Dash Core 0.12.2
Get the deltas for an address:
dash-cli getaddressdeltas '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"], "start":5000, "end":7500}'
Result:
[
{
"satoshis": 10000100,
"txid": "1fe86e463a9394d4ccd9a5ff1c6b483c95b4350ffdb055b55dc3615111e977de",
"index": 18,
"blockindex": 1,
"height": 6708,
"address": "yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"
},
{
"satoshis": -10000100,
"txid": "6cb4379eec45cd3bb08b8f4c3a101b8cd89795e24f2cb8288a9941a85fb114cf",
"index": 0,
"blockindex": 1,
"height": 7217,
"address": "yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"
}
]
GetAddressesByAccount
Requires wallet support.
The getaddressesbyaccount
RPC returns a list of every address assigned to a particular account.
Warning:
getaddressesbyaccount
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—the account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Required (exactly 1) |
The name of the account containing the addresses to get. To get addresses from the default account, pass an empty string (“”) |
Result—a list of addresses
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing all addresses belonging to the specified account. If the account has no addresses, the array will be empty |
Address | string (base58) | Optional (1 or more) |
A P2PKH or P2SH address belonging to the account |
Example from Dash Core 0.12.2
Get the addresses assigned to the account “doc test”:
dash-cli -testnet getaddressesbyaccount "doc test"
Result:
[
"yMTFRnrfJ4NpnYVeidDNHVwT7uuNsVjevq",
"yhT2HS1SxvXkMVdAdf6RNtGPfuVFvwZi35"
]
See also
- GetAccount: returns the name of the account associated with the given address.
- GetBalance: gets the balance in decimal dash across all accounts or for a particular account.
GetAddressMempool
Requires wallet support and -addressindex
Dash Core command-line/configuration-file parameter to be enabled.
The getaddressmempool
RPC returns all mempool deltas for an address.
Parameter #1—an array of addresses
Name | Type | Presence | Description |
---|---|---|---|
addresses |
object | Required (exactly 1) |
An array of P2PKH or P2SH Dash address(es) |
→Address | string (base58) | Required (1 or more) |
The base58check encoded address |
Result—information about mempool deltas for the address(es)
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of JSON objects, with each object describing a transaction involving one of the requested addresses |
→Mempool Deltas | object | Required (1 or more) |
An object describing a particular mempool address delta |
→→address |
string | Required (exactly 1) |
The base58check encoded address |
→→txid |
string | Required (exactly 1) |
The related txid |
→→index |
number | Required (exactly 1) |
The related input or output index |
→→satoshis |
number | Required (exactly 1) |
The difference of duffs |
→→timestamp |
string | Required (exactly 1) |
The time the transaction entered the mempool (seconds) |
→→prevtxid |
string | Required (exactly 1) |
The previous txid (if spending) |
→→prevout |
string | Required (exactly 1) |
The previous transaction output index (if spending) |
Example from Dash Core 0.12.2
Get the deltas for an address:
dash-cli getaddressmempool '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"]}'
Result:
Example result needed
GetAddressTxids
Requires wallet support and -addressindex
Dash Core command-line/configuration-file parameter to be enabled.
The getaddresstxids
RPC returns the txids for an address(es).
Parameter #1—an array of addresses
Name | Type | Presence | Description |
---|---|---|---|
addresses |
object | Required (exactly 1) |
An array of P2PKH or P2SH Dash address(es) |
→Address | string (base58) | Required (1 or more) |
The base58check encoded address |
Parameter #2—the start block height
Name | Type | Presence | Description |
---|---|---|---|
start |
number (int) | Optional (exactly 1) |
The start block height |
Parameter #3—the end block height
Name | Type | Presence | Description |
---|---|---|---|
end |
number (int) | Optional (exactly 1) |
The end block height |
Result—information about txids for the address(es)
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of txids related to the requested address(es) |
→ TXID |
string | Required (1 or more) |
The transaction id |
Example from Dash Core 0.12.2
Get the deltas for an address:
dash-cli getaddresstxids '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"], "start":5000, "end":7500}'
Result:
[
"1fe86e463a9394d4ccd9a5ff1c6b483c95b4350ffdb055b55dc3615111e977de",
"6cb4379eec45cd3bb08b8f4c3a101b8cd89795e24f2cb8288a9941a85fb114cf"
]
GetAddressUtxos
Requires wallet support and -addressindex
Dash Core command-line/configuration-file parameter to be enabled.
The getaddressutxos
RPC returns all unspent outputs for an address.
Parameter #1—an array of addresses
Name | Type | Presence | Description |
---|---|---|---|
addresses |
object | Required (exactly 1) |
An array of P2PKH or P2SH Dash address(es) |
→Address | string (base58) | Required (1 or more) |
The base58check encoded address |
Result—information about unspent outputs for the address(es)
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of JSON objects, with each object describing a transaction involving one of the requested addresses |
→Unspent outputs | object | Required (1 or more) |
An object describing a particular unspent output for the requested address(es) |
→→address |
string | Required (exactly 1) |
The base58check encoded address |
→→txid |
string | Required (exactly 1) |
The output txid |
→→outputIndex |
number | Required (exactly 1) |
The output index |
→→script |
string | Required (exactly 1) |
The script hex encoded |
→→satoshis |
number | Required (exactly 1) |
The number of duffs of the output |
→→height |
number | Required (exactly 1) |
The block height |
Example from Dash Core 0.12.2
Get the unspent outputs for an address:
dash-cli getaddressutxos '{"addresses": ["yLeC3F9UxJmFaRaf5yzH7FDc7RdvBasi84"]}'
Result:
[
{
"address": "yLeC3F9UxJmFaRaf5yzH7FDc7RdvBasi84",
"txid": "ef7bcd083db8c9551ca295698c3b7a6811288fae9944018d2a660a0f939bdb35",
"outputIndex": 0,
"script": "76a914038b8a73338c8f9c22024338198d63ff7c4cb4c088ac",
"satoshis": 1000010000,
"height": 7683
}
]
GetBalance
Requires wallet support.
The getbalance
RPC gets the balance in decimal dash across all accounts or for a particular account.
Parameter #1—an account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Optional (0 or 1) |
Deprecated: will be removed in a later version of Bitcoin Core The name of an account to get the balance for. An empty string (“”) is the default account. The string * will get the balance for all accounts (this is the default behavior) |
Parameter #2—the minimum number of confirmations
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #3—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions |
Parameter #4—whether to include watch-only addresses
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—the balance in dash
Name | Type | Presence | Description |
---|---|---|---|
result |
number (dash) | Required (exactly 1) |
The balance of the account (or all accounts) in dash |
Examples from Dash Core 0.12.2
Get the balance for the main (“”) account, including transactions with at least five confirmations and those spent to watch-only addresses in that account. Do not add the InstantSend confirmations (5) for locked transactions.
dash-cli -testnet getbalance "" 3 false true
Result:
0.00000000
Get the balance for the main (“”) account, including transactions with at least one confirmation and those spent to watch-only addresses in that account. Add the InstantSend confirmations (5) for locked transactions.
dash-cli -testnet getbalance "" 3 true true
Result:
1.00000000
See also
- ListAccounts: lists accounts and their balances.
- GetReceivedByAccount: returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetReceivedByAddress: returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
GetBestBlockHash
The getbestblockhash
RPC returns the header hash of the most recent block on the best block chain.
Parameters: none
Result—hash of the tip from the best block chain
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex) | Required (exactly 1) |
The hash of the block header from the most recent block on the best block chain, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
dash-cli -testnet getbestblockhash
Result:
00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c
See also
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
GetBlock
The getblock
RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
Parameter #1—header hash
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | string (hex) | Required (exactly 1) |
The hash of the header of the block to get, encoded as hex in RPC byte order |
Parameter #2—whether to get JSON or hex output
Name | Type | Presence | Description |
---|---|---|---|
Format | boolean | Optional (true or false) |
Set to false to get the block in serialized block format; set to true (the default) to get the decoded block as a JSON object |
Result (if format was false
)—a serialized block
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex)/null | Required (exactly 1) |
The requested block as a serialized block, encoded as hex, or JSON null if an error occurred |
Result (if format was true
or omitted)—a JSON block
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
An object containing the requested block, or JSON null if an error occurred |
→hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1 |
→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→size |
number (int) | Required (exactly 1) |
The size of this block in serialized block format, counted in bytes |
→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→tx |
array | Required (exactly 1) |
An array containing the TXIDs of all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block |
→ → TXID |
string (hex) | Required (1 or more) |
The TXID of a transaction in this block, encoded as hex in RPC byte order |
→time |
number (int) | Required (exactly 1) |
The value of the time field in the block header, indicating approximately when the block was created |
→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median block time in Unix epoch time |
→nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→previousblockhash |
string (hex) | Optional (0 or 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block |
→nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
Get a block in raw hex:
dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84 \
false
Result (wrapped):
0100002011f5719a0a0c4881ff98b4a68c1c828dc3b10f5b51033f5f93d48dbf\
000000004b8e38f197d6ee878e160d2bae3ce05ab898a6252458ec67ce770140\
260397c4dd2ed659a1dd001d00636b5601010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff4b02041204dd\
2ed65908fabe6d6d7445746d63506b62572d2d35584853467a765a6748696972\
30657a3a6f6d656e010000000000000017fffff9020000000d2f6e6f64655374\
726174756d2f00000000058028bb13010000001976a914bad55652dffb1af943\
41015c94feea79793442fd88ac40e553b1020000001976a9142b7856de53d4c1\
823090c98f8ad79862842c09b588ac4094dd89000000001976a914c2c29ebc78\
7954ef99d01c5f79115abf7012fb8e88ac4094dd89000000001976a914d7b47d\
4b40a23c389f5a17754d7f60f511c7d0ec88ac4094dd89000000001976a914dc\
3e0793134b081145ec0c67a9c72a7b297df27c88ac00000000
Get the same block in JSON:
dash-cli -testnet getblock \
0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84
Result:
{
"hash": "0000000037955fcc39af8b1ae75914ffb422313c0fca7eba96a1ac99c2e57f84",
"confirmations": 3,
"size": 377,
"height": 4612,
"version": 536870913,
"merkleroot": "c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b",
"tx": [
"c4970326400177ce67ec582425a698b85ae03cae2b0d168e87eed697f1388e4b"
],
"time": 1507208925,
"mediantime": 1507208645,
"nonce": 1449878272,
"bits": "1d00dda1",
"difficulty": 1.155066358813473,
"chainwork": "000000000000000000000000000000000000000000000000000001c3e86f0f04",
"previousblockhash": "00000000bf8dd4935f3f03515b0fb1c38d821c8ca6b498ff81480c0a9a71f511",
"nextblockhash": "0000000028817c7fce55d802f3647640600535a983d00e16076f284ec6cb001b"
}
See also
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
GetBlockChainInfo
The getblockchaininfo
RPC provides information about the current state of the block chain.
Parameters: none
Result—A JSON object providing information about the block chain
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the current state of the local block chain |
→chain |
string | Required (exactly 1) |
The name of the block chain. One of main for mainnet, test for testnet, or regtest for regtest |
→blocks |
number (int) | Required (exactly 1) |
The number of validated blocks in the local best block chain. For a new node with just the hardcoded genesis block, this will be 0 |
→headers |
number (int) | Required (exactly 1) |
The number of validated headers in the local best headers chain. For a new node with just the hardcoded genesis block, this will be zero. This number may be higher than the number of blocks |
→bestblockhash |
string (hex) | Required (exactly 1) |
The hash of the header of the highest validated block in the best block chain, encoded as hex in RPC byte order. This is identical to the string returned by the getbestblockhash RPC |
→difficulty |
number (real) | Required (exactly 1) |
The difficulty of the highest-height block in the best block chain |
→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113 |
→verificationprogress |
number (real) | Required (exactly 1) |
Estimate of what percentage of the block chain transactions have been verified so far, starting at 0.0 and increasing to 1.0 for fully verified. May slightly exceed 1.0 when fully synced to account for transactions in the memory pool which have been verified before being included in a block |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex |
→pruned |
bool | Required (exactly 1) |
Added in Bitcoin Core 0.11.0 Indicates if the blocks are subject to pruning |
→pruneheight |
number (int) | Optional (0 or 1) |
Added in Bitcoin Core 0.11.0 The lowest-height complete block stored if pruning is activated |
→softforks |
array | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 An array of objects each describing a current or previous soft fork |
→ → Softfork |
object | Required (3 or more) |
A specific softfork |
→ → →id |
string | Required (exactly 1) |
The name of the softfork |
→ → →version |
numeric (int) |
Required (exactly 1) |
The block version used for the softfork |
→ → →enforce |
string : object | Optional (0 or 1) |
The progress toward enforcing the softfork rules for new-version blocks |
→ → → →status |
bool | Required (exactly 1) |
Indicates if the threshold was reached |
→ → → →found |
numeric (int) |
Optional (0 or 1) |
Number of blocks that support the softfork |
→ → → →required |
numeric (int) |
Optional (0 or 1) |
Number of blocks that are required to reach the threshold |
→ → → →window |
numeric (int) |
Optional (0 or 1) |
The maximum size of examined window of recent blocks |
→ → →reject |
object | Optional (0 or 1) |
The progress toward enforcing the softfork rules for new-version blocks |
→ → → →status |
bool | Optional (0 or 1) |
Indicates if the threshold was reached |
→ → → →found |
numeric (int) |
Optional (0 or 1) |
Number of blocks that support the softfork |
→ → → →required |
numeric (int) |
Optional (0 or 1) |
Number of blocks that are required to reach the threshold |
→ → → →window |
numeric (int) |
Optional (0 or 1) |
The maximum size of examined window of recent blocks |
→bip9_softforks |
object | Required (exactly 1) |
Added in Bitcoin Core 0.12.1 The status of BIP9 softforks in progress |
→ → Name |
string : object | Required (2 or more) |
A specific BIP9 softfork |
→ → →status |
string | Required (exactly 1) |
Set to one of the following reasons: • defined if voting hasn’t started yet• started if the voting has started • locked_in if the voting was successful but the softfork hasn’t been activated yet• active if the softfork was activated• failed if the softfork has not receieved enough votes |
→ → →bit |
numeric (int) |
Optional (0 or 1) |
The bit (0-28) in the block version field used to signal this softfork. Field is only shown when status is started |
Example from Dash Core 0.12.2
dash-cli -testnet getblockchaininfo
Result:
{
"chain": "test",
"blocks": 4622,
"headers": 4622,
"bestblockhash": "000000007f4141e557309da09911b1c3c65b8e9eed3f5e940f7083aec8999ac7",
"difficulty": 1.380236305048335,
"mediantime": 1507209819,
"verificationprogress": 0.9999053826626874,
"chainwork": "000000000000000000000000000000000000000000000000000001d17aeaf58b",
"pruned": false,
"softforks": [
{
"id": "bip34",
"version": 2,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
},
{
"id": "bip66",
"version": 3,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
},
{
"id": "bip65",
"version": 4,
"enforce": {
"status": true,
"found": 100,
"required": 51,
"window": 100
},
"reject": {
"status": true,
"found": 100,
"required": 75,
"window": 100
}
}
],
"bip9_softforks": [
{
"id": "csv",
"status": "started"
},
{
"id": "dip0001",
"status": "started"
}
]
}
See also
- GetMiningInfo: returns various mining-related information.
- GetNetworkInfo: returns information about the node’s connection to the network.
- GetWalletInfo: provides information about the wallet.
GetBlockCount
The getblockcount
RPC returns the number of blocks in the local best block chain.
Parameters: none
Result—the number of blocks in the local best block chain
Name | Type | Presence | Description |
---|---|---|---|
result |
number (int) | Required (exactly 1) |
The number of blocks in the local best block chain. For a new node with only the hardcoded genesis block, this number will be 0 |
Example from Dash Core 0.12.2
dash-cli -testnet getblockcount
Result:
4627
See also
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
GetBlockHash
The getblockhash
RPC returns the header hash of a block at the given height in the local best block chain.
Parameter—a block height
Name | Type | Presence | Description |
---|---|---|---|
Block Height | number (int) | Required (exactly 1) |
The height of the block whose header hash should be returned. The height of the hardcoded genesis block is 0 |
Result—the block header hash
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex)/null | Required (exactly 1) |
The hash of the block at the requested height, encoded as hex in RPC byte order, or JSON null if an error occurred |
Example from Dash Core 0.12.2
dash-cli -testnet getblockhash 4000
Result:
00000ce22113f3eb8636e225d6a1691e132fdd587aed993e1bc9b07a0235eea4
See also
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
GetBlockHashes
Added in Dash Core 0.12.1
The getblockhashes
RPC returns array of hashes of blocks within the timestamp range provided (requires timestampindex
to be enabled).
Parameter #1—high block timestamp
Name | Type | Presence | Description |
---|---|---|---|
Block Timestamp | number (int) | Required (exactly 1) |
The block timestamp for the newest block hash that should be returned. |
Parameter #2—low block timestamp
Name | Type | Presence | Description |
---|---|---|---|
Block Timestamp | number (int) | Required (exactly 1) |
The block timestamp for the oldest block hash that should be returned. |
Result—the block header hashes in the give time range
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
The hashes of the blocks in the requested time range |
→hash |
string (hex) | Required (1 or more) |
The hash of a block in the chain, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
dash-cli -testnet getblockhashes 1507555793 1507554793
Result:
[
"0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8",
"000000004bbb3828db1c4d4491760336cec215087819ab656336f30d4095e3d2",
"00000000ad2df2149aca2261a9a87c41e139dfe8f73d91db7ec0c1837fee21a0",
"0000000074068a9e3a271d165da3deb28bc3f8c751dde97f460d8078d92a9d06"
]
See also
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
GetBlockHeader
Added in Bitcoin Core 0.12.0
The getblockheader
RPC gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header.
Parameter #1—header hash
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | string (hex) | Required (exactly 1) |
The hash of the block header to get, encoded as hex in RPC byte order |
Parameter #2—JSON or hex output
Name | Type | Presence | Description |
---|---|---|---|
Format | bool | Optional (0 or 1) |
Set to false to get the block header in serialized block format; set to true (the default) to get the decoded block header as a JSON object |
Result (if format was false
)—a serialized block header
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex)/null | Required (exactly 1) |
The requested block header as a serialized block, encoded as hex, or JSON null if an error occurred |
Result (if format was true
or omitted)—a JSON block header
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
An object containing the requested block, or JSON null if an error occurred |
→hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1 |
→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→time |
number (int) | Required (exactly 1) |
The time of the block |
→mediantime |
number (int) | Required (exactly 1) |
The computed median time of the previous 11 blocks. Used for validating transaction locktime under BIP113 |
→nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→previousblockhash |
string (hex) | Optional (0 or 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block |
→nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Changes from Bitcoin - Following items not present in Dash result
Name | Type | Presence | Description |
---|---|---|---|
→versionHex |
number (hex) | Required (exactly 1) |
This block’s hex version number. See block version numbers |
Example from Dash Core 0.12.2
Get a block header in raw hex:
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078 \
false
Result (wrapped):
01000020f61396cfd2747e94cfa088fe1f7875d8171accc22d6e5616edca0cb8\
00000000c31eb96ee1d9e78d61a601371a348c19e4e59698d0ff7869334b72cb\
7ffb76893b41d6593016011d09b2aa3c
Get the same block in JSON:
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078
Result:
{
"hash": "00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078",
"confirmations": 7,
"height": 4635,
"version": 536870913,
"merkleroot": "8976fb7fcb724b336978ffd09896e5e4198c341a3701a6618de7d9e16eb91ec3",
"time": 1507213627,
"mediantime": 1507213022,
"nonce": 1017819657,
"bits": "1d011630",
"difficulty": 0.920228600314536,
"chainwork": "000000000000000000000000000000000000000000000000000001e06428c09a",
"previousblockhash": "00000000b80ccaed16566e2dc2cc1a17d875781ffe88a0cf947e74d2cf9613f6",
"nextblockhash": "000000003b1aa290db62ae7cfb4dbb67c8e1402a40ef387587f930b8ec3b45db"
}
See also
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBlockHashes: returns array of hashes of blocks within the timestamp range provided (requires
timestampindex
to be enabled). - GetBlockHeaders: returns an array of items with information about the requested number of blockheaders starting from the requested hash.
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
GetBlockHeaders
Added in Dash Core 0.12.1
The getblockheaders
RPC returns an array of items with information about the requested number of blockheaders starting from the requested hash.
Parameter #1—header hash
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | string (hex) | Required (exactly 1) |
The hash of the block header to get, encoded as hex in RPC byte order |
Parameter #2—number of headers to return
Name | Type | Presence | Description |
---|---|---|---|
Count | number | Optional (exactly 1) |
The number of block headers to get |
Parameter #3—JSON or hex output
Name | Type | Presence | Description |
---|---|---|---|
Verbose | bool | Optional (0 or 1) |
Set to false to get the block headers in serialized block format; set to true (the default) to get the decoded block headers as a JSON object |
Result (if format was false
)—a serialized block header
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
The requested block header(s) as a serialized block |
→header |
string (hex) | Required (1 or more) |
The block header encoded as hex in RPC byte order |
Result (if format was true
or omitted)—a JSON block header
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of objects each containing a block header, or JSON null if an error occurred |
→ Block Header |
object/null | Required (exactly 1) |
An object containing a block header |
→ →hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1 |
→ →confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→ →height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→ →version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→ →merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→ →time |
number (int) | Required (exactly 1) |
The time of the block |
→ →mediantime |
number (int) | Required (exactly 1) |
The computed median time of the previous 11 blocks. Used for validating transaction locktime under BIP113 |
→ →nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→ →bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→ →difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→ →previousblockhash |
string (hex) | Optional (0 or 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order. Not returned for genesis block |
→ →nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
Get two block headers in raw hex:
dash-cli -testnet getblockheaders \
0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89 \
2 false
Result (wrapped):
[
"010000207216dc7b7c898ba3fc0b39d1fd16756b97b1e07e3eb5c64d1510a64b0000000\
0bb64e58a0be4276bf3e9c366bba960953ef9e47a8f62342476be56a5dfa7a2670276db\
59eae1001d0735577e",
"01000020894bfce6e49bd50015de7fe934a3cdabbec238c2cdd56bbc6f6ca1100000000\
0edb2a018d535de70b0622a3303dc329dcb315e7507d074c0c641501c58d88aa08576db\
59c5db001d03cf8986"
]
Get the same two block headers in JSON:
dash-cli -testnet getblockheader \
00000000eb0af5aec7b673975a22593dc0cc763f71ba8de26292410273437078 \
2 true
Result:
[
{
"hash": "0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"confirmations": 20,
"height": 6802,
"version": 536870913,
"merkleroot": "67a2a7dfa556be762434628f7ae4f93e9560a9bb66c3e9f36b27e40b8ae564bb",
"time": 1507554818,
"mediantime": 1507554058,
"nonce": 2119644423,
"bits": "1d00e1ea",
"difficulty": 1.1331569664903,
"chainwork": "0000000000000000000000000000000000000000000000000000092c7b511197",
"previousblockhash": "000000004ba610154dc6b53e7ee0b1976b7516fdd1390bfca38b897c7bdc1672",
"nextblockhash": "000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8"
},
{
"hash": "000000009910885e811230c403e55aac6547d6df04ee671b2e8348524f73cab8",
"confirmations": 19,
"height": 6803,
"version": 536870913,
"merkleroot": "a08ad8581c5041c6c074d007755e31cb9d32dc03332a62b070de35d518a0b2ed",
"time": 1507554949,
"mediantime": 1507554181,
"nonce": 2257178371,
"bits": "1d00dbc5",
"difficulty": 1.164838875953147,
"chainwork": "0000000000000000000000000000000000000000000000000000092da5851d38",
"previousblockhash": "0000000010a16c6fbc6bd5cdc238c2beabcda334e97fde1500d59be4e6fc4b89",
"nextblockhash": "000000004bbb3828db1c4d4491760336cec215087819ab656336f30d4095e3d2"
}
]
See also
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash: returns the header hash of a block at the given height in the local best block chain.
- GetBlockHashes: returns array of hashes of blocks within the timestamp range provided (requires
timestampindex
to be enabled). - GetBlockHeader: gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header.
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
GetBlockTemplate
The getblocktemplate
RPC gets a block template or proposal for use with mining software. For more
information, please see the following resources:
Parameter #1—a JSON request object
Name | Type | Presence | Description |
---|---|---|---|
Request | object | Optional (exactly 1) |
A JSON request object |
→mode |
string | Optional (exactly 1) |
This must be set to “template” or omitted |
→capabilities |
array (string) | Optional (0 or more) |
A list of strings |
→ → Capability |
string | Optional (exactly 1) |
Client side supported feature, longpoll , coinbasetxn , coinbasevalue , proposal , serverlist , workid |
Result—block template
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A object containing a block template |
→capabilities |
array (string) | Required (1 or more) |
The client side supported features |
→ → Capability |
string | Optional (0 or more) |
A client side supported feature |
→version |
number (int) | Required (exactly 1) |
The block version |
→rules |
array (string) | Required (1 or more) |
The specific block rules that are to be enforced |
→ → Block Rule |
string | Optional (0 or more) |
A specific block rule to be enforced |
→vbavailable |
object | Required (exactly 1) |
Contains the set of pending, supported versionbit (BIP 9) softfork deployments |
→ → Bit Number |
number | Required (0 or more) |
The bit number the named softfork rule |
→vbrequired |
number | Required (exactly 1) |
The bit mask of versionbits the server requires set in submissions |
→previousblockhash |
string (hex) | Required (exactly 1) |
The hash of current highest block |
→transactions |
array (objects) | Optional (0 or more) |
Non-coinbase transactions to be included in the next block |
→ → Transaction |
object | Optional (0 or more) | Non-coinbase transaction |
→ → →data |
string (hex) | Optional (0 or more) | Transaction data encoded in hex (byte-for-byte) |
→ → →hash |
string (hex) | Optional (0 or more) | The hash/id encoded in little-endian hex |
→ → →depends |
array (numbers) | Required (0 or more) |
An array holding TXIDs of unconfirmed transactions this TX depends upon (parent transactions). |
→ → → → Transaction number |
number | Optional (1 or more) |
Transactions before this one (by 1-based index in transactions list) that must be present in the final block if this one is |
→ → →fee |
number | Required (exactly 1) |
The difference in value between transaction inputs and outputs (in duffs). For coinbase transactions, this is a negative number of the total collected block fees (ie., not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn’t one |
→ → →sigops |
number | Required (exactly 1) |
Total SigOps. If not present, the count is unknown (clients MUST NOT assume there aren’t any) |
→ → →required |
boolean | Optional (exactly 1) |
If provided and true, this transaction must be in the final block |
→coinbaseaux |
object | Required (exactly 1) |
A object containing data that should be included in the coinbase scriptSig content |
→ → Flags |
string | Required (0 or more) |
|
→coinbasevalue |
number | Required (exactly 1) |
The maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs) |
→coinbasetxn |
object | Required (exactly 1) |
Information for the coinbase transaction) |
→target |
string | Required (exactly 1) |
The hash target |
→mintime |
number | Required (exactly 1) |
The minimum timestamp appropriate for next block time in seconds since epoch |
→mutable |
array (string) | Required (exactly 1) |
The list of ways the block template may be changed |
→ → Value |
string | Required (0 or more) |
A way the block template may be changed, e.g. ‘time’, ‘transactions’, ‘prevblock’ |
→noncerange |
string | Required (exactly 1) |
A range of valid nonces |
→sigoplimit |
number | Required (exactly 1) |
The limit of sigops in blocks |
→sizelimit |
number | Required (exactly 1) |
The limit of block size |
→curtime |
number | Required (exactly 1) |
The current timestamp in seconds since epoch |
→bits |
string | Required (exactly 1) |
The compressed target of next block |
→height |
number | Required (exactly 1) |
The height of the next block |
→masternode |
object | Required (exactly 1) |
The masternode payee that must be included in the next block |
→ →payee |
string | Required (exactly 1) |
Payee address |
→ →script |
string | Required (exactly 1) |
Payee scriptPubKey |
→ →amount |
number | Required (exactly 1) |
Required amount to pay |
→masternode_payments_started |
boolean | Required (exactly 1) |
True if masternode payments started |
→masternode_payments_enforced |
boolean | Required (exactly 1) |
True if masternode payments enforced |
→superblock |
array (objects) | Required (0 or more) |
The superblock payees that must be included in the next block |
→ → Superblock Payee |
object | Optional (0 or more) | Object containing a superblock payee’s information |
→ → →payee |
string | Required (exactly 1) |
Payee address |
→ → →script |
string | Required (exactly 1) |
Payee scriptPubKey |
→ → →amount |
number | Required (exactly 1) |
Required amount to pay |
→superblocks_started |
boolean | Required (exactly 1) |
True if superblock payments started |
→superblocks_enabled |
boolean | Required (exactly 1) |
True if superblock payments enabled |
Example from Dash Core 0.12.2
dash-cli -testnet getblocktemplate
Result:
{
"capabilities": [
"proposal"
],
"version": 536870913,
"rules": [
"dip0001"
],
"vbavailable": {
"csv": 0
},
"vbrequired": 0,
"previousblockhash": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b\
11898a71ce",
"transactions": [
{
"data": "01000000013e9e7e2116d8546a54d8531092d50e2da705a6f229f91a6d129f\
3f3e529d2bdb010000006a473044022044569ec727012e06bd4fa853fdcb2d\
c268f193ca00b68649f3dee0c0ca3207ff02206dc8656025c2f503e58779e6\
8a14ed18a7134f2c7d2c4235269bd70a3d6d5bd301210226d4ce54b37c1886\
92844201edbfb19e37cdbe7138a133b92b7d3d43ec157da6feffffff02a00b\
d100000000001976a914d7b47d4b40a23c389f5a17754d7f60f511c7d0ec88\
ac43321005140000001976a914616fdfd6eae0548f0b0f51bef165974abc10\
511688ac1e1f0000",
"hash": "9fd01aafcb4c59741ddfef41da2ec0eb3e1cc5b740150320b29534abdcd67e77",
"depends": [
],
"fee": 226,
"sigops": 2
}
],
"coinbaseaux": {
"flags": ""
},
"coinbasevalue": 13230000226,
"longpollid": "000000003d5c325259275fbf51a5dd623a13aade887cf83e5fdc3b11898a\
71ce316",
"target": "00000001231e0000000000000000000000000000000000000000000000000000",
"mintime": 1507737402,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 40000,
"sizelimit": 2000000,
"curtime": 1507738818,
"bits": "1d01231e",
"height": 7967,
"masternode": {
"payee": "yaJc6tADbEjxQBAC69ugWNoTFpzxqkcgWd",
"script": "76a914996911b133d83de25d1f169c7046d74b728a757b88ac",
"amount": 6615000108
},
"masternode_payments_started": true,
"masternode_payments_enforced": true,
"superblock": [
],
"superblocks_started": true,
"superblocks_enabled": true
}
See also
- SetGenerate: enables or disables hashing to attempt to find the next block.
- GetMiningInfo: returns various mining-related information.
- SubmitBlock: accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs.
- PrioritiseTransaction: adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)
GetChainTips
The getchaintips
RPC returns information about the highest-height block (tip) of each local block chain.
Parameters: none
Result—an array of block chain tips
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of JSON objects, with each object describing a chain tip. At least one tip—the local best block chain—will always be present |
→ Tip |
object | Required (1 or more) |
An object describing a particular chain tip. The first object will always describe the active chain (the local best block chain) |
→ →height |
number (int) | Required (exactly 1) |
The height of the highest block in the chain. A new node with only the genesis block will have a single tip with height of 0 |
→ →hash |
string (hex) | Required (exactly 1) |
The hash of the highest block in the chain, encoded as hex in RPC byte order |
→difficulty |
number (real) | Required (exactly 1) |
The difficulty of the highest-height block in the best block chain (Added in Dash Core 0.12.1) |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex (Added in Dash Core 0.12.1) |
→ →branchlen |
number (int) | Required (exactly 1) |
The number of blocks that are on this chain but not on the main chain. For the local best block chain, this will be 0 ; for all other chains, it will be at least 1 |
→ →status |
string | Required (exactly 1) |
The status of this chain. Valid values are: • active for the local best block chain• invalid for a chain that contains one or more invalid blocks• headers-only for a chain with valid headers whose corresponding blocks both haven’t been validated and aren’t stored locally• valid-headers for a chain with valid headers whose corresponding blocks are stored locally, but which haven’t been fully validated• valid-fork for a chain which is fully validated but which isn’t part of the local best block chain (it was probably the local best block chain at some point)• unknown for a chain whose reason for not being the active chain is unknown |
Example from Dash Core 0.12.2
dash-cli -testnet getchaintips
[
{
"height": 4655,
"hash": "00000000629c276241d9526d85297f2675d6edebcc7fd0c39e8f4263d729b8c1",
"difficulty": 0.9622782802772231,
"chainwork": "000000000000000000000000000000000000000000000000000001f1e286e12a",
"branchlen": 0,
"status": "active"
}
]
See also
- GetBestBlockHash: returns the header hash of the most recent block on the best block chain.
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockChainInfo: provides information about the current state of the block chain.
GetConnectionCount
The getconnectioncount
RPC returns the number of connections to other nodes.
Parameters: none
Result—the number of connections to other nodes
Name | Type | Presence | Description |
---|---|---|---|
result |
number (int) | Required (exactly 1) |
The total number of connections to other nodes (both inbound and outbound) |
Example from Dash Core 0.12.2
dash-cli -testnet getconnectioncount
Result:
14
See also
- GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
- GetPeerInfo: returns data about each connected network node.
- GetNetworkInfo: returns information about the node’s connection to the network.
GetDifficulty
The getdifficulty
RPC returns the proof-of-work difficulty as a multiple of the minimum difficulty.
Parameters: none
Result—the current difficulty
Name | Type | Presence | Description |
---|---|---|---|
result |
number (real) | Required (exactly 1) |
The difficulty of creating a block with the same target threshold (nBits) as the highest-height block in the local best block chain. The number is a a multiple of the minimum difficulty |
Example from Dash Core 0.12.2
dash-cli -testnet getdifficulty
Result:
1.069156225528583
See also
- GetNetworkHashPS: returns the estimated network hashes per second based on the last n blocks.
- GetMiningInfo: returns various mining-related information.
GetGenerate
Requires wallet support.
Removed in Bitcoin Core 0.13.0.
The getgenerate
RPC returns if the server is set to generate coins or not.
Parameters: none
Result—whether the server is set to generate blocks
Name | Type | Presence | Description |
---|---|---|---|
result |
bool | Required (exactly 1) |
Set to true if the server is set to generate blocks; set to false if it is not |
Example from Dash Core 0.12.2
dash-cli -regtest getgenerate
Result:
false
See also
- Generate: mines blocks immediately (before the RPC call returns).
- GenerateToAddress: mines blocks immediately to a specified address.
- GetMiningInfo: returns various mining-related information.
- SetGenerate: enables or disables hashing to attempt to find the next block.
GetGovernanceInfo
The getgovernanceinfo
RPC returns an object containing governance parameters.
Parameters: none
Result—information about the governance system
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the governance system |
→governanceminquorum |
number (int) | Required (exactly 1) |
The absolute minimum number of votes needed to trigger a governance action |
→masternodewatchdogmaxseconds |
number (int) | Required (exactly 1) |
Sentinel watchdog expiration time in seconds |
→proposalfee |
number (int) | Required (exactly 1) |
The collateral transaction fee which must be paid to create a proposal in Dash |
→superblockcycle |
number (int) | Required (exactly 1) |
The number of blocks between superblocks |
→lastsuperblock |
number (int) | Required (exactly 1) |
The block number of the last superblock |
→nextsuperblock |
number (int) | Required (exactly 1) |
The block number of the next superblock |
→maxgovobjdatasize |
number (int) | Required (exactly 1) |
Added in Dash Core 0.12.2.2 The maximum governance object data size in bytes |
Example from Dash Core 0.12.2.2
dash-cli -testnet getgovernanceinfo
Result:
{
"governanceminquorum": 1,
"masternodewatchdogmaxseconds": 7200,
"proposalfee": 5.00000000,
"superblockcycle": 24,
"lastsuperblock": 52872,
"nextsuperblock": 52896,
"maxgovobjdatasize": 16384
}
See also:
- GObject: provides a set of commands for managing governance objects and displaying information about them.
GetHashesPerSec
Requires wallet support.
The
gethashespersec
RPC was removed in Bitcoin Core 0.11.0 and is not part of Dash.
See also
- Generate: mines blocks immediately (before the RPC call returns).
- GetMiningInfo: returns various mining-related information.
GetInfo
The getinfo
RPC prints various information about the node and the network.
Warning:
getinfo
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameters: none
Result—information about the node and network
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about this node and the network |
→version |
number (int) | Required (exactly 1) |
This node’s version of Bitcoin Core in its internal integer format. For example, Dash Core 0.12.2 has the integer version number 120200 |
→protocolversion |
number (int) | Required (exactly 1) |
The protocol version number used by this node. See the protocol versions section for more information |
→walletversion |
number (int) | Optional (0 or 1) |
The version number of the wallet. Only returned if wallet support is enabled |
→balance |
number (duffs) | Optional (0 or 1) |
The total balance of the wallet in duffs. Only returned if wallet support is enabled |
→privatesend_balance |
number (duffs) | Optional (0 or 1) |
The PrivateSend balance of the wallet in duffs. Only returned if wallet support is enabled (Added in Dash Core 0.11.0) |
→blocks |
number (int) | Required (exactly 1) |
The number of blocks in the local best block chain. A new node with only the hardcoded genesis block will return 0 |
→timeoffset |
number (int) | Required (exactly 1) |
The offset of the node’s clock from the computer’s clock (both in UTC) in seconds. The offset may be up to 4200 seconds (70 minutes) |
→connections |
number (int) | Required (exactly 1) |
The total number of open connections (both outgoing and incoming) between this node and other nodes |
→proxy |
string | Required (exactly 1) |
The hostname/IP address and port number of the proxy, if set, or an empty string if unset |
→difficulty |
number (real) | Required (exactly 1) |
The difficulty of the highest-height block in the local best block chain |
→testnet |
bool | Required (exactly 1) |
Set to true if this node is on testnet; set to false if this node is on mainnet or a regtest |
→keypoololdest |
number (int) | Optional (0 or 1) |
The date as Unix epoch time when the oldest key in the wallet key pool was created; useful for only scanning blocks created since this date for transactions. Only returned if wallet support is enabled |
→keypoolsize |
number (int) | Optional (0 or 1) |
The number of keys in the wallet keypool. Only returned if wallet support is enabled |
→unlocked_until |
number (int) | Optional (0 or 1) |
The Unix epoch time when the wallet will automatically re-lock. Only displayed if wallet encryption is enabled. Set to 0 if wallet is currently locked |
→paytxfee |
number (duffs) | Optional (0 or 1) |
The minimum fee to pay per kilobyte of transaction; may be 0 . Only returned if wallet support is enabled |
→relayfee |
number (duffs) | Required (exactly 1) |
The minimum fee a low-priority transaction must pay in order for this node to accept it into its memory pool |
→errors |
string | Required (exactly 1) |
A plain-text description of any errors this node has encountered or detected. If there are no errors, an empty string will be returned. This is not related to the JSON-RPC error field |
Example from Dash Core 0.12.2 with wallet support enabled
dash-cli -testnet getinfo
Result:
{
"version": 120200,
"protocolversion": 70208,
"walletversion": 61000,
"balance": 0.00000000,
"privatesend_balance": 0.00000000,
"blocks": 0,
"timeoffset": 0,
"connections": 0,
"proxy": "",
"difficulty": 0.000244140625,
"testnet": true,
"keypoololdest": 1507579068,
"keypoolsize": 617,
"unlocked_until": 0,
"paytxfee": 0.00000000,
"relayfee": 0.00010000,
"errors": ""
}
See also
- GetBlockChainInfo: provides information about the current state of the block chain.
- GetMemPoolInfo: returns information about the node’s current transaction memory pool.
- GetMiningInfo: returns various mining-related information.
- GetNetworkInfo: returns information about the node’s connection to the network.
- GetWalletInfo: provides information about the wallet.
GetMemoryInfo
Added in Bitcoin Core 0.14.0
Not implemented in Dash Core (as of 0.12.2)
GetMemPoolAncestors
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
GetMemPoolDescendants
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
GetMemPoolEntry
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
GetMemPoolInfo
The getmempoolinfo
RPC returns information about the node’s current transaction memory pool.
Parameters: none
Result—information about the transaction memory pool
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A object containing information about the memory pool |
→size |
number (int) | Required (exactly 1) |
The number of transactions currently in the memory pool |
→bytes |
number (int) | Required (exactly 1) |
The total number of bytes in the transactions in the memory pool |
→usage |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.11.0 Total memory usage for the mempool in bytes |
→maxmempool |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 Maximum memory usage for the mempool in bytes |
→mempoolminfee |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The lowest fee per kilobyte paid by any transaction in the memory pool |
Example from Dash Core 0.12.2
dash-cli -testnet getmempoolinfo
Result:
{
"size": 1,
"bytes": 3471,
"usage": 8544,
"maxmempool": 300000000,
"mempoolminfee": 0.00000000
}
See also
- GetBlockChainInfo: provides information about the current state of the block chain.
- GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.
- 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.
GetMiningInfo
The getmininginfo
RPC returns various mining-related information.
Parameters: none
Result—various mining-related information
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Various mining-related information |
→blocks |
number (int) | Required (exactly 1) |
The height of the highest block on the local best block chain |
→currentblocksize |
number (int) | Required (exactly 1) |
If generation was enabled since the last time this node was restarted, this is the size in bytes of the last block built by this node for header hash checking. Otherwise, the value 0 |
→currentblocktx |
number (int) | Required (exactly 1) |
If generation was enabled since the last time this node was restarted, this is the number of transactions in the last block built by this node for header hash checking. Otherwise, this is the value 0 |
→difficulty |
number (real) | Required (exactly 1) |
If generation was enabled since the last time this node was restarted, this is the difficulty of the highest-height block in the local best block chain. Otherwise, this is the value 0 |
→errors |
string | Required (exactly 1) |
A plain-text description of any errors this node has encountered or detected. If there are no errors, an empty string will be returned. This is not related to the JSON-RPC error field |
→genproclimit |
number (int) | Required (exactly 1) |
The processor limit for generation (-1 if no generation - see getgenerate or setgenerate calls). Removed in Bitcoin Core 0.13.0 |
→networkhashps |
number (int) | Required (exactly 1) |
An estimate of the number of hashes per second the network is generating to maintain the current difficulty. See the getnetworkhashps RPC for configurable access to this data |
→pooledtx |
number (int) | Required (exactly 1) |
The number of transactions in the memory pool |
→testnet |
bool | Required (exactly 1) |
Set to true if this node is running on testnet. Set to false if this node is on mainnet or a regtestRemoved in Bitcoin Core 0.14.0 |
→chain |
string | Required (exactly 1) |
Set to main for mainnet, test for testnet, and regtest for regtest |
→generate |
bool | Optional (0 or 1) |
Set to true if generation is currently enabled; set to false if generation is currently disabled. Only returned if the node has wallet support enabledRemoved in Bitcoin Core 0.13.0 |
Example from Dash Core 0.12.2
dash-cli getmininginfo
Result:
{
"blocks": 8036,
"currentblocksize": 0,
"currentblocktx": 0,
"difficulty": 0.8239043524175907,
"errors": "",
"genproclimit": 1,
"networkhashps": 22234635.4469006,
"pooledtx": 3,
"testnet": true,
"chain": "test",
"generate": false
}
See also
- GetMemPoolInfo: returns information about the node’s current transaction memory pool.
- GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.
- GetBlockTemplate: gets a block template or proposal for use with mining software.
- Generate: mines blocks immediately (before the RPC call returns).
GetNetTotals
The getnettotals
RPC returns information about network traffic, including bytes in, bytes out, and the current time.
Parameters: none
Result—the current bytes in, bytes out, and current time
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object containing information about the node’s network totals |
→totalbytesrecv |
number (int) | Required (exactly 1) |
The total number of bytes received since the node was last restarted |
→totalbytessent |
number (int) | Required (exactly 1) |
The total number of bytes sent since the node was last restarted |
→timemillis |
number (int) | Required (exactly 1) |
Unix epoch time in milliseconds according to the operating system’s clock (not the node adjusted time) |
→uploadtarget |
string : object |
Required (exactly 1) |
The upload target information |
→ →timeframe |
number (int) | Required (exactly 1) |
Length of the measuring timeframe in seconds (currently set to 24 hours) |
→ →target |
number (int) | Required (exactly 1) |
The maximum allowed outbound traffic in bytes (default is 0 ). Can be changed with -maxuploadtarget |
→ →target_reached |
bool | Required (exactly 1) |
Indicates if the target is reached. If the target is reached the node won’t serve SPV and historical block requests anymore |
→ →serve_historical_blocks |
bool | Required (exactly 1) |
Indicates if historical blocks are served |
→ →bytes_left_in_cycle |
number (int) | Required (exactly 1) |
Amount of bytes left in current time cycle. 0 is displayed if no upload target is set |
→ →time_left_in_cycle |
number (int) | Required (exactly 1) |
Seconds left in current time cycle. 0 is displayed if no upload target is set |
Example from Dash Core 0.12.2
dash-cli getnettotals
Result:
{
"totalbytesrecv": 4661588,
"totalbytessent": 2899423,
"timemillis": 1507815162756,
"uploadtarget": {
"timeframe": 86400,
"target": 0,
"target_reached": false,
"serve_historical_blocks": true,
"bytes_left_in_cycle": 0,
"time_left_in_cycle": 0
}
}
See also
- GetNetworkInfo: returns information about the node’s connection to the network.
- GetPeerInfo: returns data about each connected network node.
GetNetworkHashPS
The getnetworkhashps
RPC returns the estimated network hashes per second based on the last n blocks.
Parameter #1—number of blocks to average
Name | Type | Presence | Description |
---|---|---|---|
blocks |
number (int) | Optional (0 or 1) |
The number of blocks to average together for calculating the estimated hashes per second. Default is 120 . Use -1 to average all blocks produced since the last difficulty change |
Parameter #2—block height
Name | Type | Presence | Description |
---|---|---|---|
height |
number (int) | Optional (0 or 1) |
The height of the last block to use for calculating the average. Defaults to -1 for the highest-height block on the local best block chain. If the specified height is higher than the highest block on the local best block chain, it will be interpreted the same as -1 |
Result—estimated hashes per second
Name | Type | Presence | Description |
---|---|---|---|
result |
number (int) | Required (exactly 1) |
The estimated number of hashes per second based on the parameters provided. May be 0 (for Height=0 , the genesis block) or a negative value if the highest-height block averaged has a block header time earlier than the lowest-height block averaged |
Example from Dash Core 0.12.2
Get the average hashes per second for all the blocks since the last difficulty change before block 6000.
dash-cli -testnet getnetworkhashps -1 6000
Result:
22214011.90821117
See also
- GetDifficulty: returns the proof-of-work difficulty as a multiple of the minimum difficulty.
- GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
GetNetworkInfo
The getnetworkinfo
RPC returns information about the node’s connection to the network.
Parameters: none
Result—information about the node’s connection to the network
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about this node’s connection to the network |
→version |
number | Required (exactly 1) |
This node’s version of Dash Core in its internal integer format. For example, Dash Core 0.12.2 has the integer version number 120200 |
→subversion |
string | Required (exactly 1) |
The user agent this node sends in its version message |
→protocolversion |
number (int) | Required (exactly 1) |
The protocol version number used by this node. See the protocol versions section for more information |
→localservices |
string (hex) | Required (exactly 1) |
The services supported by this node as advertised in its version message |
→localrelay |
bool | Required (exactly 1) |
Added in Bitcoin Core 0.13.0 The services supported by this node as advertised in its version message |
→timeoffset |
number (int) | Required (exactly 1) |
The offset of the node’s clock from the computer’s clock (both in UTC) in seconds. The offset may be up to 4200 seconds (70 minutes) |
→connections |
number (int) | Required (exactly 1) |
The total number of open connections (both outgoing and incoming) between this node and other nodes |
→networks |
array | Required (exactly 1) |
An array with three objects: one describing the IPv4 connection, one describing the IPv6 connection, and one describing the Tor hidden service (onion) connection |
→ → Network |
object | Optional (0 to 3) |
An object describing a network. If the network is unroutable, it will not be returned |
→ → →name |
string | Required (exactly 1) |
The name of the network. Either ipv4 , ipv6 , or onion |
→ → →limited |
bool | Required (exactly 1) |
Set to true if only connections to this network are allowed according to the -onlynet Dash Core command-line/configuration-file parameter. Otherwise set to false |
→ → →reachable |
bool | Required (exactly 1) |
Set to true if connections can be made to or from this network. Otherwise set to false |
→ → →proxy |
string | Required (exactly 1) |
The hostname and port of any proxy being used for this network. If a proxy is not in use, an empty string |
→ → →proxy_randomize_credentials |
bool | Required (exactly 1) |
Added in Bitcoin Core 0.11.0 Set to true if randomized credentials are set for this proxy. Otherwise set to false |
→relayfee |
number (Dash) | Required (exactly 1) |
The minimum relay fee for non-free transactions in order for this node to accept it into its memory pool |
→localaddresses |
array | Required (exactly 1) |
An array of objects each describing the local addresses this node believes it listens on |
→ → Address |
object | Optional (0 or more) |
An object describing a particular address this node believes it listens on |
→ → →address |
string | Required (exactly 1) |
An IP address or .onion address this node believes it listens on. This may be manually configured, auto detected, or based on version messages this node received from its peers |
→ → →port |
number (int) | Required (exactly 1) |
The port number this node believes it listens on for the associated address . This may be manually configured, auto detected, or based on version messages this node received from its peers |
→ → →score |
number (int) | Required (exactly 1) |
The number of incoming connections during the uptime of this node that have used this address in their version message |
→warnings |
string | Required (exactly 1) |
Added in Bitcoin Core 0.11.0 A plain-text description of any network warnings. If there are no warnings, an empty string will be returned. |
Example from Dash Core 0.12.2
dash-cli getnetworkinfo
Result (actual addresses have been replaced with RFC5737 reserved addresses):
{
"version": 120200,
"subversion": "/Dash Core:0.12.2/",
"protocolversion": 70208,
"localservices": "0000000000000005",
"localrelay": true,
"timeoffset": 0,
"networkactive": true,
"connections": 9,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.00001000,
"localaddresses": [
{
"address": "192.0.2.113",
"port": 19999,
"score": 4
}
],
"warnings": ""
}
See also
- GetPeerInfo: returns data about each connected network node.
- GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
GetNewAddress
Requires wallet support.
The getnewaddress
RPC returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
Parameter #1—an account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Optional (0 or 1) |
The name of the account to put the address in. The default is the default account, an empty string (“”) |
Result—a dash address never previously returned
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base58) | Required (exactly 1) |
A P2PKH address which has not previously been returned by this RPC. The address will be marked as a receiving address in the wallet. The address may already have been part of the keypool, so other RPCs such as the dumpwallet RPC may have disclosed it previously. If the wallet is unlocked, its keypool will also be filled to its max (by default, 100 unused keys). If the wallet is locked and its keypool is empty, this RPC will fail |
Example from Dash Core 0.12.2
Create a new address in the “doc test” account:
dash-cli -testnet getnewaddress "doc test"
Result:
yPuNTqCGzXtU3eEV5jHvhhJkzEPyJLmVkb
See also
- GetAccountAddress: returns the current Dash address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address.
- GetRawChangeAddress: returns a new Dash address for receiving change. This is for use with raw transactions, not normal use.
- GetBalance: gets the balance in decimal dash across all accounts or for a particular account.
GetPeerInfo
The getpeerinfo
RPC returns data about each connected network node.
Parameters: none
Result—information about each currently-connected network node
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of objects each describing one connected node. If there are no connections, the array will be empty |
→ Node |
object | Optional (0 or more) |
An object describing a particular connected node |
→ →id |
number (int) | Required (exactly 1) |
The node’s index number in the local node address database |
→ →addr |
string | Required (exactly 1) |
The IP address and port number used for the connection to the remote node |
→ →addrlocal |
string | Optional (0 or 1) |
Our IP address and port number according to the remote node. May be incorrect due to error or lying. Most SPV nodes set this to 127.0.0.1:9999 |
→ →services |
string (hex) | Required (exactly 1) |
The services advertised by the remote node in its version message |
→ →lastsend |
number (int) | Required (exactly 1) |
The Unix epoch time when we last successfully sent data to the TCP socket for this node |
→ →lastrecv |
number (int) | Required (exactly 1) |
The Unix epoch time when we last received data from this node |
→ →bytessent |
number (int) | Required (exactly 1) |
The total number of bytes we’ve sent to this node |
→ →bytesrecv |
number (int) | Required (exactly 1) |
The total number of bytes we’ve received from this node |
→ →conntime |
number (int) | Required (exactly 1) |
The Unix epoch time when we connected to this node |
→ →timeoffset |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The time offset in seconds |
→ →pingtime |
number (real) | Required (exactly 1) |
The number of seconds this node took to respond to our last P2P ping message |
→ →minping |
number (real) | Optional (0 or 1) |
Updated in Bitcoin Core 0.13.0 The minimum observed ping time (if any at all) |
→ →pingwait |
number (real) | Optional (0 or 1) |
The number of seconds we’ve been waiting for this node to respond to a P2P ping message. Only shown if there’s an outstanding ping message |
→ →version |
number (int) | Required (exactly 1) |
The protocol version number used by this node. See the protocol versions section for more information |
→ →subver |
string | Required (exactly 1) |
The user agent this node sends in its version message. 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) |
→ →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 |
→ →banscore |
number (int) | Required (exactly 1) |
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 |
→ →synced_headers |
number (int) | Required (exactly 1) |
The highest-height header we have in common with this node based the last P2P headers message it sent us. If a headers message has not been received, this will be set to -1 |
→ →synced_blocks |
number (int) | Required (exactly 1) |
The highest-height block we have in common with this node based on P2P inv messages this node sent us. If no block inv messages 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 |
→ →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 |
→ →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 |
Example from Dash Core 0.12.2
dash-cli getpeerinfo
Result (edited to show only a single entry, with IP addresses changed to RFC5737 reserved IP addresses):
[
{
"id": 3,
"addr": "192.0.2.113:19999",
"addrlocal": "127.0.0.1:56332",
"services": "0000000000000005",
"relaytxes": true,
"lastsend": 1507818327,
"lastrecv": 1507818327,
"bytessent": 844135,
"bytesrecv": 887651,
"conntime": 1507808575,
"timeoffset": 0,
"pingtime": 0.189852,
"minping": 0.187152,
"version": 70208,
"subver": "/Dash Core:0.12.2/",
"inbound": false,
"startingheight": 8416,
"banscore": 0,
"synced_headers": 8474,
"synced_blocks": 8474,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 165,
"dseg": 65,
"dsq": 33984,
"getaddr": 24,
"getdata": 73261,
"getheaders": 861,
"getsporks": 48,
"govobj": 20244,
"govobjvote": 22196,
"govsync": 545682,
"headers": 106,
"inv": 139035,
"mnget": 28,
"notfound": 1220,
"ping": 2624,
"pong": 2624,
"sendheaders": 24,
"ssc": 1792,
"verack": 24,
"version": 128
},
"bytesrecv_per_msg": {
"addr": 4365,
"block": 22307,
"dsq": 33984,
"getdata": 10417,
"getheaders": 861,
"govobjvote": 179,
"govsync": 4620,
"headers": 6254,
"inv": 130964,
"mnp": 352,
"mnw": 600208,
"notfound": 31192,
"ping": 2624,
"pong": 2624,
"sendheaders": 24,
"spork": 2860,
"ssc": 33664,
"verack": 24,
"version": 128
}
},
]
See also
- GetAddedNodeInfo: returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the
addnode
RPC will have their information displayed. - GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
- GetNetworkInfo: returns information about the node’s connection to the network.
GetPoolInfo
The getpoolinfo
RPC returns an object containing mixing pool related information.
Parameters: none
Result—information about the mixing pool
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the mixing pool |
→state |
string | Required (exactly 1) |
Mixing pool state. Will be one of the following: • IDLE • QUEUE • ACCEPTING_ENTRIES • SIGNING • ERROR • SUCCESS • UNKNOWN |
→mixing_mode |
string | Required (exactly 1) |
Mixing mode - will be one of the following: • normal • multi-session |
→queue |
number (int) | Required (exactly 1) |
Queue size |
→entries |
number (int) | Required (exactly 1) |
The number of entries |
→status |
string | Required (exactly 1) |
A more detailed description of the current state |
→outpoint |
string (hex) | Optional (exactly 1) |
Previous output |
→addr |
string | Optional (exactly 1) |
Address |
→keys_left |
number (int) | Optional (exactly 1) |
The number of keys left in the local wallet |
→warnings |
number (int) | Optional (exactly 1) |
Warnings related to local wallet |
Example from Dash Core 0.12.2
dash-cli -testnet getpoolinfo
Result:
{
"state": "IDLE",
"mixing_mode": "normal",
"queue": 0,
"entries": 0,
"status": "PrivateSend is idle.",
"keys_left": 617,
"warnings": ""
}
{
"state": "QUEUE",
"mixing_mode": "normal",
"queue": 1,
"entries": 0,
"status": "Submitted to masternode, waiting in queue .",
"outpoint": "e3a6b7878a7e9413898bb379b323c521676f9d460db17ec3bf42d9ac0c9a432f-1",
"addr": "217.182.229.146:19999",
"keys_left": 571,
"warnings": ""
}
{
"state": "ERROR",
"mixing_mode": "normal",
"queue": 0,
"entries": 0,
"status": "PrivateSend request incomplete: Session timed out. Will retry...",
"keys_left": 571,
"warnings": ""
}
See also:
GetRawChangeAddress
Requires wallet support.
The getrawchangeaddress
RPC returns a new Dash address for receiving change. This is for use with raw transactions, not normal use.
Parameters: none
Result—a P2PKH address which can be used in raw transactions
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base58) | Required (exactly 1) |
A P2PKH address which has not previously been returned by this RPC. The address will be removed from the keypool but not marked as a receiving address, so RPCs such as the dumpwallet RPC will show it as a change address. The address may already have been part of the keypool, so other RPCs such as the dumpwallet RPC may have disclosed it previously. If the wallet is unlocked, its keypool will also be filled to its max (by default, 100 unused keys). If the wallet is locked and its keypool is empty, this RPC will fail |
Example from Dash Core 0.12.2
dash-cli -testnet getrawchangeaddress
Result:
yXBr9BiJmugTzHPgByDmvjJMAkvhTmXVJ8
See also
- GetNewAddress: returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
- GetAccountAddress: returns the current Dash address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address.
GetRawMemPool
The getrawmempool
RPC returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.
Parameter—desired output format
Name | Type | Presence | Description |
---|---|---|---|
Format | bool | Optional (0 or 1) |
Set to true to get verbose output describing each transaction in the memory pool; set to false (the default) to only get an array of TXIDs for transactions in the memory pool |
Result (format false
)—an array of TXIDs
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of TXIDs belonging to transactions in the memory pool. The array may be empty if there are no transactions in the memory pool |
→ TXID |
string | Optional (0 or more) |
The TXID of a transaction in the memory pool, encoded as hex in RPC byte order |
Result (format: true
)—a JSON object describing each transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A object containing transactions currently in the memory pool. May be empty |
→ TXID |
string : object | Optional (0 or more) |
The TXID of a transaction in the memory pool, encoded as hex in RPC byte order |
→ →size |
number (int) | Required (exactly 1) |
The size of the serialized transaction in bytes |
→ →fee |
amount (Dash) | Required (exactly 1) |
The transaction fee paid by the transaction in decimal Dash |
→ →modifiedfee |
amount (Dash) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The transaction fee with fee deltas used for mining priority in decimal Dash |
→ →time |
number (int) | Required (exactly 1) |
The time the transaction entered the memory pool, Unix epoch time format |
→ →height |
number (int) | Required (exactly 1) |
The block height when the transaction entered the memory pool |
→ →startingpriority |
number (int) | Required (exactly 1) |
The priority of the transaction when it first entered the memory pool |
→ →currentpriority |
number (int) | Required (exactly 1) |
The current priority of the transaction |
→ →descendantcount |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The number of in-mempool descendant transactions (including this one) |
→ →descendantsize |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The size of in-mempool descendants (including this one) |
→ →descendantfees |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The modified fees (see modifiedfee above) of in-mempool descendants (including this one) |
→ →depends |
array | Required (exactly 1) |
An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty |
→ → → Depends TXID |
string | Optional (0 or more) | The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order |
Changes from Bitcoin - Following items not present in Dash result
Name | Type | Presence | Description |
---|---|---|---|
→ TXID→ancestorcount |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.13.0 The number of in-mempool ancestor transactions (including this one) |
→ TXID→ancestorsize |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.13.0 The size of in-mempool ancestors (including this one) |
→ TXID→ancestorfees |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.13.0 The modified fees (see modifiedfee above) of in-mempool ancestors (including this one) |
Examples from Dash Core 0.12.2
The default (false
):
dash-cli getrawmempool
Result:
[
"9dc994e03e387ff2d2709fbe86edede9f3d7aaddea7f75694495e415561b22fe"
]
Verbose output (true
):
dash-cli getrawmempool true
Result:
{
"286b3ec21e6ce5463fc712c98d86e02353525e09452113836651f3f91e562354": {
"size": 225,
"fee": 0.00000225,
"modifiedfee": 0.00000225,
"time": 1507735322,
"height": 7940,
"startingpriority": 0,
"currentpriority": 0,
"descendantcount": 4,
"descendantsize": 901,
"descendantfees": 902,
"depends": [
"2aacf53e0e15d3b4d778837792c7b6bd298edd3c41a0608586bdec41adcfe7c4"
]
}
}
See also
- GetMemPoolInfo: returns information about the node’s current transaction memory pool.
- GetMemPoolEntry: returns mempool data for given transaction (must be in mempool).
- 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.
GetRawTransaction
The getrawtransaction
RPC 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.
Note: if you begin using txindex=1
after downloading the block chain, you must rebuild your indexes by starting Bitcoin Core with the option -reindex
. This may take several hours to complete, during which time your node will not process new blocks or transactions. This reindex only needs to be done once.
Parameter #1—the TXID of the transaction to get
Name | Type | Presence | Description |
---|---|---|---|
TXID | string (hex) | Required (exactly 1) |
The TXID of the transaction to get, encoded as hex in RPC byte order |
Parameter #2—whether to get the serialized or decoded transaction
Name | Type | Presence | Description |
---|---|---|---|
Format | bool | Optional (0 or 1) |
For Dash: Set to 0 (the default) to return the serialized transaction as hex. Set to 1 to return a decoded transaction.Updated in Bitcoin Core 0.14.0 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 |
Result (if transaction not found)—null
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
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 |
Result (if verbose=false
)—the serialized transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex) | Required (exactly 1) |
If the transaction was found, this will be the serialized transaction encoded as hex |
Result (if verbose=true
)—the decoded transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
If the transaction was found, this will be an object describing it |
→hex |
string (hex) | Required (exactly 1) |
The serialized, hex-encoded data for the provided txid |
→txid |
string (hex) | Required (exactly 1) |
The transaction’s TXID encoded as hex in RPC byte order |
→size |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The serialized transaction size |
→version |
number (int) | Required (exactly 1) |
The transaction format version number |
→locktime |
number (int) | Required (exactly 1) |
The transaction’s locktime: either a Unix epoch date or block height; see the Locktime parsing rules |
→vin |
array | Required (exactly 1) |
An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0 |
→ → Input |
object | Required (1 or more) |
An object describing one of this transaction’s inputs. May be a regular input or a coinbase |
→ → →txid |
string | Optional (0 or 1) |
The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction |
→ → →vout |
number (int) | Optional (0 or 1) |
The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0 . Not present if this is a coinbase transaction |
→ → →scriptSig |
object | Optional (0 or 1) |
An object describing the signature script of this input. Not present if this is a coinbase transaction |
→ → → →asm |
string | Required (exactly 1) |
The signature script in decoded form with non-data-pushing opcodes listed |
→ → → →hex |
string (hex) | Required (exactly 1) |
The signature script encoded as hex |
→ → →coinbase |
string (hex) | Optional (0 or 1) |
The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction |
→ → →value |
number (Dash) | Optional (exactly 1) |
The number of Dash paid to this output. May be 0 .Only present if spentindex enabled |
→ → →valueSat |
number (duffs) | Optional (exactly 1) |
The number of duffs paid to this output. May be 0 .Only present if spentindex enabled |
→ → → →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.Only present if spentindex enabled |
→ → → → → Address |
string | Required (1 or more) |
A P2PKH or P2SH address |
→ → →sequence |
number (int) | Required (exactly 1) |
The input sequence number |
→vout |
array | Required (exactly 1) |
An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0 |
→ → Output |
object | Required (1 or more) |
An object describing one of this transaction’s outputs |
→ → →value |
number (Dash) | Required (exactly 1) |
The number of Dash paid to this output. May be 0 |
→ → →valueSat |
number (duffs) | Required (exactly 1) |
The number of duffs paid to this output. May be 0 |
→ → →n |
number (int) | Required (exactly 1) |
The output index number of this output within this 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) |
→ → → →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 | Required (1 or more) |
A P2PKH or P2SH address |
→blockhash |
string (hex) | Optional (0 or 1) |
If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order |
→confirmations |
number (int) | Required (exactly 1) |
If the transaction has been included in a block on the local best block chain, this is how many confirmations it has. Otherwise, this is 0 |
→time |
number (int) | Optional (0 or 1) |
If the transaction has been included in a block on the local best block chain, this is the block header time of that block (may be in the future) |
→blocktime |
number (int) | Optional (0 or 1) |
This field is currently identical to the time field described above |
Examples from Dash Core 0.12.2
A transaction in serialized transaction format:
dash-cli getrawtransaction \
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5
Result (wrapped):
01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41\
b69ec91e060100000069463043022033a61c56fa0867ed67b76b023204a9dc0e\
e6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4\
182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb3274\
9d79f53f6e8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa012000000\
1976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be0100\
00001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000
Get the same transaction in JSON:
dash-cli getrawtransaction \
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5 \
1
Result:
{
"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
}
See also
- GetTransaction: gets detailed information about an in-wallet transaction.
GetReceivedByAccount
Requires wallet support.
The getreceivedbyaccount
RPC returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions.
Warning:
getreceivedbyaccount
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—the account name
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Required (exactly 1) |
The name of the account containing the addresses to get. For the default account, use an empty string (“”) |
Parameter #2—the minimum number of confirmations
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #3—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions (default=false) |
Result—the number of dash received
Name | Type | Presence | Description |
---|---|---|---|
result |
number (dash) | Required (exactly 1) |
The number of dash received by the account. May be 0 |
Example from Dash Core 0.12.2
Get the dash received by the “doc test” account with six or more confirmations:
dash-cli -testnet getreceivedbyaccount "doc test" 6
Result:
0.30000000
See also
- GetReceivedByAddress: returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
- ListAccounts: lists accounts and their balances.
GetReceivedByAddress
Requires wallet support.
The getreceivedbyaddress
RPC returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
Parameter #1—the address
Name | Type | Presence | Description |
---|---|---|---|
Address | string | Required (exactly 1) |
The address whose transactions should be tallied |
Parameter #2—the minimum number of confirmations
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #3—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions |
Result—the amount of dash received
Name | Type | Presence | Description |
---|---|---|---|
result |
number (dash) | Required (exactly 1) |
The amount of dash received by the address, excluding coinbase transactions. May be 0 |
Example from Dash Core 0.12.2
Get the dash received for a particular address, only counting transactions with six or more confirmations (ignore InstantSend confirmations for locked InstantSend transactions):
dash-cli -testnet getreceivedbyaddress yYoCWcjbykWsQJ7MVJrTMeQd8TZe5N4Q7g 6
Result:
0.00000000
Get the dash received for a particular address, only counting transactions with six or more confirmations (include InstantSend confirmations for locked InstantSend transactions):
dash-cli -testnet getreceivedbyaddress yYoCWcjbykWsQJ7MVJrTMeQd8TZe5N4Q7g 6 true
Result:
0.30000000
See also
- GetReceivedByAccount: returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
- ListAccounts: lists accounts and their balances.
GetSpentInfo
Added in Dash Core 0.12.1
The getspentinfo
RPC returns the txid and index where an output is spent (requires spentindex
to be enabled).
Parameter #1—the TXID of the output
Name | Type | Presence | Description |
---|---|---|---|
TXID | string (hex) | Required (exactly 1) |
The TXID of the transaction containing the relevant output, encoded as hex in RPC byte order |
Parameter #2—the start block height
Name | Type | Presence | Description |
---|---|---|---|
Index | number (int) | Required (exactly 1) |
The block height to begin looking in |
Result—the TXID and spending input index
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
Information about the spent output. If output wasn’t found or if an error occurred, this will be JSON null |
→txid |
string | Required (exactly 1) |
The output txid |
→index |
number | Required (exactly 1) |
The spending input index |
Example from Dash Core 0.12.2
Get the txid and index where an output is spent:
dash-cli getspentinfo \
'''
{
"txid": "0456aaf51a8df21dd47c2a06ede046a5bf7403bcb95d14d1d71b178c189fb933", \
"index": 0
}
Result:
{
"txid": "14e874421350840e9d43965967c5a989e7d41ad361ef37484ee67d01d433ecfa",
"index": 1,
"height": 7742
}
See also: none
GetSuperblockBudget
The getsuperblockbudget
RPC returns the absolute maximum sum of superblock payments allowed.
Parameter #1—block index
Name | Type | Presence | Description |
---|---|---|---|
index | number (int) | Required (exactly 1) |
The superblock index |
Result—maximum sum of superblock payments
Name | Type | Presence | Description |
---|---|---|---|
result |
number (int) | Required (exactly 1) |
The absolute maximum sum of superblock payments allowed, in DASH |
Example from Dash Core 0.12.2
dash-cli -testnet getsuperblockbudget 7392
Result:
367.20
See also:
- GetGovernanceInfo: returns an object containing governance parameters.
GetTransaction
Requires wallet support.
The gettransaction
RPC gets detailed information about an in-wallet transaction.
Parameter #1—a transaction identifier (TXID)
Name | Type | Presence | Description |
---|---|---|---|
TXID | string (hex) | Required (exactly 1) |
The TXID of the transaction to get details about. The TXID must be encoded as hex in RPC byte order |
Parameter #2—whether to include watch-only addresses in details and calculations
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—a description of the transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object describing how the transaction affects the wallet |
→amount |
number (dash) | Required (exactly 1) |
A positive number of dash if this transaction increased the total wallet balance; a negative number of dash if this transaction decreased the total wallet balance, or 0 if the transaction had no net effect on wallet balance |
→fee |
number (dash) | Optional (0 or 1) |
If an outgoing transaction, this is the fee paid by the transaction reported as negative dash |
→instantlock |
bool | Required (exactly 1) |
Current transaction lock state |
→ confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transaction has received. Will be 0 for unconfirmed and -1 for conflicted |
→ 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 |
→ blockindex |
number (int) | Optional (0 or 1) |
The index of the transaction in the block that includes it. Only returned for confirmed transactions |
→ blocktime |
number (int) | Optional (0 or 1) |
The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions |
→ txid |
string (hex) | Required (exactly 1) |
The TXID of the transaction, encoded as hex in RPC byte order |
→ walletconflicts |
array | Required (exactly 1) |
An array containing the TXIDs of other transactions that spend the same inputs (UTXOs) as this transaction. Array may be empty |
→ → TXID |
string (hex) | Optional (0 or more) |
The TXID of a conflicting transaction, encoded as hex in RPC byte order |
→ time |
number (int) | Required (exactly 1) |
A Unix epoch time when the transaction was added to the wallet |
→ timereceived |
number (int) | Required (exactly 1) |
A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction |
→ bip125-replaceable |
string | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 Indicates if a transaction is replaceable under BIP 125: • yes is replaceable• no not replaceable• unknown for unconfirmed transactions not in the mempool |
→ comment |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction. Only returned if a comment was added |
→ to |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction identifying who the transaction was sent to. Only returned if a comment-to was added |
→DS |
bool | Optional (0 or 1) |
Set to 1 if a PrivateSend transaction |
→details |
array | Required (exactly 1) |
An array containing one object for each input or output in the transaction which affected the wallet |
→ → involvesWatchonly |
bool | Optional (0 or 1) |
Set to true if the input or output involves a watch-only address. Otherwise not returned |
→ →account |
string | Required (exactly 1) |
The account which the payment was credited to or debited from. May be an empty string (“”) for the default account |
→ →address |
string (base58) | Optional (0 or 1) |
If an output, the address paid (may be someone else’s address not belonging to this wallet). If an input, the address paid in the previous output. May be empty if the address is unknown, such as when paying to a non-standard pubkey script |
→ →category |
string | Required (exactly 1) |
Set to one of the following values: • send if sending payment normally• privatesend if sending PrivateSend payment• receive if this wallet received payment in a regular transaction• generate if a matured and spendable coinbase• immature if a coinbase that is not spendable yet• orphan if a coinbase from a block that’s not in the local best block chain |
→ →amount |
number (dash) | Required (exactly 1) |
A negative dash amount if sending payment; a positive dash amount if receiving payment (including coinbases) |
→ →vout |
number (int) | Required (exactly 1) |
For an output, the output index (vout) for this output in this transaction. For an input, the output index for the output being spent in its transaction. Because inputs list the output indexes from previous transactions, more than one entry in the details array may have the same output index |
→ →fee |
number (dash) | Optional (0 or 1) |
If sending payment, the fee paid as a negative dash value. May be 0 . Not returned if receiving payment |
→ →abandoned |
bool | Optional (0 or 1) |
Added in Bitcoin Core 0.12.1 Indicates if a transaction is was abandoned: • true if it was abandoned (inputs are respendable)• false if it was not abandonedOnly returned by send category payments |
→hex |
string (hex) | Required (exactly 1) |
The transaction in serialized transaction format |
Example from Dash Core 0.12.2
dash-cli -testnet gettransaction \
345d5f708b047b145f6a40a4e1e36c76648611cd009bd073e607c8ddf47bb797
Result:
{
"amount": 0.00000000,
"fee": -0.00010000,
"confirmations": 20,
"instantlock": false,
"trusted": true,
"txid": "345d5f708b047b145f6a40a4e1e36c76648611cd009bd073e607c8ddf47bb797",
"walletconflicts": [
],
"time": 1511967821,
"timereceived": 1511967821,
"bip125-replaceable": "no",
"DS": "1",
"details": [
{
"account": "",
"address": "ybTSbNqB7nG4ZVbHyati6GbfFz5w7tDnHf",
"category": "privatesend",
"amount": -10.00000000,
"label": "PS",
"vout": 0,
"fee": -0.00010000,
"abandoned": false
},
{
"account": "PS",
"address": "ybTSbNqB7nG4ZVbHyati6GbfFz5w7tDnHf",
"category": "receive",
"amount": 10.00000000,
"label": "PS",
"vout": 0
}
],
"hex": "010000000156d338508686982770a101c9fd41ce8b2c6ff4eb17dac6b1e7a32dfc5d2ae6e9030000006b4830450221008e8bf68440818d2b2fe8bcc2447d3b455f4e27864dae3f2bc62d2c8d1fdadaad0220390a0810f7f75436a7ebb0bc5c5a5e377b2330e1395f42b5f96d249ac9705ffc012103f4398f7e93dcc64a24191dbae57ef1ccbfcbd867f39a714020e66cf5b10050c4feffffff0100ca9a3b000000001976a914a60d00463c9eed290555e8f719333fc6b21c636088ac89850000"
}
See also
- 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.
GetTxOut
The gettxout
RPC returns details about an unspent transaction output (UTXO).
Parameter #1—the TXID of the output to get
Name | Type | Presence | Description |
---|---|---|---|
TXID | string (hex) | Required (exactly 1) |
The TXID of the transaction containing the output to get, encoded as hex in RPC byte order |
Parameter #2—the output index number (vout) of the output to get
Name | Type | Presence | Description |
---|---|---|---|
Vout | number (int) | Required (exactly 1) |
The output index number (vout) of the output within the transaction; the first output in a transaction is vout 0 |
Parameter #3—whether to display unconfirmed outputs from the memory pool
Name | Type | Presence | Description |
---|---|---|---|
Unconfirmed | bool | Optional (0 or 1) |
Set to true to display unconfirmed outputs from the memory pool; set to false (the default) to only display outputs from confirmed transactions |
Result—a description of the output
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
Information about the output. If output wasn’t found, if it was spent, or if an error occurred, this will be JSON null |
→bestblock |
string (hex) | Required (exactly 1) |
The hash of the header of the block on the local best block chain which includes this transaction. The hash will encoded as hex in RPC byte order. If the transaction is not part of a block, the string will be empty |
→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations received for the transaction containing this output or 0 if the transaction hasn’t been confirmed yet |
→value |
number (Dash) | Required (exactly 1) |
The amount of Dash spent to this output. May be 0 |
→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) |
→ →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 | Required (1 or more) |
A P2PKH or P2SH address |
→version |
number (int) | Required (exactly 1) |
The transaction version number of the transaction containing the pubkey script |
→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 |
Example from Dash Core 0.12.2
Get the UTXO from the following transaction from the first output index (“0”), searching the memory pool if necessary.
dash-cli -testnet gettxout \
e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f \
0 true
Result:
{
"bestblock": "000000005651f6d7859793dee07d476a2f2a7338e66bbb41caf4b544c5b0318d",
"confirmations": 2,
"value": 25.00000000,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 b66266c5017a759817f3bb99e8d9124bf5bb2e74 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914b66266c5017a759817f3bb99e8d9124bf5bb2e7488ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"ycwoiAibTjpwnoCZSX7S4kiB2H8wULw9qo"
]
},
"version": 1,
"coinbase": false
}
See also
- 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. - GetTransaction: gets detailed information about an in-wallet transaction.
GetTxOutProof
The gettxoutproof
RPC returns a hex-encoded proof that one or more specified transactions were included in a block.
NOTE: By default this function only works when there is an
unspent output in the UTXO set for this transaction. To make it always work,
you need to maintain a transaction index, using the -txindex
command line option, or
specify the block in which the transaction is included in manually (by block header hash).
Parameter #1—the transaction hashes to prove
Name | Type | Presence | Description |
---|---|---|---|
TXIDs | array | Required (exactly 1) |
A JSON array of txids to filter |
→txid |
string | Required (1 or more) |
TXIDs of the transactions to generate proof for. All transactions must be in the same block |
Parameter #2—the block to look for txids in
Name | Type | Presence | Description |
---|---|---|---|
Header hash | string | Optional (0 or 1) |
If specified, looks for txid in the block with this hash |
Result—serialized, hex-encoded data for the proof
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
A string that is a serialized, hex-encoded data for the proof |
Example from Dash Core 0.12.2
Get the hex-encoded proof that “txid” was included in block 000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f:
dash-cli gettxoutproof \
'''
[
"e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f"
]
''' \
'000000012d774f3c7668f32bc448efeb93b317f312dd863679de3a007d47817f'
Result (wrapped):
01000020ed72cc6a7294782a7711d8fa7ef74716ef062dc50bb0820f7eec923801000000\
aa5d17c5128043803b67c7ab03e4d3ffbc9604b54f877f1c5cf9ed3adeaa19b2cd7ed659\
f838011d10a70a480200000002033c89c2baecba9fc983c85dcf365c2d9cc93aca1dee2e\
5ac18124464056542e8faab0c579e651e9438c2904df5a498bc37a37acd528a251386fde\
f0476ba0e00105
See also
- VerifyTxOutProof: verifies that a proof points to one or more transactions in a block, returning the transactions the proof commits to and throwing an RPC error if the block is not in our best block chain.
merkleblock
message: A description of the format used for the proof.
GetTxOutSetInfo
The gettxoutsetinfo
RPC 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.
Parameters: none
Result—statistics about the UTXO set
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the UTXO set |
→height |
number (int) | Required (exactly 1) |
The height of the local best block chain. A new node with only the hardcoded genesis block will have a height of 0 |
→bestblock |
string (hex) | Required (exactly 1) |
The hash of the header of the highest block on the local best block chain, encoded as hex in RPC byte order |
→transactions |
number (int) | Required (exactly 1) |
The number of transactions with unspent outputs |
→txouts |
number (int) | Required (exactly 1) |
The number of unspent transaction outputs |
→bytes_serialized |
number (int) | Required (exactly 1) |
The size of the serialized UTXO set in bytes; not counting overhead, this is the size of the chainstate directory in the Bitcoin Core configuration directory |
→hash_serialized |
string (hex) | Required (exactly 1) |
A SHA256(SHA256()) hash of the serialized UTXO set; useful for comparing two nodes to see if they have the same set (they should, if they always used the same serialization format and currently have the same best block). The hash is encoded as hex in RPC byte order |
→total_amount |
number (Dash) | Required (exactly 1) |
The total amount of Dash in the UTXO set |
Example from Dash Core 0.12.2
dash-cli -testnet gettxoutsetinfo
Result:
{
"height": 4755,
"bestblock": "0000000025da0abc9e9937f1c65b3f544a57bb7e8817422f7ff2a89ff32696f4",
"transactions": 4748,
"txouts": 10602,
"bytes_serialized": 463925,
"hash_serialized": "fce0776d7961b409c4d8a46363c8d049879321861f7f40db97b0432e59532320",
"total_amount": 2243585.70000000
}
See also
- GetBlockChainInfo: provides information about the current state of the block chain.
- GetMemPoolInfo: returns information about the node’s current transaction memory pool.
GetUnconfirmedBalance
Requires wallet support.
The getunconfirmedbalance
RPC returns the wallet’s total unconfirmed balance.
Parameters: none
Result—the balance of unconfirmed transactions paying this wallet
Name | Type | Presence | Description |
---|---|---|---|
result |
number (dash) | Required (exactly 1) |
The total number of dash paid to this wallet in unconfirmed transactions |
Example from Dash Core 0.12.2
dash-cli -testnet getunconfirmedbalance
Result (no unconfirmed incoming payments):
0.00000000
See also
- GetBalance: gets the balance in decimal dash across all accounts or for a particular account.
GetWalletInfo
Requires wallet support.
The getwalletinfo
RPC provides information about the wallet.
Parameters: none
Result—information about the wallet
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object describing the wallet |
→walletversion |
number (int) | Required (exactly 1) |
The version number of the wallet |
→balance |
number (dash) | Required (exactly 1) |
The total confirmed balance of the wallet. The same as returned by the getbalance RPC with default parameters |
→unconfirmed_balance |
number (dash) | Required (exactly 1) |
The total unconfirmed balance of the wallet. The same as returned by the getunconfirmedbalance RPC with default parameters |
→immature_balance |
number (dash) | Required (exactly 1) |
The total immature balance of the wallet. This includes mining/masternode rewards that cannot be spent yet |
→txcount |
number (int) | Required (exactly 1) |
The total number of transactions in the wallet (both spends and receives) |
→keypoololdest |
number (int) | Required (exactly 1) |
The date as Unix epoch time when the oldest key in the wallet key pool was created; useful for only scanning blocks created since this date for transactions |
→keypoolsize |
number (int) | Required (exactly 1) |
The number of keys in the wallet keypool |
→keypoolsize_hd_internal |
number (int) | Optional (0 or 1) |
How many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used) |
→keys_left |
number (int) | Required (exactly 1) |
The number of unused keys left since the last automatic backup |
→unlocked_until |
number (int) | Optional (0 or 1) |
Only returned if the wallet was encrypted with the encryptwallet RPC. A Unix epoch date when the wallet will be locked, or 0 if the wallet is currently locked |
→paytxfee |
number (int) | Required (exactly 1) |
The transaction fee configuration, set in DASH/kB |
→hdchainid |
string (hash) | Optional (0 or 1) |
The ID of the HD chain |
→hdaccountcount |
number (int) | Optional (0 or 1) |
How many accounts of the HD chain are in this wallet |
→ →hdaccountcountindex |
number (int) | Optional (0 or 1) |
The index of the account |
→ →hdexternalkeyindex |
number (int) | Optional (0 or 1) |
Current external child key index |
→ →hdinternalkeyindex |
number (int) | Optional (0 or 1) |
Current internal child key index |
Example from Dash Core 0.12.2
dash-cli -testnet getwalletinfo
Result:
{
"walletversion": 61000,
"balance": 3000.00000000,
"unconfirmed_balance": 10.10000000,
"immature_balance": 11.25000000,
"txcount": 267,
"keypoololdest": 1508428379,
"keypoolsize": 999,
"keys_left": 978,
"unlocked_until": 0,
"paytxfee": 0.00000000
}
See also
- ListTransactions: returns the most recent transactions that affect the wallet.
GetWork
The
getwork
RPC was removed in Bitcoin Core 0.10.0. and is not part of Dash.
See also
- GetBlockTemplate: gets a block template or proposal for use with mining software.
- SubmitBlock: accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs.
GObject
The gobject
RPC provides a set of commands for managing governance objects and displaying information about them.
GObject Check
The gobject check
RPC validates governance object data (proposals only).
Parameter #1—object data (hex)
Name | Type | Presence | Description |
---|---|---|---|
data-hex |
string (hex) | Required (exactly 1) |
The data (hex) of a governance proposal object |
Result—governance object status
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Object containing status |
→Object Status |
string | Required (exactly 1) |
Status of the governance object |
Example from Dash Core 0.12.2
dash-cli -testnet gobject check 5b5b2270726f706f73616c222c7b22656e645f65706f\
6368223a2231353037343534383935222c226e616d65223a227465737470726f706f73616c5f\
2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839\
31353037323635383233222c227061796d656e745f61646472657373223a2279664e68484c4c\
695936577a5a646a51766137324a64395134313468516578514c68222c227061796d656e745f\
616d6f756e74223a2232222c2273746172745f65706f6368223a223135303732363538323322\
2c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472\
616c2e6f72672f702f746573745f70726f706f73616c5f31353037323635383233227d5d5d
Result:
{
"Object status": "OK"
}
GObject Prepare
The gobject prepare
RPC prepares a governance object by signing and creating a collateral transaction.
Parameter #1—parent hash
Name | Type | Presence | Description |
---|---|---|---|
parent-hash |
string (hex) | Required (exactly 1) |
Hash of the parent object. Usually the root node which has a hash of 0 |
Parameter #2—revision
Name | Type | Presence | Description |
---|---|---|---|
revision |
int | Required (exactly 1) |
Object revision number |
Parameter #3—time
Name | Type | Presence | Description |
---|---|---|---|
time |
int64_t | Required (exactly 1) |
Create time |
Parameter #4—data
Name | Type | Presence | Description |
---|---|---|---|
data |
string (hex) | Required (exactly 1) |
Object data (JSON object with governance details) |
Result—collateral transaction ID
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex) | Required (exactly 1) |
Transaction ID for the collateral transaction |
Example from Dash Core 0.12.2
dash-cli -testnet gobject prepare 0 1 1509548445 5b5b2270726f706f73616c222c7b22656e645f65706f6\
368223a313530393638303337392c226e616d65223a22746573742d70726f706f73616c2d646\
173682d646f6373222c227061796d656e745f61646472657373223a2279554b447a353950745\
0577348596b56346537424337416263454c72346a52787371222c227061796d656e745f616d6\
f756e74223a32302c2273746172745f65706f6368223a313530393637363831342c227479706\
5223a312c2275726c223a2268747470733a2f2f646173682d646f63732e746573742f7465737\
4227d5d5d
Result (Collateral Transaction ID):
061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b
GObject Submit
The gobject submit
RPC submits a governance object to network (objects must first be prepared via gobject prepare
).
Parameter #1—parent hash
Name | Type | Presence | Description |
---|---|---|---|
parent-hash |
string (hex) | Required (exactly 1) |
Hash of the parent object. Usually the root node which has a hash of 0 |
Parameter #2—revision
Name | Type | Presence | Description |
---|---|---|---|
revision |
int | Required (exactly 1) |
Object revision number |
Parameter #3—time
Name | Type | Presence | Description |
---|---|---|---|
time |
int64_t | Required (exactly 1) |
Create time |
Parameter #4—data
Name | Type | Presence | Description |
---|---|---|---|
data |
string (hex) | Required (exactly 1) |
Object data (JSON object with governance details) |
Parameter #5—transaction ID
Name | Type | Presence | Description |
---|---|---|---|
data |
string (hex) | Required (exactly 1) |
Collateral transaction ID |
Result—governance object hash
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex) | Required (exactly 1) |
Governance object hash |
Example from Dash Core 0.12.2
dash-cli -testnet gobject submit 0 1 1509548445 5b5b2270726f706f73616c222c7b22656e645f65706f6\
368223a313530393638303337392c226e616d65223a22746573742d70726f706f73616c2d646\
173682d646f6373222c227061796d656e745f61646472657373223a2279554b447a353950745\
0577348596b56346537424337416263454c72346a52787371222c227061796d656e745f616d6\
f756e74223a32302c2273746172745f65706f6368223a313530393637363831342c227479706\
5223a312c2275726c223a2268747470733a2f2f646173682d646f63732e746573742f7465737\
4227d5d5d 061ec99eb641ffdeaa05a1a724a255103bebc445b15c6c8c028b19c08608496b
Result (Governance Object Hash):
75e991c86ed5a50305e315e00c9a95fc74841bd97d58391071edc9ff206a0d3c
GObject Deserialize
The gobject deserialize
RPC deserializes a governance object from a hex string to JSON.
Parameter #1—object data (hex)
Name | Type | Presence | Description |
---|---|---|---|
data-hex |
string (hex) | Required (exactly 1) |
The data (hex) of a governance object |
Results
The result output varies depending on the type of governance object being deserialized. Examples are shown below for both proposal and trigger object types.
Result - Proposal
Result—governance proposal object deserialized to JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Array of governance objects |
→proposal |
string (hex) | Required (exactly 1) |
Proposal object |
→ →end_epoch |
string | Required (exactly 1) |
Governance object info as string |
→ →name |
string (hex) | Required (exactly 1) |
Proposal name |
→ →payment_address |
string (hex) | Required (exactly 1) |
Proposal payment address |
→ →payment_amount |
string | Required (exactly 1) |
Proposal payment amount |
→ →start_epoch |
string (hex) | Required (exactly 1) |
Proposal start |
→ →type |
int | Required (exactly 1) |
Object type |
→ →url |
string | Required (exactly 1) |
Proposal URL |
Example from Dash Core 0.12.2
dash-cli -testnet gobject deserialize 5b5b2270726f706f73616c222c7b22656e645f6\
5706f6368223a2231353037343534383935222c226e616d65223a227465737470726f706f7361\
6c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373\
83931353037323635383233222c227061796d656e745f61646472657373223a2279664e68484c\
4c695936577a5a646a51766137324a64395134313468516578514c68222c227061796d656e745\
f616d6f756e74223a2232222c2273746172745f65706f6368223a223135303732363538323322\
2c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e74726\
16c2e6f72672f702f746573745f70726f706f73616c5f31353037323635383233227d5d5d
Result:
[
[
"proposal",
{
"end_epoch":"1507454895",
"name":"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507265823",
"payment_address":"yfNhHLLiY6WzZdjQva72Jd9Q414hQexQLh",
"payment_amount":"2",
"start_epoch":"1507265823",
"type":1,
"url":"https://www.dashcentral.org/p/test_proposal_1507265823"
}
]
]
Result - Trigger
Result—governance trigger object deserialized to JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Array of governance objects |
→trigger |
string (hex) | Required (exactly 1) |
Trigger object |
→ →event_block_height |
int | Required (exactly 1) |
Block height to activate trigger |
→ →payment_addresses |
string (hex) | Required (exactly 1) |
Proposal payment address |
→ →payment_amounts |
string | Required (exactly 1) |
Proposal payment amount |
→ →proposal_hashes |
string (hex) | Required (exactly 1) |
Proposal hashes |
→ →type |
int | Required (exactly 1) |
Object type |
Example from Dash Core 0.12.2
dash-cli -testnet gobject deserialize 5b5b2274726967676572222c207b226576656e7\
45f626c6f636b5f686569676874223a2031383435362c20227061796d656e745f616464726573\
736573223a20227952465968665a4a4258567a3861696850365a7166714174374245316256644\
676567c79544c795070554668696768355270787a72695a6362474c5972527836687959455022\
2c20227061796d656e745f616d6f756e7473223a2022322e31323334353637387c322e3030303\
030303030222c202270726f706f73616c5f686173686573223a20223632623161336564633938\
37626432313134636439323263336339376166643039383339353534313862313730316330666\
131353262616662386131313735667c3138376337353166653631336434386139623331316161\
34383833383635666166396234336333623931333433333438326636636632343763313835656\
13037222c202274797065223a20327d5d5d
Result (wrapped):
[
[
"trigger",
{
"event_block_height":18456,
"payment_addresses":"yRFYhfZJBXVz8aihP6ZqfqAt7BE1bVdFvV\
|yTLyPpUFhigh5RpxzriZcbGLYrRx6hyYEP",
"payment_amounts":"2.12345678|2.00000000",
"proposal_hashes":"62b1a3edc987bd2114cd922c3c97afd0983955418b1701c0fa\
152bafb8a1175f|187c751fe613d48a9b311aa4883865faf9b43c3b913433482f6c\
f247c185ea07",
"type":2
}
]
]
GObject Count
The gobject count
RPC returns the count of governance objects and votes.
Parameters: none
Result—count of governance objects and votes
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The count of governance objects and votes |
Example from Dash Core 0.12.2
dash-cli -testnet gobject count
Result (wrapped):
Governance Objects: 177 (Proposals: 177, Triggers: 0, Watchdogs: 0/0, \
Other: 0; Erased: 5), Votes: 9680
GObject Get
The gobject get
RPC returns a governance object by hash.
Parameter #1—object hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
The hash of a governance object |
Result—governance object details
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Information about the governance object |
→DataHex |
string (hex) | Required (exactly 1) |
Governance object info as hex string |
→DataString |
string | Required (exactly 1) |
Governance object info as string |
→Hash |
string (hex) | Required (exactly 1) |
Hash of this governance object |
→CollateralHash |
string (hex) | Required (exactly 1) |
Hash of the collateral payment transaction |
→ObjectType |
number | Required (exactly 1) |
Object types:1 - Unknown2 - Proposal3 - Trigger4 - Watchdog |
→CreationTime |
number | Required (exactly 1) |
Object creation time as Unix epoch time |
→FundingResult |
object | Required (exactly 1) |
Funding vote details |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→ValidResult |
object | Required (exactly 1) |
Object validity vote details |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→DeleteResult |
object | Required (exactly 1) |
Delete vote details |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→EndorsedResult |
object | Required (exactly 1) |
Endorsed vote details |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→fLocalValidity |
boolean | Required (exactly 1) |
Valid by the blockchain |
→IsValidReason |
string | Required (exactly 1) |
fLocalValidity error result. Empty if no error returned. |
→fCachedValid |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc) |
→fCachedFunding |
boolean | Required (exactly 1) |
Minimum network support has been reached for this object to be funded (doesn’t mean it will be for sure though) |
→fCachedDelete |
boolean | Required (exactly 1) |
Minimum network support has been reached saying this object should be deleted from the system entirely |
→fCachedEndorsed |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as endorsed |
Example from Dash Core 0.12.2
dash-cli -testnet gobject get \
42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff
Result (wrapped):
{
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343339353130222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323530343338222c227061796d656e745f61646472657373223a22795668577955345933756456784d5234464b3333556741534a41436831436835516a222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323530343338222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323530343338227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507439510\",\"name\":\"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507250438\",\"payment_address\":\"yVhWyU4Y3udVxMR4FK33UgASJACh1Ch5Qj\",\"payment_amount\":\"2\",\"start_epoch\":\"1507250438\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507250438\"}]]",
"Hash": "42253a7bec554b97a65d2889e6cb9a1cf308b3d47a778c704bf9cdc1fe1bf6ff",
"CollateralHash": "cb09bd0310c0a67cde9387ad4d8908a7ad9f5d89c5afd58e9332b8bd26a646c7",
"ObjectType": 1,
"CreationTime": 1507246694,
"FundingResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"ValidResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"DeleteResult": {
"AbsoluteYesCount": 31,
"YesCount": 31,
"NoCount": 0,
"AbstainCount": 0
},
"EndorsedResult": {
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0
},
"fLocalValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
}
GObject Getvotes
The gobject getvotes
RPC gets all votes for a governance object hash (including old votes).
Parameter #1—object hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
The hash of a governance object |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The governance object votes |
→ Vote Info |
string | Required (1 or more) |
Key: vote-hash Value: vinMasternode, time, outcome, and signal of the vote |
Example from Dash Core 0.12.2
dash-cli -testnet gobject getvotes 78941af577f639ac94440e4855a1ed8f\
696f1506d1c0bed4f4b68f05be26d3ca
Result (truncated):
{
"174aaba65982d25a23f437e2a66ec3836146ba7b7ce5b3fe2d5476907f7079d9": "CTxIn(COutPoint(2eab488e3a7b030303de0d18e357ce17a9fc6b8876705d61076bbe923b2e5fc8, 1), scriptSig=):1509354047:YES:DELETE",
"216cbc42addec1a6b83e1f2b0b3779594bd879f5671dd76a9826cc690c68286d": "CTxIn(COutPoint(b0320c1eff10ccb5e26086017a09e77dacb30fdcafccb3d98db3e5b610b9f1bd, 1), scriptSig=):1509117256:YES:DELETE",
"aa4dc9d3b9e74e8c1ffc725b737d07f8a32e43c64907e4bea19e64a86135f08a": "CTxIn(COutPoint(af9f5646ace92f76b3a01b0abe08716a0a7ded64074c2d2e712c93174b9013d1, 1), scriptSig=):1508866932:YES:FUNDING",
"73dd135ea7bece0f2047de75d8ca04f2985daebed9568d28ee58a60a12a2a082": "CTxIn(COutPoint(8e3fee7f668fed7019588be616225c6c4762ee632470878b2dc8eae3f0b3f67d, 1), scriptSig=):1508866932:YES:FUNDING",
"d13b9c5c28bbc8684a7291961a1023abbbe65b534804d0629fb44166cc1a6148": "CTxIn(COutPoint(08b2dbffd61d927bc12c20f6853513f41fbf7737446632b13c7ca0df8c6da282, 1), scriptSig=):1508866932:YES:FUNDING",
"8a4283d457d8635b43c6fa6cbf865813a80d965c777e8ba07364eb6468200ae1": "CTxIn(COutPoint(76c40abd280441b75577e99e9e4f253f9281a7deb4feebff83860f9cede7a09b, 1), scriptSig=):1508866932:YES:FUNDING",
"313e19607813cb0db3b3fb477982b4d3418f13f8511295419df8fe1f7ff6668f": "CTxIn(COutPoint(0fd502f28b9a9a256d9ba29a047c375fe2823b6e76e4853af16e079a709ab72a, 1), scriptSig=):1508866932:YES:FUNDING"
}
GObject Getcurrentvotes
The gobject getcurrentvotes
RPC gets only current (tallying) votes for a governance object hash (does not include old votes).
Parameter #1—object hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
The hash of a governance object |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The governance object votes |
→ Vote Info |
string | Required (1 or more) |
Key: vote-hash Value: vinMasternode, time, outcome, and signal of the vote |
Example from Dash Core 0.12.2
dash-cli -testnet gobject getcurrentvotes 78941af577f639ac94440e4855a1ed8f\
696f1506d1c0bed4f4b68f05be26d3ca
Result (truncated):
{
"174aaba65982d25a23f437e2a66ec3836146ba7b7ce5b3fe2d5476907f7079d9": "CTxIn(COutPoint(2eab488e3a7b030303de0d18e357ce17a9fc6b8876705d61076bbe923b2e5fc8, 1), scriptSig=):1509354047:YES:DELETE",
"444d4d871ec35479804f060c733f516908382642ec2dfce6044a59fcadfdcd60": "CTxIn(COutPoint(18e496fe85b61ac9a5fcaec1ef683c7e3fc9bce4a83c883608427ecfb1002fca, 1), scriptSig=):1508866932:YES:FUNDING",
"d49a472c62e9d8105931829fc50ef6c6ce04a230507646ee0eaa615e863ef3a0": "CTxIn(COutPoint(18e496fe85b61ac9a5fcaec1ef683c7e3fc9bce4a83c883608427ecfb1002fca, 1), scriptSig=):1509117071:YES:DELETE",
"78442507441d4524d2493b8568d130415c1eb394adb2fe38d6ffeb199115bc5d": "CTxIn(COutPoint(3df7fb192e21c34da99bdd10c34e58ecaf3f3c37d6b2289f0ffedba5050188cc, 1), scriptSig=):1509312524:YES:DELETE",
"aa4dc9d3b9e74e8c1ffc725b737d07f8a32e43c64907e4bea19e64a86135f08a": "CTxIn(COutPoint(af9f5646ace92f76b3a01b0abe08716a0a7ded64074c2d2e712c93174b9013d1, 1), scriptSig=):1508866932:YES:FUNDING",
}
GObject List
The gobject list
RPC Lists governance objects (can be filtered by signal and/or object type).
Parameter #1—signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string (hex) | Optional (exactly 1) |
Type of governance object signal: • valid • funding • delete • endorsed • all (DEFAULT) |
Parameter #2—type
Name | Type | Presence | Description |
---|---|---|---|
type |
string (hex) | Optional (exactly 1) |
Type of governance object signal: • proposals • triggers • watchdogs • all (DEFAULT) |
Result—governance objects
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Information about the governance object |
→ Governance Object(s) |
object | Required (1 or more) |
Key: Governance object hash Values: Governance object details |
→ →DataHex |
string (hex) | Required (exactly 1) |
Governance object info as hex string |
→ →DataString |
string | Required (exactly 1) |
Governance object info as string |
→ →Hash |
string (hex) | Required (exactly 1) |
Hash of this governance object |
→ →CollateralHash |
string (hex) | Required (exactly 1) |
Hash of the collateral payment transaction |
→ →ObjectType |
number | Required (exactly 1) |
Object types:1 - Unknown2 - Proposal3 - Trigger4 - Watchdog |
→ →CreationTime |
number | Required (exactly 1) |
Object creation time as Unix epoch time |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→fLocalValidity |
boolean | Required (exactly 1) |
Valid by the blockchain |
→IsValidReason |
string | Required (exactly 1) |
fLocalValidity error result. Empty if no error returned. |
→fCachedValid |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc) |
→fCachedFunding |
boolean | Required (exactly 1) |
Minimum network support has been reached for this object to be funded (doesn’t mean it will be for sure though) |
→fCachedDelete |
boolean | Required (exactly 1) |
Minimum network support has been reached saying this object should be deleted from the system entirely |
→fCachedEndorsed |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as endorsed |
Example from Dash Core 0.12.2
dash-cli -testnet gobject list all proposals
Result (truncated):
{
"b370fa1afd61aca9aa879abea3087e29656a670478f281d4196efb4e7e893ffe": {
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343430303338222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323530393636222c227061796d656e745f61646472657373223a2279544c636f506d4e315963654432534345474d6b6e34395753565a4277626f646e6e222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323530393636222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323530393636227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507440038\",\"name\":\"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507250966\",\"payment_address\":\"yTLcoPmN1YceD2SCEGMkn49WSVZBwbodnn\",\"payment_amount\":\"2\",\"start_epoch\":\"1507250966\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507250966\"}]]",
"Hash": "b370fa1afd61aca9aa879abea3087e29656a670478f281d4196efb4e7e893ffe",
"CollateralHash": "a51ea89c14735f8b5df37cd846b3561494cc616d4a741e4ef83b368d45c960ba",
"ObjectType": 1,
"CreationTime": 1507250966,
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0,
"fBlockchainValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
},
"906ae4dbd285e1025832ac9b3160073ecbfeef094d34cf81b3d797a349c720ff": {
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343534383935222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323635383233222c227061796d656e745f61646472657373223a2279664e68484c4c695936577a5a646a51766137324a64395134313468516578514c68222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323635383233222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323635383233227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507454895\",\"name\":\"testproposal_-_abcdefghijklmnopqrstuvwxyz01234567891507265823\",\"payment_address\":\"yfNhHLLiY6WzZdjQva72Jd9Q414hQexQLh\",\"payment_amount\":\"2\",\"start_epoch\":\"1507265823\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507265823\"}]]",
"Hash": "906ae4dbd285e1025832ac9b3160073ecbfeef094d34cf81b3d797a349c720ff",
"CollateralHash": "1707470c4372ba048b72945365b4bb71afc8a986e0755c1f1e8a37bba21fde83",
"ObjectType": 1,
"CreationTime": 1507265823,
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0,
"fBlockchainValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
}
}
GObject Diff
The gobject diff
RPC Lists governance objects differences since last diff.
Parameter #1—signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string (hex) | Optional (exactly 1) |
Type of governance object signal: • valid • funding • delete • endorsed • all (DEFAULT) |
Parameter #2—type
Name | Type | Presence | Description |
---|---|---|---|
type |
string (hex) | Optional (exactly 1) |
Type of governance object signal: • proposals • triggers • watchdogs • all (DEFAULT) |
Result—governance objects
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Information about the governance object |
→ Governance Object(s) |
object | Required (1 or more) |
Key: Governance object hash Values: Governance object details |
→ →DataHex |
string (hex) | Required (exactly 1) |
Governance object info as hex string |
→ →DataString |
string | Required (exactly 1) |
Governance object info as string |
→ →Hash |
string (hex) | Required (exactly 1) |
Hash of this governance object |
→ →CollateralHash |
string (hex) | Required (exactly 1) |
Hash of the collateral payment transaction |
→ →ObjectType |
number | Required (exactly 1) |
Object types:1 - Unknown2 - Proposal3 - Trigger4 - Watchdog |
→ →CreationTime |
number | Required (exactly 1) |
Object creation time as Unix epoch time |
→ →AbsoluteYesCount |
number | Required (exactly 1) |
Number of Yes votes minus number of No votes |
→ →YesCount |
number | Required (exactly 1) |
Number of Yes votes |
→ →NoCount |
number | Required (exactly 1) |
Number of No votes |
→ →AbstainCount |
number | Required (exactly 1) |
Number of Abstain votes |
→fLocalValidity |
boolean | Required (exactly 1) |
Valid by the blockchain |
→IsValidReason |
string | Required (exactly 1) |
fLocalValidity error result. Empty if no error returned. |
→fCachedValid |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc) |
→fCachedFunding |
boolean | Required (exactly 1) |
Minimum network support has been reached for this object to be funded (doesn’t mean it will be for sure though) |
→fCachedDelete |
boolean | Required (exactly 1) |
Minimum network support has been reached saying this object should be deleted from the system entirely |
→fCachedEndorsed |
boolean | Required (exactly 1) |
Minimum network support has been reached flagging this object as endorsed |
Example from Dash Core 0.12.2
dash-cli -testnet gobject diff all all
Result (truncated):
{
"17c2bd32005c5168a52f9b5caa74d875ee8a6867a6109f36923887ef6c36b301": {
"DataHex": "5b5b2270726f706f73616c222c7b22656e645f65706f6368223a2231353037343533353731222c226e616d65223a227465737470726f706f73616c5f2d5f6162636465666768696a6b6c6d6e6f707172737475767778797a3031323334353637383931353037323634343939222c227061796d656e745f61646472657373223a2279697355653636445352487048504233514245426764574746637068435933626234222c227061796d656e745f616d6f756e74223a2232222c2273746172745f65706f6368223a2231353037323634343939222c2274797065223a312c2275726c223a2268747470733a2f2f7777772e6461736863656e7472616c2e6f72672f702f746573745f70726f706f73616c5f31353037323634343939227d5d5d",
"DataString": "[[\"proposal\",{\"end_epoch\":\"1507453571\",\"name\":\"testproposal\",\"payment_address\":\"yisUe66DSRHpHPB3QBEBgdWGFcphCY3bb4\",\"payment_amount\":\"2\",\"start_epoch\":\"1507264499\",\"type\":1,\"url\":\"https://www.dashcentral.org/p/test_proposal_1507264499\"}]]",
"Hash": "17c2bd32005c5168a52f9b5caa74d875ee8a6867a6109f36923887ef6c36b301",
"CollateralHash": "a25c44b57931afd74530ce39741f91456446a8fd794d2f1c58c42d6f492647ad",
"ObjectType": 1,
"CreationTime": 1507264499,
"AbsoluteYesCount": 0,
"YesCount": 0,
"NoCount": 0,
"AbstainCount": 0,
"fBlockchainValidity": true,
"IsValidReason": "",
"fCachedValid": true,
"fCachedFunding": false,
"fCachedDelete": false,
"fCachedEndorsed": false
}
}
GObject Vote-alias
The gobject vote-alias
RPC votes on a governance object by masternode alias (using masternode.conf setup).
Parameter #1—governance hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
Hash of the governance object |
Parameter #2—vote signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string | Required (exactly 1) |
Vote signal: funding , valid , or delete |
Parameter #3—vote outcome
Name | Type | Presence | Description |
---|---|---|---|
outcome |
string | Required (exactly 1) |
Vote outcome: yes , no , or abstain |
Parameter #4—masternode alias
Name | Type | Presence | Description |
---|---|---|---|
alias |
string | Required (exactly 1) |
Alias of voting masternode |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The governance object votes |
→overall |
string | Required (1 or more) |
Reports number of vote successes/failures |
→detail |
object | Required (exactly 1) |
Vote details |
→ → Masternode Alias |
object | Required (1 or more) |
Name of the masternode alias |
→ → →result |
string | Required (exactly 1) |
Vote result |
Example from Dash Core 0.12.2
dash-cli -testnet gobject vote-alias \
0bf97bce78b3b642c36d4ca8e9265f8f66de8774c220221f57739c1956413e2b \
funding yes MN01
Result:
{
"overall": "Voted successfully 1 time(s) and failed 0 time(s).",
"detail": {
"MN01": {
"result": "success"
}
}
}
GObject Vote-conf
The gobject vote-conf
RPC votes on a governance object by masternode configured in dash.conf.
Parameter #1—governance hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
Hash of the governance object |
Parameter #2—vote signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string | Required (exactly 1) |
Vote signal: funding , valid , or delete |
Parameter #3—vote outcome
Name | Type | Presence | Description |
---|---|---|---|
outcome |
string | Required (exactly 1) |
Vote outcome: yes , no , or abstain |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The governance object votes |
→overall |
string | Required (1 or more) |
Reports number of vote successes/failures |
→detail |
object | Required (exactly 1) |
Vote details |
→ →dash.conf |
object | Required (1 or more) |
|
→ → →result |
string | Required (exactly 1) |
Vote result |
Example from Dash Core 0.12.2
dash-cli -testnet gobject vote-conf \
0bf97bce78b3b642c36d4ca8e9265f8f66de8774c220221f57739c1956413e2b funding yes
{
"overall": "Voted successfully 1 time(s) and failed 0 time(s).",
"detail": {
"dash.conf": {
"result": "success"
}
}
}
GObject Vote-many
The gobject vote-many
RPC votes on a governance object by all masternodes (using masternode.conf setup).
Parameter #1—governance hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
Hash of the governance object |
Parameter #2—vote signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string | Required (exactly 1) |
Vote signal: funding , valid , or delete |
Parameter #3—vote outcome
Name | Type | Presence | Description |
---|---|---|---|
outcome |
string | Required (exactly 1) |
Vote outcome: yes , no , or abstain |
Parameter #4—masternode alias
Name | Type | Presence | Description |
---|---|---|---|
alias |
string | Required (exactly 1) |
Alias of voting masternode |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The governance object votes |
→overall |
string | Required (1 or more) |
Reports number of vote successes/failures |
→detail |
object | Required (exactly 1) |
Vote details |
→ → Masternode Alias |
object | Required (1 or more) |
Name of the masternode alias |
→ → →result |
string | Required (exactly 1) |
Vote result |
Example from Dash Core 0.12.2
dash-cli -testnet gobject vote-many \
0bf97bce78b3b642c36d4ca8e9265f8f66de8774c220221f57739c1956413e2b funding yes
{
"overall": "Voted successfully 1 time(s) and failed 0 time(s).",
"detail": {
"MN01": {
"result": "success"
}
}
}
See also:
- GetGovernanceInfo: returns an object containing governance parameters.
- GetSuperblockBudget: returns the absolute maximum sum of superblock payments allowed.
Help
The help
RPC lists all available public RPC commands, or gets help for the specified RPC. Commands which are unavailable will not be listed, such as wallet RPCs if wallet support is disabled.
Parameter—the name of the RPC to get help for
Name | Type | Presence | Description |
---|---|---|---|
RPC | string | Optional (0 or 1) |
The name of the RPC to get help for. If omitted, Dash Core 0.10x will display an alphabetical list of commands; Dash Core 0.11.0 will display a categorized list of commands |
Result—a list of RPCs or detailed help for a specific RPC
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The help text for the specified RPC or the list of commands. The dash-cli command will parse this text and format it as human-readable text |
Example from Dash Core 0.12.2
Command to get help about the help
RPC:
dash-cli -testnet help help
Result:
help ( "command" )
List all commands, or get help for a specified command.
Arguments:
1. "command" (string, optional) The command to get help on
Result:
"text" (string) The help text
See also
ImportAddress
Requires wallet support.
The importaddress
RPC 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.
Parameter #1—the address or pubkey script to watch
Name | Type | Presence | Description |
---|---|---|---|
Address or Script | string (base58 or hex) | Required (exactly 1) |
Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hex |
Parameter #2—The account into which to place the address or pubkey script
Name | Type | Presence | Description |
---|---|---|---|
Label | string | Optional (0 or 1) |
An optional label. Default is an empty string(“”) |
Parameter #3—whether to rescan the block chain
Name | Type | Presence | Description |
---|---|---|---|
Rescan | bool | Optional (0 or 1) |
Set to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transaction affecting the newly-added address or pubkey script). Set to false to not rescan the block database (rescanning can be performed at any time by restarting Dash Core with the -rescan command-line argument). Rescanning may take several minutes. |
Parameter #4—whether to rescan the block chain
Name | Type | Presence | Description |
---|---|---|---|
P2SH | bool | Optional (0 or 1) |
Add the P2SH version of the script as well |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If the address or pubkey script is added to the wallet (or is already part of the wallet), JSON null will be returned |
Example from Dash Core 0.12.2
Add an address, rescanning the local block database for any transactions matching it.
dash-cli -testnet importaddress \
yg89Yt5Tjzs9nRpX3wJCuvr7KuQvgkvmeC "watch-only test" true
Result:
(No output; success.)
Show that the address has been added:
dash-cli -testnet getaccount yg89Yt5Tjzs9nRpX3wJCuvr7KuQvgkvmeC
Result:
watch-only test
See also
- ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the
dumpprivkey
RPC. - ListReceivedByAddress: lists the total number of dash received by each address.
ImportElectrumWallet
The importelectrumwallet
RPC imports keys from an Electrum wallet export file (.csv or .json)
Parameter #1—file name
Name | Type | Presence | Description |
---|---|---|---|
File Name | string | Required (exactly 1) |
The Electrum wallet export file (should be in csv or json format) |
Parameter #2—index
Name | Type | Presence | Description |
---|---|---|---|
Index | number (int) | Optional (0 or 1) |
Rescan the wallet for transactions starting from this block index (default: 0) |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If the Electrum keys are imported successfully, JSON null will be returned |
Example from Dash Core 0.12.2
dash-cli importelectrumwallet /tmp/electrum-export.csv
(Success: no result displayed.)
See also: none
ImportMulti
Added in Bitcoin Core 0.14.0
Not implemented in Dash Core (as of 0.12.2)
ImportPrivKey
Requires wallet support. Wallet must be unlocked.
The importprivkey
RPC adds a private key to your wallet. The key should be formatted in the wallet import format created by the dumpprivkey
RPC.
Parameter #1—the private key to import
Name | Type | Presence | Description |
---|---|---|---|
Private Key | string (base58) | Required (exactly 1) |
The private key to import into the wallet encoded in base58check using wallet import format (WIF) |
Parameter #2—the account into which the key should be placed
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Optional (0 or 1) |
The name of an account to which transactions involving the key should be assigned. The default is the default account, an empty string (“”) |
Parameter #3—whether to rescan the block chain
Name | Type | Presence | Description |
---|---|---|---|
Rescan | bool | Optional (0 or 1) |
Set to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transaction affecting the newly-added address for this private key). Set to false to not rescan the block database (rescanning can be performed at any time by restarting Dash Core with the -rescan command-line argument). Rescanning may take several minutes. Notes: if the address for this key is already in the wallet, the block database will not be rescanned even if this parameter is set |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If the private key is added to the wallet (or is already part of the wallet), JSON null will be returned |
Example from Dash Core 0.12.2
Import the private key for the address ycBuREgSskHHkWLxDa9A5WppCki6PfFycL, giving it a label and scanning the entire block chain:
dash-cli -testnet importprivkey \
cQZZ4awQvcXXyES3CmUJqSgeTobQm9t9nyUr337kvUtsWsnvvMyw \
"test label" \
true
(Success: no result displayed.)
See also
- DumpPrivKey: returns the wallet-import-format (WIP) private key corresponding to an address. (But does not remove it from the wallet.)
- 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.
- ImportPubKey: imports a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend
- ImportWallet: imports private keys from a file in wallet dump file format (see the
dumpwallet
RPC). 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.
ImportPrunedFunds
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
ImportPubKey
The importpubkey
RPC imports a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend
Parameter #1—the public key to import
Name | Type | Presence | Description |
---|---|---|---|
Private Key | string (hex) | Required (exactly 1) |
The public key to import |
Parameter #2—the account into which the key should be placed
Name | Type | Presence | Description |
---|---|---|---|
Label | string | Optional (0 or 1) |
The label the key should be assigned |
Parameter #3—whether to rescan the block chain
Name | Type | Presence | Description |
---|---|---|---|
Rescan | bool | Optional (0 or 1) |
Set to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet. Set to false to not rescan the block database (rescanning can be performed at any time by restarting Dash Core with the -rescan command-line argument). Rescanning may take several minutes. Notes: if the address for this key is already in the wallet, the block database will not be rescanned even if this parameter is set |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If the public key is added to the wallet (or is already part of the wallet), JSON null will be returned |
Example from Dash Core 0.12.2
Import the public key for the address, giving it a label and scanning the entire block chain:
dash-cli -testnet importpubkey \
0210c1349657c1253d3d64d1b31d3500b09335bf12b8df061666e216f550a43249 \
"test label" \
true
(Success: no result displayed.)
See also:
- 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.
- ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the
dumpprivkey
RPC. - ImportWallet: imports private keys from a file in wallet dump file format (see the
dumpwallet
RPC). 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.
ImportWallet
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The importwallet
RPC imports private keys from a file in wallet dump file format (see the dumpwallet
RPC). 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.
Parameter #1—the file to import
Name | Type | Presence | Description |
---|---|---|---|
Filename | string | Required (exactly 1) |
The file to import. The path is relative to Dash Core’s working directory |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If all the keys in the file are added to the wallet (or are already part of the wallet), JSON null will be returned |
Example from Dash Core 0.12.2
Import the file shown in the example subsection of the dumpwallet
RPC.
dash-cli -testnet importwallet /tmp/dump.txt
(Success: no result displayed.)
See also
- DumpWallet: creates or overwrites a file with all wallet keys in a human-readable format.
- ImportPrivKey: adds a private key to your wallet. The key should be formatted in the wallet import format created by the
dumpprivkey
RPC.
InstantSendToAddress
The instantsendtoaddress
RPC InstantSend an amount to a given address.
Parameter #1—to address
Name | Type | Presence | Description |
---|---|---|---|
To Address | string | Required (exactly 1) |
A P2PKH or P2SH address to which the dash should be sent |
Parameter #2—amount to spend
Name | Type | Presence | Description |
---|---|---|---|
Amount | number (dash) | Required (exactly 1) |
The amount to spent in dash |
Parameter #3—a comment
Name | Type | Presence | Description |
---|---|---|---|
Comment | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment |
Parameter #4—a comment about who the payment was sent to
Name | Type | Presence | Description |
---|---|---|---|
Comment To | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment |
Parameter #5—automatic fee subtraction
Name | Type | Presence | Description |
---|---|---|---|
Subtract Fee From Amount | boolean | Optional (0 or 1) |
The fee will be deducted from the amount being sent. The recipient will receive less dash than you enter in the amount field. Default is false |
Result—a TXID of the sent transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The TXID of the sent transaction, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
InstantSend 0.1 dash to the address below with the comment “instantsendtoaddress example” and the comment-to “Nemo From Example.com”:
dash-cli -testnet instantsendtoaddress ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv \
1.0 "instantsendtoaddress example" "Nemo From Example.com"
Result:
70e2029d363f0110fe8a0aa2ba7bd771a579453135568b2aa559b2cb30f875aa
See also:
- SendFrom: spends an amount from a local account to a dash address.
- SendMany: creates and broadcasts a transaction which sends outputs to multiple addresses.
- SendToAddress: spends an amount to a given address.
- Move: moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
KeePass
The keepass
RPC provides commands for configuring and managing KeePass authentication
Parameter #1—Command mode
Name | Type | Presence | Description |
---|---|---|---|
mode |
string | Required (exactly 1) | The command mode to use:genkey ,init ,setpassphrase |
Command Options
Mode | Description |
---|---|
genkey |
Generates a base64 encoded 256 bit AES key that can be used for the communication with KeePassHttp. This is only necessary for manual configuration. |
init |
Sets up the association between Dash Core and KeePass by generating an AES key and sending an association message to KeePassHttp. This will trigger KeePass to ask for an Id for the association. Returns the association and the base64 encoded string for the AES key. |
setpassphrase |
Updates the passphrase in KeePassHttp to a new value. This should match the passphrase you intend to use for the wallet. Please note that the standard RPC commands walletpassphrasechange and the wallet encryption from the QT GUI already send the updates to KeePassHttp, so this is only necessary for manual manipulation of the password. |
Command Mode - genkey
Result—the new key
Name | Type | Presence | Description |
---|---|---|---|
Result | string (base64) | Required (exactly 1) | The new key |
Example from Dash Core 0.12.2
Manually generate a key
dash-cli -testnet keepass genkey
Result:
Generated Key: dNjo+J8Jb30txbJiKq4s9H6vEgWq/whb1w9bb2cTOFo=
Command Mode - init
Result—initialization response
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) | The success/error status |
Example from Dash Core 0.12.2
Automatically initialize
dash-cli -testnet keepass init
Result (wrapped):
Association successful. Id: testwalletassociation - \
Key: MSb+JLygqz7ZH40SyJ1QR62i00IXoa3tmT85MGGI2K0=
Command Mode - setpassphrase
Parameter #2—Passphrase
Name | Type | Presence | Description |
---|---|---|---|
Passphrase | string | Required (exactly 1) | The passphrase to set |
Result—status
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) | The success/error status |
Example from Dash Core 0.12.2
Set KeePass passphrase
dash-cli -testnet keepass setpassphrase 1BWi20Xyk76uWumxJQy4
Result:
setlogin: Updated credentials.
See also: none
KeyPoolRefill
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The keypoolrefill
RPC fills the cache of unused pre-generated keys (the keypool).
Parameter #1—the new keypool size
Name | Type | Presence | Description |
---|---|---|---|
Key Pool Size | number (int) | Optional (0 or 1) |
The new size of the keypool; if the number of keys in the keypool is less than this number, new keys will be generated. Default is 1000 . The value 0 also equals the default. The value specified is for this call only—the default keypool size is not changed |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
If the keypool is successfully filled, JSON null will be returned |
Example from Dash Core 0.12.2
Generate one extra key than the default:
dash-cli -testnet keypoolrefill 1001
(No result shown: success.)
See also
- GetNewAddress: returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
- GetAccountAddress: returns the current Dash address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address.
- GetWalletInfo: provides information about the wallet.
ListAccounts
Requires wallet support.
The listaccounts
RPC lists accounts and their balances.
Warning:
listaccounts
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—the minimum number of confirmations a transaction must have
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #2—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions |
Parameter #3—whether to include watch-only addresses in results
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—a list of accounts and their balances
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A JSON array containing key/value pairs with account names and values. Must include, at the very least, the default account (“”) |
→ Account : Balance |
string : number (dash) | Required (1 or more) |
The name of an account as a string paired with the balance of the account as a number of dash. The number of dash may be negative if the account has spent more dash than it received. Accounts with zero balances and zero transactions will be displayed |
Example from Dash Core 0.12.2
Display account balances with one confirmation and watch-only addresses included. Add the InstantSend confirmations (5) for locked transactions.
dash-cli -testnet listaccounts 1 true true
Result:
{
"": -2941.30029732,
"Watching": 8.50000000,
"MN": 2000.25442744,
"PS": 37.02970000,
"Recv1": 3843.48167912,
}
See also
- GetAccount: returns the name of the account associated with the given address.
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
- ListReceivedByAccount: lists the total number of dash received by each account.
ListAddressGroupings
Requires wallet support.
The listaddressgroupings
RPC 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.
Parameters: none
Result—an array of arrays describing the groupings
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing the groupings. May be empty |
→ Groupings |
array | Optional (0 or more) |
An array containing arrays of addresses which can be associated with each other |
→ → Address Details |
array | Required (1 or more) |
An array containing information about a particular address |
→ → → Address |
string (base58) | Required (exactly 1) |
The address in base58check format |
→ → → Balance |
number (bitcoins) | Required (exactly 1) |
The current spendable balance of the address, not counting unconfirmed transactions |
→ → → Account |
string | Optional (0 or 1) |
Deprecated: will be removed in a later version of Dash Core The account the address belongs to, if any. This field will not be returned for change addresses. The default account is an empty string (“”) |
Example from Dash Core 0.12.2
dash-cli -testnet listaddressgroupings
Result (edited to only three results):
[
[
[
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
0.00000000
]
],
[
[
"yX7SvurfpwSD7QDA3pZNYNxt6kPPiZmRAk",
27.02970000,
"Test1"
]
],
[
[
"ygMuVDN2raRBma86GpwyQeJV18kR1261d1",
11.00000000,
"Test2"
]
]
]
See also
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
- GetTransaction: gets detailed information about an in-wallet transaction.
ListBanned
Added in Bitcoin Core 0.12.0
The listbanned
RPC lists all banned IPs/Subnets.
Parameters: none
Result—information about each banned IP/Subnet
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An array of objects each describing one entry. If there are no entries in the ban list, the array will be empty |
→ Node |
object | Optional (0 or more) |
A ban list entry |
→ →address |
string | Required (exactly 1) |
The IP/Subnet of the entry |
→ →banned_until |
number (int) |
Required (exactly 1) |
The Unix epoch time when the entry was added to the ban list |
→ →ban_created |
number (int) |
Required (exactly 1) |
The Unix epoch time until the IP/Subnet is banned |
→ →ban_reason |
string | Required (exactly 1) |
Set to one of the following reasons: • node misbehaving if the node was banned by the client because of DoS violations• manually added if the node was manually banned by the user |
Examples from Dash Core 0.12.2
The default (false
):
dash-cli listbanned
Result:
[
{
"address": "192.0.2.201/32",
"banned_until": 1507906175,
"ban_created": 1507819775,
"ban_reason": "node misbehaving"
},
{
"address": "192.0.2.101/32",
"banned_until": 1507906199,
"ban_created": 1507819799,
"ban_reason": "manually added"
}
]
See also
- SetBan: attempts add or remove a IP/Subnet from the banned list.
- ClearBanned: clears list of banned nodes.
ListLockUnspent
Requires wallet support.
The listlockunspent
RPC returns a list of temporarily unspendable (locked) outputs.
Parameters: none
Result—an array of locked outputs
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing all locked outputs. May be empty |
→ Output |
object | Optional (1 or more) |
An object describing a particular locked output |
→ →txid |
string (hex) | Required (exactly 1) |
The TXID of the transaction containing the locked output, encoded as hex in RPC byte order |
→ →vout |
number (int) | Required (exactly 1) |
The output index number (vout) of the locked output within the transaction. Output index 0 is the first output within the transaction |
Example from Dash Core 0.12.2
dash-cli -testnet listlockunspent
Result:
[
{
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
}
]
See also
- LockUnspent: temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails.
ListReceivedByAccount
Requires wallet support.
The listreceivedbyaccount
RPC lists the total number of dash received by each account.
Warning:
listreceivedbyaccount
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—the minimum number of confirmations a transaction must have to be counted
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #2—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions |
Parameter #3—whether to include empty accounts
Name | Type | Presence | Description |
---|---|---|---|
Include Empty | bool | Optional (0 or 1) |
Set to true to display accounts which have never received a payment. Set to false (the default) to only include accounts which have received a payment. Any account which has received a payment will be displayed even if its current balance is 0 |
Parameter #4—whether to include watch-only addresses in results
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—account names, balances, and minimum confirmations
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing objects each describing an account. At the very least, the default account (“”) will be included |
→ Account |
object | Required (1 or more) |
An object describing an account |
→ →involvesWatchonly |
bool | Optional (0 or 1) |
Set to true if the balance of this account includes a watch-only address which has received a spendable payment (that is, a payment with at least the specified number of confirmations and which is not an immature coinbase). Otherwise not returned |
→ →account |
string | Required (exactly 1) |
The name of the account |
→ →amount |
number (dash) | Required (exactly 1) |
The total amount received by this account in dash |
→ →confirmations |
number (int) | Required (exactly 1) |
The number of confirmations received by the last transaction received by this account. May be 0 |
→ →label |
string | Optional (0 or 1) |
A comment for the address/transaction |
Example from Dash Core 0.12.2
Get the balances for all non-empty accounts, including only transactions which have been confirmed at least six times (include InstantSend confirmations for locked InstantSend transactions):
dash-cli -testnet listreceivedbyaccount 6 true false true
Result (edited to only show the first two results):
[
{
"account" : "",
"amount" : 0.19960000,
"confirmations" : 53601
},
{
"account" : "doc test",
"amount" : 0.30000000,
"confirmations" : 8991
}
]
See also
- ListReceivedByAddress: lists the total number of dash received by each address.
- GetReceivedByAccount: returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetReceivedByAddress: returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
ListReceivedByAddress
Requires wallet support.
The listreceivedbyaddress
RPC lists the total number of dash received by each address.
Parameter #1—the minimum number of confirmations a transaction must have to be counted
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance. Transactions generated by this node are counted immediately. Typically, externally-generated transactions are payments to this wallet and transactions generated by this node are payments to other wallets. Use 0 to count unconfirmed transactions. Default is 1 |
Parameter #2—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (exactly 1) |
Add the number of InstantSend confirmations to InstantSend locked transactions |
Parameter #3—whether to include empty accounts
Name | Type | Presence | Description |
---|---|---|---|
Include Empty | bool | Optional (0 or 1) |
Set to true to display accounts which have never received a payment. Set to false (the default) to only include accounts which have received a payment. Any account which has received a payment will be displayed even if its current balance is 0 |
Parameter #4—whether to include watch-only addresses in results
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—addresses, account names, balances, and minimum confirmations
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing objects each describing a particular address |
→ Address |
object | Optional (0 or more) |
An object describing an address |
→ →involvesWatchonly |
bool | Optional (0 or 1) |
Set to true if this address is a watch-only address which has received a spendable payment (that is, a payment with at least the specified number of confirmations and which is not an immature coinbase). Otherwise not returned |
→ →address |
string (base58) | Required (exactly 1) |
The address being described encoded in base58check |
→ →account |
string | Required (exactly 1) |
Deprecated: will be removed in a later version of Dash Core The account the address belongs to. May be the default account, an empty string (“”) |
→ →amount |
number (dash) | Required (exactly 1) |
The total amount the address has received in dash |
→ →confirmations |
number (int) | Required (exactly 1) |
The number of confirmations of the latest transaction to the address. May be 0 for unconfirmed |
→ →label |
string | Required (exactly 1) |
The account the address belongs to. May be the default account, an empty string (“”) |
→ →txids |
array | Required (exactly 1) |
An array of TXIDs belonging to transactions that pay the address |
→ → → TXID |
string | Optional (0 or more) |
The TXID of a transaction paying the address, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
List addresses with balances confirmed by at least six blocks, including watch-only addresses (include InstantSend confirmations for locked InstantSend transactions):
dash-cli -testnet listreceivedbyaddress 6 true false true
Result (edit to show only two entries):
[
{
"address": "yV3ZTfwyfUmpspncMSitiwzh7EvqSGrqZA",
"account": "",
"amount": 1000.00000000,
"confirmations": 26779,
"label": "",
"txids": [
"0456aaf51a8df21dd47c2a06ede046a5bf7403bcb95d14d1d71b178c189fb933"
]
},
{
"involvesWatchonly" : true,
"address": "yfoR9uM3rcDfUc7AEfUNm5BjVYGFw7uQ9w",
"account": "Watching",
"amount": 1877.78476068,
"confirmations": 26876,
"label": "Watching",
"txids": [
"cd64114c803a2a243cb6ce4eb5c98e60cd2c688be8e900b3b957fe520cf42601",
"83d3f7f31926908962e336341b1895d5f734f9d7149bdb35f0381cc78019bd83"
]
}
]
See also
- ListReceivedByAccount: lists the total number of dash received by each account.
- GetReceivedByAddress: returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.
- GetReceivedByAccount: returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations. It does not count coinbase transactions.
ListSinceBlock
Requires wallet support.
The listsinceblock
RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.
Parameter #1—a block header hash
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | string (hex) | Optional (0 or 1) |
The hash of a block header encoded as hex in RPC byte order. All transactions affecting the wallet which are not in that block or any earlier block will be returned, including unconfirmed transactions. Default is the hash of the genesis block, so all transactions affecting the wallet are returned by default |
Parameter #2—the target confirmations for the lastblock field
Name | Type | Presence | Description |
---|---|---|---|
Target Confirmations | number (int) | Optional (0 or 1) |
Sets the lastblock field of the results to the header hash of a block with this many confirmations. This does not affect which transactions are returned. Default is 1 , so the hash of the most recent block on the local best block chain is returned |
Parameter #3—whether to include watch-only addresses in details and calculations
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
An object containing an array of transactions and the lastblock field |
→transactions |
array | Required (exactly 1) |
An array of objects each describing a particular payment to or from this wallet. The objects in this array do not describe an actual transactions, so more than one object in this array may come from the same transaction. This array may be empty |
→ → Payment |
object | Optional (0 or more) |
An payment which did not appear in the specified block or an earlier block |
→ → → involvesWatchonly |
bool | Optional (0 or 1) |
Set to true if the payment involves a watch-only address. Otherwise not returned |
→ → → account |
string | Required (exactly 1) |
Deprecated: will be removed in a later version of Bitcoin Core The account which the payment was credited to or debited from. May be an empty string (“”) for the default account |
→ → → address |
string (base58) | Optional (0 or 1) |
The address paid in this payment, which may be someone else’s address not belonging to this wallet. May be empty if the address is unknown, such as when paying to a non-standard pubkey script |
→ → → category |
string | Required (exactly 1) |
Set to one of the following values: • send if sending payment normally• privatesend if sending PrivateSend payment• receive if this wallet received payment in a regular transaction• generate if a matured and spendable coinbase• immature if a coinbase that is not spendable yet• orphan if a coinbase from a block that’s not in the local best block chain |
→ → → amount |
number (dash) | Required (exactly 1) |
A negative dash amount if sending payment; a positive dash amount if receiving payment (including coinbases) |
→ → → vout |
number (int) | Required (exactly 1) |
For an output, the output index (vout) for this output in this transaction. For an input, the output index for the output being spent in its transaction. Because inputs list the output indexes from previous transactions, more than one entry in the details array may have the same output index |
→ → → fee |
number (dash) | Optional (0 or 1) |
If sending payment, the fee paid as a negative dash value. May be 0 . Not returned if receiving payment |
→ → → confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transaction has received. Will be 0 for unconfirmed and -1 for conflicted |
→ → → 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 |
→ → → blockindex |
number (int) | Optional (0 or 1) |
The index of the transaction in the block that includes it. Only returned for confirmed transactions |
→ → → blocktime |
number (int) | Optional (0 or 1) |
The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions |
→ → → txid |
string (hex) | Required (exactly 1) |
The TXID of the transaction, encoded as hex in RPC byte order |
→ → → walletconflicts |
array | Required (exactly 1) |
An array containing the TXIDs of other transactions that spend the same inputs (UTXOs) as this transaction. Array may be empty |
→ → → → TXID |
string (hex) | Optional (0 or more) |
The TXID of a conflicting transaction, encoded as hex in RPC byte order |
→ → → time |
number (int) | Required (exactly 1) |
A Unix epoch time when the transaction was added to the wallet |
→ → → timereceived |
number (int) | Required (exactly 1) |
A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction |
→ → → bip125-replaceable |
string | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 Indicates if a transaction is replaceable under BIP 125: • yes is replaceable• no not replaceable• unknown for unconfirmed transactions not in the mempool |
→ → → comment |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction. Only returned if a comment was added |
→ → → to |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction identifying who the transaction was sent to. Only returned if a comment-to was added |
→lastblock |
string (hex) | Required (exactly 1) |
The header hash of the block with the number of confirmations specified in the target confirmations parameter, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
Get all transactions since a particular block (including watch-only transactions) and the header hash of the sixth most recent block.
dash-cli -testnet listsinceblock \
00000000688633a503f69818a70eac281302e9189b1bb57a76a05c329fcda718 \
6 true
Result (edited to show only two payments):
{
"transactions": [
{
"account": "",
"address": "yfCjqf9F7oNGD1sRqta2rNpCXSQ9dknDf5",
"category": "send",
"amount": -0.01000010,
"vout": 7,
"fee": 0.05000050,
"confirmations": 95,
"instantlock": false,
"blockhash": "0000000002aa705754c6ab4e15cf2183a1d174e61c080f64eb469c458669144b",
"blockindex": 1,
"blocktime": 1511972930,
"txid": "52e34eec71a4cf95c043b76567f55cec1bc293c444810d454a2d05f2a819b5ed",
"walletconflicts": [
],
"time": 1511972930,
"timereceived": 1511974218,
"bip125-replaceable": "no",
"abandoned": false
},
{
"account": "",
"address": "yi2U4Cx2QH33LdNwk2c2oLABWzEZWhYU9k",
"category": "send",
"amount": -0.01000010,
"vout": 8,
"fee": 0.05000050,
"confirmations": 95,
"instantlock": false,
"blockhash": "0000000002aa705754c6ab4e15cf2183a1d174e61c080f64eb469c458669144b",
"blockindex": 1,
"blocktime": 1511972930,
"txid": "52e34eec71a4cf95c043b76567f55cec1bc293c444810d454a2d05f2a819b5ed",
"walletconflicts": [
],
"time": 1511972930,
"timereceived": 1511974218,
"bip125-replaceable": "no",
"abandoned": false
}
],
"lastblock": "000000000dba5583e3fc5c2df06b478e922702f53a1476aac8eb4322f648ccea"
}
See also
- ListReceivedByAccount: lists the total number of dash received by each account.
- ListReceivedByAddress: lists the total number of dash received by each address.
ListTransactions
Requires wallet support.
The listtransactions
RPC returns the most recent transactions that affect the wallet.
Parameter #1—an account name to get transactions from
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Optional (0 or 1) |
Deprecated: will be removed in a later version of Dash Core The name of an account to get transactions from. Use an empty string (“”) to get transactions for the default account. Default is * to get transactions for all accounts. |
Parameter #2—the number of transactions to get
Name | Type | Presence | Description |
---|---|---|---|
Count | number (int) | Optional (0 or 1) |
The number of the most recent transactions to list. Default is 10 |
Parameter #3—the number of transactions to skip
Name | Type | Presence | Description |
---|---|---|---|
Skip | number (int) | Optional (0 or 1) |
The number of the most recent transactions which should not be returned. Allows for pagination of results. Default is 0 |
Parameter #4—whether to include watch-only addresses in details and calculations
Name | Type | Presence | Description |
---|---|---|---|
Include Watch-Only | bool | Optional (0 or 1) |
If set to true , include watch-only addresses in details and calculations as if they were regular addresses belonging to the wallet. If set to false (the default), treat watch-only addresses as if they didn’t belong to this wallet |
Result—payment details
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array containing objects, with each object describing a payment or internal accounting entry (not a transaction). More than one object in this array may come from a single transaction. Array may be empty |
→ Payment |
object | Optional (0 or more) |
A payment or internal accounting entry |
→ →account |
string | Required (exactly 1) |
Deprecated: will be removed in a later version of Dash Core The account which the payment was credited to or debited from. May be an empty string (“”) for the default account |
→ →address |
string (base58) | Optional (0 or 1) |
The address paid in this payment, which may be someone else’s address not belonging to this wallet. May be empty if the address is unknown, such as when paying to a non-standard pubkey script or if this is in the move category |
→ →category |
string | Required (exactly 1) |
Set to one of the following values: • send if sending payment• receive if this wallet received payment in a regular transaction• generate if a matured and spendable coinbase• immature if a coinbase that is not spendable yet• orphan if a coinbase from a block that’s not in the local best block chain• move if an off-block-chain move made with the move RPC |
→ →amount |
number (dash) | Required (exactly 1) |
A negative dash amount if sending payment; a positive dash amount if receiving payment (including coinbases) |
→ →label |
string | Optional (0 or 1) |
A comment for the address/transaction |
→ →vout |
number (int) | Optional (0 or 1) |
For an output, the output index (vout) for this output in this transaction. For an input, the output index for the output being spent in its transaction. Because inputs list the output indexes from previous transactions, more than one entry in the details array may have the same output index. Not returned for move category payments |
→ →fee |
number (dash) | Optional (0 or 1) |
If sending payment, the fee paid as a negative dash value. May be 0 . Not returned if receiving payment or for move category payments |
→ →confirmations |
number (int) | Optional (0 or 1) |
The number of confirmations the transaction has received. Will be 0 for unconfirmed and -1 for conflicted. Not returned for move category payments |
→instantlock |
bool | Required (exactly 1) |
Current transaction lock state |
→ →trusted |
bool | Optional (0 or 1) |
Indicates 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 or move category payments |
→ →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 |
→ →blockindex |
number (int) | Optional (0 or 1) |
The index of the transaction in the block that includes it. Only returned for confirmed transactions |
→ →blocktime |
number (int) | Optional (0 or 1) |
The block header time (Unix epoch time) of the block on the local best block chain which includes this transaction. Only returned for confirmed transactions |
→ →txid |
string (hex) | Optional (0 or 1) |
The TXID of the transaction, encoded as hex in RPC byte order. Not returned for move category payments |
→ →walletconflicts |
array | Optional (0 or 1) |
An array containing the TXIDs of other transactions that spend the same inputs (UTXOs) as this transaction. Array may be empty. Not returned for move category payments |
→ → → TXID |
string (hex) | Optional (0 or more) |
The TXID of a conflicting transaction, encoded as hex in RPC byte order |
→ →time |
number (int) | Required (exactly 1) |
A Unix epoch time when the transaction was added to the wallet |
→ →timereceived |
number (int) | Optional (0 or 1) |
A Unix epoch time when the transaction was detected by the local node, or the time of the block on the local best block chain that included the transaction. Not returned for move category payments |
→ →comment |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction. Only returned in regular payments if a comment was added. Always returned in move category payments. May be an empty string |
→ →to |
string | Optional (0 or 1) |
For transaction originating with this wallet, a locally-stored comment added to the transaction identifying who the transaction was sent to. Only returned if a comment-to was added. Never returned by move category payments. May be an empty string |
→ →otheraccount |
string | Optional (0 or 1) |
This is the account the dash were moved from or moved to, as indicated by a negative or positive amount field in this payment. Only returned by move category payments |
→ →bip125-replaceable |
string | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 Indicates if a transaction is replaceable under BIP125: • yes replaceable• no not replaceable• unknown for unconfirmed transactions not in the mempool |
→ →abandoned |
bool | Optional (0 or 1) |
Added in Bitcoin Core 0.12.1 Indicates if a transaction is was abandoned: • true if it was abandoned (inputs are respendable)• false if it was not abandonedOnly returned by send category payments |
Example from Dash Core 0.12.2
List the most recent transaction from the main account including watch-only addresses.
dash-cli listtransactions "" 1 0 true
Result:
[
{
"account": "MN Setup",
"address": "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh",
"category": "immature",
"amount": 11.25000000,
"label": "MN Setup",
"vout": 3,
"confirmations": 20,
"instantlock": false,
"generated": true,
"blockhash": "000000000207e556193e19287d2e554a5f99e1ff7cb19367e8de8ad6bacc494e",
"blockindex": 0,
"blocktime": 1511986957,
"txid": "cd9d44cd87ffb784f9dac384bad7db55324d3f47724eb60e16b3de6a26175936",
"walletconflicts": [
],
"time": 1511986957,
"timereceived": 1511986982,
"bip125-replaceable": "no"
}
]
See also
- GetTransaction: gets detailed information about an in-wallet transaction.
- ListSinceBlock: gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.
ListUnspent
Requires wallet support.
The listunspent
RPC returns an array of unspent transaction outputs belonging to this wallet. Note: as of Bitcoin
Core 0.10.0, outputs affecting watch-only addresses will be returned; see
the spendable field in the results described below.
Parameter #1—the minimum number of confirmations an output must have
Name | Type | Presence | Description |
---|---|---|---|
Minimum Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations the transaction containing an output must have in order to be returned. Use 0 to return outputs from unconfirmed transactions. Default is 1 |
Parameter #2—the maximum number of confirmations an output may have
Name | Type | Presence | Description |
---|---|---|---|
Maximum Confirmations | number (int) | Optional (0 or 1) |
The maximum number of confirmations the transaction containing an output may have in order to be returned. Default is 9999999 (~10 million) |
Parameter #3—the addresses an output must pay
Name | Type | Presence | Description |
---|---|---|---|
Addresses | array | Optional (0 or 1) |
If present, only outputs which pay an address in this array will be returned |
→ Address |
string (base58) | Required (1 or more) |
A P2PKH or P2SH address |
Result—the list of unspent outputs
Name | Type | Presence | Description |
---|---|---|---|
result |
array | Required (exactly 1) |
An array of objects each describing an unspent output. May be empty |
→ Unspent Output |
object | Optional (0 or more) |
An object describing a particular unspent output belonging to this wallet |
→ →txid |
string (hex) | Required (exactly 1) |
The TXID of the transaction containing the output, encoded as hex in RPC byte order |
→ →vout |
number (int) | Required (exactly 1) |
The output index number (vout) of the output within its containing transaction |
→ →address |
string (base58) | Optional (0 or 1) |
The P2PKH or P2SH address the output paid. Only returned for P2PKH or P2SH output scripts |
→ →account |
string | Optional (0 or 1) |
Deprecated: will be removed in a later version of Dash Core If the address returned belongs to an account, this is the account. Otherwise not returned |
→ →scriptPubKey |
string (hex) | Required (exactly 1) |
The output script paid, encoded as hex |
→ →redeemScript |
string (hex) | Optional (0 or 1) |
If the output is a P2SH whose script belongs to this wallet, this is the redeem script |
→ →amount |
number (int) | Required (exactly 1) |
The amount paid to the output in dash |
→ →confirmations |
number (int) | Required (exactly 1) |
The number of confirmations received for the transaction containing this output |
→ →ps_rounds |
number (int) | Required (exactly 1) |
The number of PrivateSend rounds |
→ →spendable |
bool | Required (exactly 1) |
Set to true if the private key or keys needed to spend this output are part of the wallet. Set to false if not (such as for watch-only addresses) |
→ →solvable |
bool | Required (exactly 1) |
Added in Bitcoin Core 0.13.0 Set to true if the wallet knows how to spend this output. Set to false if the wallet does not know how to spend the output. It is ignored if the private keys are available |
Example from Dash Core 0.12.2
Get all outputs confirmed at least 6 times for a particular address:
dash-cli -testnet listunspent 6 99999999 '''
[
"yTQNnbby2yhxoK1UtL9E5J9epGtkAoFWSm"
]
'''
Result:
[
{
"txid": "52e34eec71a4cf95c043b76567f55cec1bc293c444810d454a2d05f2a819b5ed",
"vout": 3,
"address": "yTQNnbby2yhxoK1UtL9E5J9epGtkAoFWSm",
"scriptPubKey": "76a9144db791c2388be4716f048be2648bafe1944f787688ac",
"amount": 0.01000010,
"confirmations": 113,
"ps_rounds": 4,
"spendable": true,
"solvable": true
}
]
See also
- ListTransactions: returns the most recent transactions that affect the wallet.
- LockUnspent: temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails.
LockUnspent
Requires wallet support.
The lockunspent
RPC temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails.
Parameter #1—whether to lock or unlock the outputs
Name | Type | Presence | Description |
---|---|---|---|
Unlock | bool | Required (exactly 1) |
Set to false to lock the outputs specified in the following parameter. Set to true to unlock the outputs specified. If this is the only argument specified and it is set to true , all outputs will be unlocked; if it is the only argument and is set to false , there will be no change |
Parameter #2—the outputs to lock or unlock
Name | Type | Presence | Description |
---|---|---|---|
Outputs | array | Optional (0 or 1) |
An array of outputs to lock or unlock |
→ Output |
object | Required (1 or more) |
An object describing a particular output |
→ →txid |
string | Required (exactly 1) |
The TXID of the transaction containing the output to lock or unlock, encoded as hex in internal byte order |
→ →vout |
number (int) | Required (exactly 1) |
The output index number (vout) of the output to lock or unlock. The first output in a transaction has an index of 0 |
Result—true
if successful
Name | Type | Presence | Description |
---|---|---|---|
result |
bool | Required (exactly 1) |
Set to true if the outputs were successfully locked or unlocked. If the outputs were already locked or unlocked, it will also return true |
Example from Dash Core 0.12.2
Lock two outputs:
dash-cli -testnet lockunspent false '''
[
{
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
},
{
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
'''
Result:
true
Verify the outputs have been locked:
dash-cli -testnet listlockunspent
Result
[
{
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
},
{
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
Unlock one of the above outputs:
dash-cli -testnet lockunspent true '''
[
{
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
'''
Result:
true
Verify the output has been unlocked:
dash-cli -testnet listlockunspent
Result:
[
{
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
}
]
See also
- ListLockUnspent: returns a list of temporarily unspendable (locked) outputs.
- ListUnspent: returns an array of unspent transaction outputs belonging to this wallet.
Masternode
The masternode
RPC provides a set of commands for managing masternodes and displaying information about them.
Masternode Count
The masternode count
RPC prints the number of all known masternodes.
Parameter #1—mode
Name | Type | Presence | Description |
---|---|---|---|
Mode | string (hex) | Optional (exactly 1) |
Which masternodes to count:ps - PrivateSend capable,enabled - Enabled,all - All,qualify - Eligible for payment |
Result—number of known masternodes
Name | Type | Presence | Description |
---|---|---|---|
result |
string (hex) | Required (exactly 1) |
Transaction ID for the collateral transaction |
Example from Dash Core 0.12.2
dash-cli -testnet masternode count
Result:
120
Get summarized count of all masternodes
dash-cli -testnet masternode count all
Result:
Total: 129 (PS Compatible: 97 / Enabled: 97 / Qualify: 90)
Masternode Current
The masternode current
RPC prints info on current masternode winner to be paid the next block (calculated locally).
Parameters: none
Result—current winning masternode info
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Winning masternode info |
→height |
int | Required (exactly 1) |
Block height |
→IP:port |
string | Required (exactly 1) |
The IP address/port of the masternode |
→protocol |
number (int) | Required (exactly 1) |
The protocol version number used by this node. See the protocol versions section for more information |
→outpoint |
string | Required (1 or more) |
The masternode’s outpoint |
→payee |
string | Required (exactly 1) |
Payee address |
→lastseen |
number (int) | Required (exactly 1) |
The Unix epoch time when the masternode was last seen |
→activeseconds |
number (int) | Required (exactly 1) |
The number of seconds the masternode has been active |
Example from Dash Core 0.12.2
dash-cli -testnet masternode current
Result:
{
"height": 37375,
"IP:port": "108.61.192.47:19999",
"protocol": 70208,
"outpoint": "3df7fb192e21c34da99bdd10c34e58ecaf3f3c37d6b2289f0ffedba5050188cc-1",
"payee": "ydGgePy4a3zza37Zm4D44B99czyo6TftU1",
"lastseen": 1512482630,
"activeseconds": 3170434
}
Masternode Debug
The masternode debug
RPC prints masternode status.
Warning:
masternode debug
was removed in Dash Core 0.12.2.2.
Parameters: none
Result—masternode status
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) |
Masternode status |
Example from Dash Core 0.12.2
dash-cli -testnet masternode debug
Result:
Masternode successfully started
Masternode Genkey
The masternode genkey
RPC generates a new masternodeprivkey.
Parameters: none
Result—masternode private key
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) |
Masternode private key |
Example from Dash Core 0.12.2
dash-cli -testnet masternode genkey
Result:
92Mn5DQpnBHjFPbS3ZXcX3EdhuET18u3eXTTtVsdDzdcAMaXqtG
Masternode Outputs
The masternode outputs
RPC prints masternode compatible outputs.
Parameters: none
Result—masternode outputs
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Masternode compatible outputs |
→ Output |
string | Required (1 or more) |
Masternode compatible output (TXID:Index) |
Example from Dash Core 0.12.2
dash-cli -testnet masternode outputs
Result:
{
"f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f": "1"
}
Masternode Start
The masternode start
RPC starts a local hot masternode configure in dash.conf.
Warning:
masternode start
was removed in Dash Core 0.12.2.2. Local
masternode support was removed for security reasons.
Parameters: none
Result—masternode status
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) |
Masternode status |
Example from Dash Core 0.12.2
dash-cli -testnet masternode start
Result:
Masternode successfully started
Masternode Start-alias
The masternode start-alias
starts a single remote masternode by assigned alias configured in masternode.conf.
Parameter #1—masternode alias
Name | Type | Presence | Description |
---|---|---|---|
Alias | string | Required (exactly 1) |
Alias of the masternode to start |
Result—masternode status
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) |
Masternode status |
Example from Dash Core 0.12.2
dash-cli -testnet masternode start-alias MN01
Result:
{
"alias": "MN01",
"result": "successful"
}
Masternode Start-mode
The masternode start-<mode>
RPC starts remote masternodes configured in
masternode.conf. Valid modes are: all
, missing
, or disabled
.
Parameters: none
Result—masternode status
Name | Type | Presence | Description |
---|---|---|---|
Result | string | Required (exactly 1) |
Masternode status |
→overall |
string | Required (1 or more) |
Reports masternode start successes/failures |
→detail |
object | Required (exactly 1) |
Start details |
→ →status |
object | Required (1 or more) |
Name of the masternode alias |
→ → →alias |
string | Required (exactly 1) |
Masternode alias |
→ → →result |
string | Required (exactly 1) |
Start result |
Example from Dash Core 0.12.2
Start all masternodes in masternodes.conf
dash-cli -testnet masternode start-all
Result:
{
"overall": "Successfully started 1 masternodes, failed to start 0, total 1",
"detail": {
"status": {
"alias": "MN01",
"result": "successful"
}
}
}
Start missing masternodes in masternodes.conf
dash-cli -testnet masternode start-missing
Result:
{
"overall": "Successfully started 0 masternodes, failed to start 0, total 0",
"detail": {
}
}
Start disabled masternodes in masternodes.conf
dash-cli -testnet masternode start-disabled
Result:
{
"overall": "Successfully started 1 masternodes, failed to start 0, total 1",
"detail": {
"status": {
"alias": "MN01",
"result": "successful"
}
}
}
Masternode Status
The masternode status
RPC prints masternode status information.
Parameters: none
Result—masternode status info
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Masternode status info |
→outpoint |
string | Required (1 or more) |
The masternode’s outpoint |
→service |
string | Required (exactly 1) |
The IP address/port of the masternode |
→payee |
string | Required (exactly 1) |
Payee address |
→status |
string | Required (1 or more) |
The masternode’s status |
Example from Dash Core 0.12.2
dash-cli -testnet masternode status
Result:
{
"outpoint": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f-1",
"service": "45.32.237.77:19999",
"payee": "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh",
"status": "Masternode successfully started"
}
Masternode List
The masternode list
prints a list of all known masternodes.
This RPC uses the same parameters and returns the same data as masternodelist. Please reference it for full details.
Example from Dash Core 0.12.2
dash-cli -testnet masternode list \
rank f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f
Result:
{
"f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f-1": 11
}
Masternode List-conf
The masternode list-conf
RPC prints masternode.conf in JSON format.
Parameters: none
Result—masternode info
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Masternode status info |
→masternode |
object | Required (1 or more) |
Object containing masternode info |
→ →alias |
string | Required (exactly 1) |
Masternode alias |
→ →address |
string | Required (exactly 1) |
The IP address/port of the masternode |
→ →privateKey |
string | Required (exactly 1) |
Masternode private key |
→ →txHash |
string (hex) | Required (exactly 1) |
Masternode collateral transaction hash |
→ →outputIndex |
int | Required (exactly 1) |
Masternode collateral transaction index |
→ →status |
string | Required (exactly 1) |
The masternode’s status |
Example from Dash Core 0.12.2
dash-cli -testnet masternode status
Result:
{
"masternode": {
"alias": "MN01",
"address": "45.32.237.77:19999",
"privateKey": "92woG282ZQMASn8BAah6H8QmiE5NsPwucv7cu9eTVG1uU63fcfs",
"txHash": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f",
"outputIndex": "1",
"status": "ENABLED"
},
"masternode": {
"alias": "MN02",
"address": "45.32.237.78:19999",
"privateKey": "92woG282ZQMASn8BAah6H8QmiE5NsPwucv7cu9eTVG1uU63fcfs",
"txHash": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f",
"outputIndex": "1",
"status": "ENABLED"
}
}
Masternode Winner
The masternode winner
RPC prints info on the next masternode winner to vote for.
Parameters: none
Result—next masternode winner info
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Winning masternode info |
→height |
int | Required (exactly 1) |
Block height |
→IP:port |
string | Required (exactly 1) |
The IP address/port of the masternode |
→protocol |
number (int) | Required (exactly 1) |
The protocol version number used by this node. See the protocol versions section for more information |
→outpoint |
string | Required (1 or more) |
The masternode’s outpoint |
→payee |
string | Required (exactly 1) |
Payee address |
→lastseen |
number (int) | Required (exactly 1) |
The Unix epoch time when the masternode was last seen |
→activeseconds |
number (int) | Required (exactly 1) |
The number of seconds the masternode has been active |
Example from Dash Core 0.12.2
dash-cli -testnet masternode winner
Result:
{
"height": 37384,
"IP:port": "145.239.235.17:29999",
"protocol": 70208,
"outpoint": "66eddd00e5927d0a03437d5b8a2f15367c978ef7951c80ae1608a45b1bf64318-1",
"payee": "yY3q6wqRe1y7xzHbGE88YfRg4t97GU7BJ6",
"lastseen": 1512482474,
"activeseconds": 1180019
}
Masternode Winners
The masternode winners
RPC prints the list of masternode winners.
By default, the 10 previous block winners, the current block winner, and the
next 20 block winners are displayed. More past block winners can be requested
via the optional count
parameter.
Parameter #1—count
Name | Type | Presence | Description |
---|---|---|---|
Count | string (hex) | Optional (exactly 1) |
Number of previous block winners to display (default: 10) |
Parameter #2—filter
Name | Type | Presence | Description |
---|---|---|---|
Filter | string | Optional (exactly 1) |
Payment address to filter by |
Result—masternode winners
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Winning masternode info |
→ Masternode Winner |
int | Required (exactly 1) |
Key: Block height Value: payee address |
Example from Dash Core 0.12.2
dash-cli -testnet masternode winners
Result (current block - 37458):
{
"37448": "ygSWwhyzU61FNEta8gDh8gfoH5EZZUvc5m:8",
"37449": "yjGZLzSSoFfTFgLDJrgniXfYxu3xF9xKQg:5",
"37450": "yRTo1wXWoNnPFWcQVepKGXuLsoypnPkGWj:7",
"37451": "yYMFRAYZ25XspHZ1EXC39wUMx9FhoC5VT2:9",
"37452": "yX5y3otE4LitGYiSfZhVH4LdbwHShdzQ8v:7",
"37453": "yX5y3otE4LitGYiSfZhVH4LdbwHShdzQ8v:4",
"37454": "yUamtYUFhqUxCMny3JTcZJTyttVt8SYFug:9",
"37455": "yU35XcdGMnj8Exa2ZZqCg4ongiNqQwpeUZ:9",
"37456": "yaJc6tADbEjxQBAC69ugWNoTFpzxqkcgWd:7",
"37457": "yf4WpwRX17p7YRkHJPQpHMXTwzi5s2VDcR:7",
"37458": "ydbfUYWfLm6xg7Y5aBLjy38DvksrvNcHEc:9",
"37459": "yYp9k2iuDptT2MB7qVZtVy6ModHtLXFjio:6",
"37460": "yP1UHNx26ShYLej56SbHiTiPAUv2QppbUv:6",
"37461": "yaCtZRpiYnVFMyWELHZF74v9ayLKCLPcC9:8",
"37462": "ygYFnLHoVRyhRoxd6fXQ9nmEafX4eLoWkB:6",
"37463": "yM5kTThWi8MnAFtZqx98Zipp1BbyypUZGK:7",
"37464": "yeDY39aiqbBHbJft5F6rokR23EaZca6UTU:9",
"37465": "yMME1ns1xfpGS2XbFPktsNyp7Cjr1BoJxb:8",
"37466": "ycn5RWc4Ruo35FTS8bJwugVyCEkfVcrw9a:6",
"37467": "yUTDkKKhbvDrnwkiaoP8HvqxTNC6rNnUe2:6",
"37468": "yTstes2nSaSpvu9nTapiCGnjCLvLD5fUqt:5",
"37469": "Unknown",
"37470": "Unknown",
"37471": "Unknown",
"37472": "Unknown",
"37473": "Unknown",
"37474": "Unknown",
"37475": "Unknown",
"37476": "Unknown",
"37477": "Unknown"
}
Get a filtered list of masternode winners
dash-cli -testnet masternode winners 150 "yTZ99"
Result:
{
"37338": "yTZ99fCnjNu33RDRtawf81iwJ9uxXFmkgM:9",
"37339": "yTZ99fCnjNu33RDRtawf81iwJ9uxXFmkgM:8",
"37432": "yTZ99fCnjNu33RDRtawf81iwJ9uxXFmkgM:6",
"37433": "yTZ99fCnjNu33RDRtawf81iwJ9uxXFmkgM:9"
}
See also:
- MasternodeList: returns a list of masternodes in different modes.
MasternodeBroadcast
The masternodebroadcast
RPC provides a set of commands to create and relay masternode broadcast messages.
Parameter #1—masternode broadcast command
Name | Type | Presence | Description |
---|---|---|---|
command |
string (hex) | Required (exactly 1) |
The command to use:create-alias create-all decode relay |
MNB create-alias
The masternodebroadcast create-alias
RPC creates single remote masternode broadcast message by assigned alias configured in masternode.conf
.
Parameter #2—masternode alias
Name | Type | Presence | Description |
---|---|---|---|
alias |
string | Required (exactly 1) |
The masternode alias for creating the broadcast message |
Result—broadcast message
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Object containing result data |
→alias |
string | Required (exactly 1) |
Alias of the masternode |
→result |
string | Required (exactly 1) |
Result of broadcast message create attempt |
→hex |
string (hex) | Required (exactly 1) |
Masternode broadcast data |
Example from Dash Core 0.12.2
dash-cli -testnet masternodebroadcast create-alias MN01
Result:
{
"alias": "MN01",
"result": "successful",
"hex": "010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff00000000000000000000ffff2d20ed4c4e1f210267fae84ef6aa6ab3d877b47932915a9b406566c873ea025986fc7e15a15fd2f24104341ab0d26ae967856213df205bf172418422a847f3a63941d8031234a64a143f5570a6010d2b5e1dff163c91316a65667f0ee1bfb0ff38edd0a695bea75de731411f8a9bf1e7818c7352c8a02bd31a4da1bb8d88e91c8a9c7151afc076b6a68f54c9087a981a780e6279e9d7b73940ee7aad65c28e4846573bffa74518443380dfde4d3c145a00000000401201000fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff69fc28f4772eaefd17cd1bab575aac752b5944ee3e7221df204b4d04000000004d3c145a00000000411bef1bdf25a500ae2af4052e8504e2f93ec365d5ed9d42e3c52b84714136060f9766068553c450a4b1c0b3d72740580f097f7e62c098addc55f71f016cfda24d7a0001000100"
}
MNB create-all
The masternodebroadcast create-all
RPC creates remote masternode broadcast messages for all masternodes configured in masternode.conf
.
Result—broadcast message(s)
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Object containing result data |
→overall |
string | Required (exactly 1) |
Summary of broadcast message creation success/failure |
→ detail |
object | Required (exactly 1) |
Object containing status details |
→ → status |
object | Required (1 or more) |
Object containing status for each each masternode broadcast message creation attempt |
→ → →alias |
string | Required (exactly 1) |
Alias of the masternode |
→ → →result |
string | Required (exactly 1) |
Result - successful or failed |
→ → →error |
string | Optional | Error message if failed |
→hex |
string (hex) | Optional (exactly 1) |
Masternode broadcast data (if message(s) created successfully) |
Example from Dash Core 0.12.2
dash-cli -testnet masternodebroadcast create-all
Result:
{
"overall": "Successfully created broadcast messages for 1 masternodes, failed to create 0, total 1",
"detail": {
"status": {
"alias": "MN01",
"result": "successful"
}
},
"hex": "010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff00000000000000000000ffff2d20ed4c4e1f210267fae84ef6aa6ab3d877b47932915a9b406566c873ea025986fc7e15a15fd2f24104341ab0d26ae967856213df205bf172418422a847f3a63941d8031234a64a143f5570a6010d2b5e1dff163c91316a65667f0ee1bfb0ff38edd0a695bea75de731411f555444bd95d98b8407ff1b8cc595a3d284c30b9bbaca488a949bc53be08ca1021724527f9a15e9307c7391d9ad563dcc9ced6ae621ae7d6fe3e3c3ba81dce795d143145a00000000401201000fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff914dff1cc3dfc0729bb1f4e3f070d65d1fa41072da5290a54d472d0400000000d143145a00000000411c628109c911ef330aaa789bd621f8c7975290d196beef3ecdaa1133302daccdaa3df82b1f16d753fef884ce3a3eb28a7b621233c14496a010bb49f247190651100001000100"
}
MNB decode
The masternodebroadcast decode
RPC decodes a masternode broadcast message (deserializes from a hex string to JSON).
Parameter #2—object data (hex)
Name | Type | Presence | Description |
---|---|---|---|
data-hex |
string (hex) | Required (exactly 1) |
The data (hex) of the masternode broadcast to decode |
Result—broadcast message(s)
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Object containing result data |
→outpoint |
string (hex) | Required (exactly 1) |
Masternode outpoint |
→addr |
string | Required (exactly 1) |
Masternode IP address and port |
→pubKeyCollateralAddress |
string (hex) | Required (1 or more) |
Masternode collateral public key address |
→pubKeyMasternode |
string (hex) | Required (exactly 1) |
Masternode public key |
→vchSig |
string (base64) | Required (exactly 1) |
Masternode signature |
→sigTime |
int64_t | Required (exactly 1) |
Signature time as a Unix epoch |
→protocolVersion |
int | Required (exactly 1) |
Dash protocol version |
→nLastDsq |
int64_t | Required (exactly 1) |
Dsq count from the last dsq message from this node |
→ lastPing |
object | Required (exactly 1) |
Ping object (mnp message) |
→ →outpoint |
string (hex) | Required (exactly 1) |
Masternode outpoint |
→ →blockHash |
string (hex) | Required (exactly 1) |
Block hash from 12 blocks prior to the current tip |
→ →sigTime |
int64_t | Required (exactly 1) |
Signature time as a Unix epoch |
→ →vchSig |
string (base64) | Required (exactly 1) |
Masternode signature |
→overall |
string | Required (exactly 1) |
Summary of broadcast message creation success/failure |
Example from Dash Core 0.12.2 
masternodebroadcast decode 010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c4\
8778a4fa6bd93fc8f60100000000ffffffff00000000000000000000ffff2d20ed4c4e1f2102\
67fae84ef6aa6ab3d877b47932915a9b406566c873ea025986fc7e15a15fd2f24104341ab0d2\
6ae967856213df205bf172418422a847f3a63941d8031234a64a143f5570a6010d2b5e1dff16\
3c91316a65667f0ee1bfb0ff38edd0a695bea75de731411f8a9bf1e7818c7352c8a02bd31a4d\
a1bb8d88e91c8a9c7151afc076b6a68f54c9087a981a780e6279e9d7b73940ee7aad65c28e48\
46573bffa74518443380dfde4d3c145a00000000401201000fab7e86a6d7c483b836fe862c8a\
23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff69fc28f4772eaefd17cd1b\
ab575aac752b5944ee3e7221df204b4d04000000004d3c145a00000000411bef1bdf25a500ae\
2af4052e8504e2f93ec365d5ed9d42e3c52b84714136060f9766068553c450a4b1c0b3d72740\
580f097f7e62c098addc55f71f016cfda24d7a0001000100
Result:
{
"36b753f9c8d328d405b8a909bbf4fd29c0d37aa48eae98fa1289b90e36e002c4": {
"outpoint": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f-1",
"addr": "45.32.237.76:19999",
"pubKeyCollateralAddress": "yY6AmGopsZS31wy1JLHR9P6AC6owFaXwuh",
"pubKeyMasternode": "yj25teTD6yjcNpQC7inq72tDgsivG6xLZM",
"vchSig": "H4qb8eeBjHNSyKAr0xpNobuNiOkcipxxUa/Adramj1TJCHqYGngOYnnp17c5QO56rWXCjkhGVzv/p0UYRDOA394=",
"sigTime": 1511275597,
"protocolVersion": 70208,
"nLastDsq": 0,
"lastPing": {
"outpoint": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f-1",
"blockHash": "00000000044d4b20df21723eee44592b75ac5a57ab1bcd17fdae2e77f428fc69",
"sigTime": 1511275597,
"vchSig": "G+8b3yWlAK4q9AUuhQTi+T7DZdXtnULjxSuEcUE2Bg+XZgaFU8RQpLHAs9cnQFgPCX9+YsCYrdxV9x8BbP2iTXo="
}
},
"overall": "Successfully decoded broadcast messages for 1 masternodes, failed to decode 0, total 1"
}
MNB relay
The masternodebroadcast relay
RPC relays a masternode broadcast message to the network.
Parameter #2—object data (hex)
Name | Type | Presence | Description |
---|---|---|---|
data-hex |
string (hex) | Required (exactly 1) |
The data (hex) of the masternode broadcast to relay |
Result—broadcast message(s)
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
Object containing result data |
→ Hash |
string (hex) | Required (1 or more) |
Masternode broadcast hash |
→ →outpoint |
string (hex) | Required (exactly 1) |
Masternode outpoint |
→ →addr |
string | Required (exactly 1) |
Masternode IP address and port |
→ → Result |
string (hex) | Required (exactly 1) |
Result - successful or failed |
→ → →error |
string | Optional | Error message if failed |
→overall |
string | Required (exactly 1) |
Summary of broadcast message creation success/failure |
Example from Dash Core 0.12.2 
masternodebroadcast relay 010fab7e86a6d7c483b836fe862c8a23f69aebadce7c58c4\
8778a4fa6bd93fc8f60100000000ffffffff00000000000000000000ffff2d20ed4c4e1f2102\
67fae84ef6aa6ab3d877b47932915a9b406566c873ea025986fc7e15a15fd2f24104341ab0d2\
6ae967856213df205bf172418422a847f3a63941d8031234a64a143f5570a6010d2b5e1dff16\
3c91316a65667f0ee1bfb0ff38edd0a695bea75de731411f8a9bf1e7818c7352c8a02bd31a4d\
a1bb8d88e91c8a9c7151afc076b6a68f54c9087a981a780e6279e9d7b73940ee7aad65c28e48\
46573bffa74518443380dfde4d3c145a00000000401201000fab7e86a6d7c483b836fe862c8a\
23f69aebadce7c58c48778a4fa6bd93fc8f60100000000ffffffff69fc28f4772eaefd17cd1b\
ab575aac752b5944ee3e7221df204b4d04000000004d3c145a00000000411bef1bdf25a500ae\
2af4052e8504e2f93ec365d5ed9d42e3c52b84714136060f9766068553c450a4b1c0b3d72740\
580f097f7e62c098addc55f71f016cfda24d7a0001000100
Result:
{
"36b753f9c8d328d405b8a909bbf4fd29c0d37aa48eae98fa1289b90e36e002c4": {
"outpoint": "f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f-1",
"addr": "45.32.237.76:19999",
"36b753f9c8d328d405b8a909bbf4fd29c0d37aa48eae98fa1289b90e36e002c4": "successful"
},
"overall": "Successfully relayed broadcast messages for 1 masternodes, failed to relay 0, total 1"
}
See also: none
MasternodeList
The masternodelist
RPC returns a list of masternodes in different modes.
Parameter #1—List mode
Name | Type | Presence | Description |
---|---|---|---|
mode |
string | Optional (exactly 1); Required to use filter |
The mode to run list in |
Mode Options
Mode | Description |
---|---|
activeseconds |
Print number of seconds masternode recognized by the network as enabled (since latest issued "masternodestart/start-many/start-alias") |
addr |
Print ip address associated with a masternode (can be additionally filtered, partial match) |
full |
Print info in format ‘status protocol payee lastseen activeseconds lastpaidtime lastpaidblock IP’ (can be additionally filtered, partial match) |
info |
Print info in format ‘status protocol payee lastseen activeseconds sentinelversion sentinelstate IP’ (can be additionally filtered, partial match) |
lastpaidblock |
Print the last block height a node was paid on the network |
lastpaidtime |
Print the last time a node was paid on the network |
lastseen |
Print timestamp of when a masternode was last seen on the network |
payee |
Print Dash address associated with a masternode (can be additionally filtered, partial match) |
protocol |
Print protocol of a masternode (can be additionally filtered, exact match) |
pubkey |
Print the masternode (not collateral) public key |
rank |
Print rank of a masternode based on current block |
status |
Print masternode status: PRE_ENABLED / ENABLED / EXPIRED / WATCHDOG_EXPIRED / NEW_START_REQUIRED / UPDATE_REQUIRED / POSE_BAN / OUTPOINT_SPENT (can be additionally filtered, partial match) |
Parameter #2—List filter
Name | Type | Presence | Description |
---|---|---|---|
filter |
string | Optional (exactly 1) |
Filter results. Partial match by outpoint by default in all modes, additional matches in some modes are also available. |
Result—the masternode list
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
Information about the masternode sync status |
→ Masternode Info |
string | Required (1 or more) |
The requested masternode info. Output varies based on selected mode and filter parameters |
Example from Dash Core 0.12.2
Get unfiltered Masternode list in default mode
dash-cli -testnet masternodelist
Result:
{
"6125fc1da46cd2fdd013b1fbb02144367a95feffd379c08064f38de0e3deb80c-1": "NEW_START_REQUIRED",
"a4676419793d232359dfd7240bf1b0635b56f2a16aac4cb57f7e9ba459d50116-1": "ENABLED",
"2b5142cc7b5472cb34a28e7e1fdefe14f0b1ad4cc9fa9cdc68a169423c18c31d-1": "ENABLED",
"4573c2ba5d9d3f8fd2f903cd0f448ee0ad0ff7e20d8f44a14cfce0bdc894c627-1": "ENABLED",
"08c91dfff1f465b70377007426cd5edc37678991c9a864e39072409a5a0fd22a-1": "ENABLED",
"e3a6b7878a7e9413898bb379b323c521676f9d460db17ec3bf42d9ac0c9a432f-1": "ENABLED",
"866d66b88afed15ed1a936b680ace1a99e0ca14d0242bc2983c5fdd2c16c1637-1": "NEW_START_REQUIRED",
"97034d0cfabef04388f3eb1c78a064607f8ed42013ed0fb821361d6592f03338-0": "ENABLED",
"3003df6b886ed4b0cc84453d8034a546da03fc1052c2088b6b38fd84a4f6fa3f-1": "ENABLED",
"61c4696947438861222d7e992a049bfd2ed87f71eb806d8a111c973215141b59-1": "ENABLED",
"ea7e0a87aa823aa65d111ed767a4a02f55b3cd361cbd250908db00822e72fb59-1": "ENABLED",
"f7851e7f670afa3e758d857c48d477b2f3e1ee37f22de2ca4a852f3885d32e6d-1": "EXPIRED",
"f977fba1db0fd32708f0b9488be3806fed6f013a28630cff25ba06abd1f63d72-1": "ENABLED",
"b418a47e8dfbdbb8eb88c1a153bef27dcbdb057eb136b2bb93b439fe74b8c174-1": "ENABLED",
"7c17695bdccc617410164882bd8b5fb7bf4f5a3dceb0a7476800e161cba1c57f-1": "NEW_START_REQUIRED",
"547a86612325ff23945b052a023537aaa68140920143bbf42bd10aec33348487-1": "ENABLED",
"2c2cf299fdca7c07f820b1bc46bd786a1d57ac6c3d2e76ac24a5ba7641066488-0": "ENABLED",
"75fdd0e1dea139333b71f06f3f2a7440629b3cd106e655ae50b56df7d9aa788b-1": "ENABLED",
"320f83802b37f4bbf881cb565bb6e0884615d6b022a81a837cd3716f8dbcec93-0": "ENABLED",
"049f30949af536b0a866f7d39d05447405565160399d12b4f0796936e8b9b9a7-1": "ENABLED",
"0512f77ebceaf288386e9a050e3c80652c7bfb6e993659ded2dff43eae6904ac-1": "EXPIRED",
"94ce1c802de83977fbed283806a1ebef2dcb5539ce9b6c5627c5ac1d844b48bb-1": "ENABLED",
"b0320c1eff10ccb5e26086017a09e77dacb30fdcafccb3d98db3e5b610b9f1bd-1": "ENABLED",
"2eab488e3a7b030303de0d18e357ce17a9fc6b8876705d61076bbe923b2e5fc8-1": "ENABLED",
"18e496fe85b61ac9a5fcaec1ef683c7e3fc9bce4a83c883608427ecfb1002fca-1": "ENABLED",
"2fb6c98b37f1fce1c35b556e5f175dd77939f08c1687ad468d37fc677d297dd6-1": "ENABLED",
"1e2502158eb22e53c07dbae483e89ebd7fb27e2c0412147d4d376b99df1d94db-1": "ENABLED",
"cd0ee654eb517b8b5c36cfa09e1e5344d1766dc71406a112564636b7aef8c9db-1": "ENABLED",
"4222505288507e0f1abc32f0323cce1d6c4d22c8e785adb0cf8075b70ae92ddf-1": "EXPIRED",
"9f0cd683f88f79f757c6d68515dfb2b9fa5b65239b3c5f4487916aa233b9a4e0-1": "ENABLED",
"2102df0dec504b4bd3a1e80b320c5205fe1a8b2fb1366be83c407f048fd62ce6-1": "ENABLED",
"c6585f4ba88875eb2edc376b9ae24b74fd8c0ef89288923cf16a8fe2787b7ce8-1": "ENABLED",
"b454dd0efc19657f8d56a750385b90ebfb53dce5182a21238b225d6cbb3307f0-1": "NEW_START_REQUIRED",
"400f193988092f779104bab20eec042a2686a9903b1bbc84ece7539fd41103f3-1": "ENABLED",
"a087bcb1c2f7fc71f081f2d8eeeeb4928ae21af2087c3d77ce5a5c4e88ec26f4-1": "ENABLED",
"100a6ef1f9c660cfc6e47dab9905d7ca2a435f1870aba46847eae6503e2858fd-1": "ENABLED",
"bbbe50330423337a13501e6273663884f7cb9b475f6d5cf090ba3dabc611d9fe-1": "ENABLED"
}
Get a filtered Masternode list
dash-cli -testnet masternodelist full "NEW"
Result:
{
"6125fc1da46cd2fdd013b1fbb02144367a95feffd379c08064f38de0e3deb80c-1": "NEW_START_REQUIRED 70208 yh7RGWjZN8yDAAzPpYFUJZAj41jG7G43c8 1507401630 0 1507409411 5874 1.1.1.1:19999",
"866d66b88afed15ed1a936b680ace1a99e0ca14d0242bc2983c5fdd2c16c1637-1": "NEW_START_REQUIRED 70208 yQHJ4muL7FyhUj1x8iBr2Ws9E4cJ68DKin 1507626190 138962 1507620650 7215 178.62.203.249:19999",
"7c17695bdccc617410164882bd8b5fb7bf4f5a3dceb0a7476800e161cba1c57f-1": "NEW_START_REQUIRED 70208 yjWGCrz6iJnDsrog5FX6ag3iQUNor9UFj5 1507636178 0 0 0 83.1.99.1:19999",
"0512f77ebceaf288386e9a050e3c80652c7bfb6e993659ded2dff43eae6904ac-1": "NEW_START_REQUIRED 70208 ydahSbZKWUjBi6jHeWjLgr7navPoZVCgwH 1507646277 32460 1507649163 7397 172.104.45.115:19999",
"4222505288507e0f1abc32f0323cce1d6c4d22c8e785adb0cf8075b70ae92ddf-1": "NEW_START_REQUIRED 70208 yUznkRL396PewekhtCpUJkfJcxt8fhDyoX 1507646174 9996 1507642757 7355 83.1.99.2:19999",
"b454dd0efc19657f8d56a750385b90ebfb53dce5182a21238b225d6cbb3307f0-1": "NEW_START_REQUIRED 70208 yYR5dcULfpnbPSixorzMkQ9SGwzPPsXcuC 1507401632 0 1507408648 5868 2.2.2.2:19999"
}
See also:
- Masternode: provides a set of commands for managing masternodes and displaying information about them.
- MasternodeBroadcast: provides a set of commands to create and relay masternode broadcast messages.
- MnSync: returns the sync status, updates to the next step or resets it entirely.
MnSync
The mnsync
RPC returns the sync status, updates to the next step or resets it entirely.
Parameter #1—Command mode
Name | Type | Presence | Description |
---|---|---|---|
mode |
string | Required (exactly 1) |
The command mode to use:status - Get masternode sync statusnext - Move to next sync assetreset - Reset sync status |
Command Mode - status
Result—the sync status
Name | Type | Presence | Description |
---|---|---|---|
result |
object/null | Required (exactly 1) |
Information about the masternode sync status |
→AssetID |
number (int) | Required (exactly 1) |
The sync asset ID |
→AssetName |
string | Required (exactly 1) |
The sync asset name |
→AssetStartTime |
number (int) | Required (exactly 1) |
The sync asset start time |
→Attempt |
number (int) | Required (exactly 1) |
The sync attempt number |
→IsBlockchainSynced |
boolean | Required (exactly 1) |
Blockchain sync status |
→IsMasternodeListSynced |
boolean | Required (exactly 1) |
Masternode list sync status |
→IsWinnersListSynced |
boolean | Required (exactly 1) |
Masternode winners list sync status |
→IsSynced |
boolean | Required (exactly 1) |
Masternode sync status |
→IsFailed |
boolean | Required (exactly 1) |
Masternode list sync fail status |
Sync Assets
AssetID | AssetName |
---|---|
0 | MASTERNODE_SYNC_INITIAL |
1 | MASTERNODE_SYNC_WAITING |
2 | MASTERNODE_SYNC_LIST |
3 | MASTERNODE_SYNC_MNW |
4 | MASTERNODE_SYNC_GOVERNANCE |
-1 | MASTERNODE_SYNC_FAILED |
999 | MASTERNODE_SYNC_FINISHED |
Example from Dash Core 0.12.2
Get Masternode sync status
dash-cli -testnet mnsync status
Result:
{
"AssetID": 999,
"AssetName": "MASTERNODE_SYNC_FINISHED",
"AssetStartTime": 1507662300,
"Attempt": 0,
"IsBlockchainSynced": true,
"IsMasternodeListSynced": true,
"IsWinnersListSynced": true,
"IsSynced": true,
"IsFailed": false
}
Command Mode - next
Result—next command return status
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
Command return status |
Example from Dash Core 0.12.2
dash-cli -testnet mnsync next
Result:
sync updated to MASTERNODE_SYNC_LIST
Command Mode - reset
Result—reset command return status
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
Command return status:success or failure |
Example from Dash Core 0.12.2
dash-cli -testnet mnsync reset
Result:
success
See also:
- Masternode: provides a set of commands for managing masternodes and displaying information about them.
- MasternodeBroadcast: provides a set of commands to create and relay masternode broadcast messages.
- MasternodeList: returns a list of masternodes in different modes.
Move
Requires wallet support.
The move
RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
Warning:
move
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Warning: it’s allowed to move more funds than are in an account,
giving the sending account a negative balance and giving the receiving
account a balance that may exceed the number of dash in the wallet
(or the number of dash in existence).
Parameter #1—from account
Name | Type | Presence | Description |
---|---|---|---|
From Account | string | Required (exactly 1) |
The name of the account to move the funds from |
Parameter #2—to account
Name | Type | Presence | Description |
---|---|---|---|
To Account | string | Required (exactly 1) |
The name of the account to move the funds to |
Parameter #3—amount to move
Name | Type | Presence | Description |
---|---|---|---|
Amount | number (dash) | Required (exactly 1) |
The amount of dash to move |
Parameter #4—an unused parameter
Name | Type | Presence | Description |
---|---|---|---|
Unused | number (int) | Optional (0 or 1) |
This parameter is no longer used. If parameter #5 needs to be specified, this can be any integer |
Parameter #5—a comment
Name | Type | Presence | Description |
---|---|---|---|
Comment | string | Optional (0 or 1) |
A comment to assign to this move payment |
Result—true
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
bool | Required (exactly 1) |
Set to true if the move was successful |
Example from Dash Core 0.12.2
Move 1 dash from “doc test” to “test1”, giving the transaction the comment “Example move”:
dash-cli -testnet move "doc test" "test1" 0.1 0 "Example move"
Result:
true
See also
- ListAccounts: lists accounts and their balances.
- SendFrom: spends an amount from a local account to a dash address.
- SendToAddress: spends an amount to a given address.
Ping
The ping
RPC sends a P2P ping message to all connected nodes to measure ping time. Results are provided by the getpeerinfo
RPC pingtime and pingwait fields as decimal seconds. The P2P ping
message is handled in a queue with all other commands, so it measures processing backlog, not just network ping.
Parameters: none
Result—null
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required | Always JSON null |
Example from Dash Core 0.12.2
dash-cli -testnet ping
(Success: no result printed.)
Get the results using the getpeerinfo
RPC:
dash-cli -testnet getpeerinfo | grep ping
Results:
"pingtime" : 0.11790800,
"pingtime" : 0.22673400,
"pingtime" : 0.16451900,
"pingtime" : 0.12465200,
"pingtime" : 0.13267900,
"pingtime" : 0.23983300,
"pingtime" : 0.16764700,
"pingtime" : 0.11337300,
See also
- GetPeerInfo: returns data about each connected network node.
- P2P Ping Message
PreciousBlock
Added in Bitcoin Core 0.14.0
Not implemented in Dash Core (as of 0.12.2)
PrivateSend
The privatesend
RPC controls the mixing process.
Name | Type | Presence | Description |
---|---|---|---|
mode |
string | Required (exactly 1) |
The command mode to use:start - Start mixingstop - Stop mixingreset - Reset mixing |
Command Mode - start
Result—start command return status
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
Command return status |
Example from Dash Core 0.12.2
dash-cli -testnet privatesend start
Result:
Mixing started successfully
Command Mode - stop
Result—stop command return status
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
Command return status |
Example from Dash Core 0.12.2
dash-cli -testnet privatesend stop
Result:
Mixing was stopped
Command Mode - reset
Result—reset command return status
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
Command return status |
Example from Dash Core 0.12.2
dash-cli -testnet privatesend reset
Result:
Mixing was reset
See also: none
PrioritiseTransaction
The prioritisetransaction
RPC adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)
Parameter #1—the TXID of the transaction to modify
Name | Type | Presence | Description |
---|---|---|---|
TXID | string | Required (exactly 1) |
The TXID of the transaction whose virtual priority or fee you want to modify, encoded as hex in RPC byte order |
Parameter #2—the change to make to the virtual priority
Name | Type | Presence | Description |
---|---|---|---|
Priority | number (real) | Required (exactly 1) |
If positive, the priority to add to the transaction in addition to its computed priority; if negative, the priority to subtract from the transaction’s computed priory. Computed priority is the age of each input in days since it was added to the block chain as an output (coinage) times the value of the input in satoshis (value) divided by the size of the serialized transaction (size), which is coinage * value / size |
Parameter #3—the change to make to the virtual fee
Name | Type | Presence | Description |
---|---|---|---|
Fee | number (int) | Required (exactly 1) |
Warning: this value is in duffs, not Dash If positive, the virtual fee to add to the actual fee paid by the transaction; if negative, the virtual fee to subtract from the actual fee paid by the transaction. No change is made to the actual fee paid by the transaction |
Result—true
if the priority is changed
Name | Type | Presence | Description |
---|---|---|---|
result |
bool (true only) | Required (exactly 1) |
Always set to true if all three parameters are provided. Will not return an error if the TXID is not in the memory pool. If fewer or more than three arguments are provided, or if something goes wrong, will be set to null |
Example from Dash Core 0.12.2
dash-cli -testnet prioritisetransaction \
f86c74f27fdd9c7e618d69b3606eeae1710b3f02fabede6ae8c88dd7bb756942 \
1234 456789
Result:
true
See also
- GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.
- GetBlockTemplate: gets a block template or proposal for use with mining software.
PruneBlockChain
Added in Bitcoin Core 0.14.0
Not implemented in Dash Core (as of 0.12.2)
RemovePrunedFunds
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
SendFrom
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The sendfrom
RPC spends an amount from a local account to a dash address.
Warning:
sendfrom
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—from account
Name | Type | Presence | Description |
---|---|---|---|
From Account | string | Required (exactly 1) |
The name of the account from which the dash should be spent. Use an empty string (“”) for the default account |
Parameter #2—to address
Name | Type | Presence | Description |
---|---|---|---|
To Address | string | Required (exactly 1) |
A P2PKH or P2SH address to which the dash should be sent |
Parameter #3—amount to spend
Name | Type | Presence | Description |
---|---|---|---|
Amount | number (dash) | Required (exactly 1) |
The amount to spend in dash. Dash Core will ensure the account has sufficient dash to pay this amount (but the transaction fee paid is not included in the calculation, so an account can spend a total of its balance plus the transaction fee) |
Parameter #4—minimum confirmations
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an incoming transaction must have for its outputs to be credited to this account’s balance. Outgoing transactions are always counted, as are move transactions made with the move RPC. If an account doesn’t have a balance high enough to pay for this transaction, the payment will be rejected. Use 0 to spend unconfirmed incoming payments. Default is 1 |
Warning: if account1 receives an unconfirmed payment and transfers
it to account2 with the
move
RPC, account2 will be able to spend those
dash even if this parameter is set to 1
or higher.
Parameter #5—whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (0 or 1) |
If set to true , add the number of InstantSend confirmations (default=5) to the confirmation count for transactions locked via InstantSend. If set to false (the default), the standard confirmation count is not modified for InstantSend transactions. |
Parameter #6—a comment
Name | Type | Presence | Description |
---|---|---|---|
Comment | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment |
Parameter #7—a comment about who the payment was sent to
Name | Type | Presence | Description |
---|---|---|---|
Comment To | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment |
Result—a TXID of the sent transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The TXID of the sent transaction, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
Spend 0.1 dash from the account “test” to the address indicated below using only UTXOs with at least six confirmations, giving the transaction the comment “Example spend” and labeling the spender “Example.com”:
dash-cli -testnet sendfrom "test" \
yhJays6zGUFKq1KS5V5WLbyk3cwCXyGrKd \
0.1 \
6 \
false \
"Example spend" \
"Example.com"
Result:
cd64b9d55c63bf247f2eca32f978e340622107b607a46c422dabcdc20c0571fe
See also
- SendToAddress: spends an amount to a given address.
- SendMany: creates and broadcasts a transaction which sends outputs to multiple addresses.
SendMany
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The sendmany
RPC creates and broadcasts a transaction which sends outputs to multiple addresses.
Parameter #1—from account
Name | Type | Presence | Description |
---|---|---|---|
From Account | string | Required (exactly 1) |
Deprecated: will be removed in a later version of Dash Core The name of the account from which the dash should be spent. Use an empty string (“”) for the default account. Dash Core will ensure the account has sufficient dash to pay the total amount in the outputs field described below (but the transaction fee paid is not included in the calculation, so an account can spend a total of its balance plus the transaction fee) |
Parameter #2—the addresses and amounts to pay
Name | Type | Presence | Description |
---|---|---|---|
Outputs | object | Required (exactly 1) |
An object containing key/value pairs corresponding to the addresses and amounts to pay |
→ Address/Amount |
string (base58) : number (dash) | Required (1 or more) |
A key/value pair with a base58check-encoded string containing the P2PKH or P2SH address to pay as the key, and an amount of dash to pay as the value |
Parameter #3—minimum confirmations
Name | Type | Presence | Description |
---|---|---|---|
Confirmations | number (int) | Optional (0 or 1) |
The minimum number of confirmations an incoming transaction must have for its outputs to be credited to this account’s balance. Outgoing transactions are always counted, as are move transactions made with the move RPC. If an account doesn’t have a balance high enough to pay for this transaction, the payment will be rejected. Use 0 to spend unconfirmed incoming payments. Default is 1 |
Warning: if account1 receives an unconfirmed payment and transfers
it to account2 with the
move
RPC, account2 will be able to spend those
dash even if this parameter is set to 1
or higher.
Parameter #4–whether to add 5 confirmations to transactions locked via InstantSend
Name | Type | Presence | Description |
---|---|---|---|
addlockconf | bool | Optional (0 or 1) |
If set to true , add the number of InstantSend confirmations (default=5) to the confirmation count for transactions locked via InstantSend. If set to false (the default), the standard confirmation count is not modified for InstantSend transactions. |
Parameter #5—a comment
Name | Type | Presence | Description |
---|---|---|---|
Comment | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment |
Parameter #6—automatic fee subtraction
Name | Type | Presence | Description |
---|---|---|---|
Subtract Fee From Amount | array | Optional (0 or 1) |
An array of addresses. The fee will be equally divided by as many addresses as are entries in this array and subtracted from each address. If this array is empty or not provided, the fee will be paid by the sender |
→ Address |
string (base58) | Optional (0 or more) | An address previously listed as one of the recipients. |
Parameter #7—use InstantSend
Name | Type | Presence | Description |
---|---|---|---|
Use InstantSend | bool | Optional (0 or 1) |
If set to true , send this transaction as InstantSend (default: false). |
Parameter #8—use PrivateSend
Name | Type | Presence | Description |
---|---|---|---|
Use PrivateSend | bool | Optional (0 or 1) |
If set to true , use anonymized funds only (default: false). |
Result—a TXID of the sent transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The TXID of the sent transaction, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
From the account test1, send 0.1 dash to the first address and 0.2 dash to the second address, with a comment of “Example Transaction”.
dash-cli -testnet sendmany \
"test1" \
'''
{
"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 0.1,
"yhQrX8CZTTfSjKmaq5h7DgSShyEsumCRBi": 0.2
} ''' \
6 \
false \
"Example Transaction"
Result:
a7c0194a005a220b9bfeb5fdd12d5b90979c10f53de4f8a48a1495aa198a6b95
Example from Dash Core 0.12.2 (InstantSend)
From the account test1, send 0.1 dash to the first address and 0.2 dash to the second address using InstantSend, with a comment of “Example Transaction”.
dash-cli -testnet sendmany \
"test1" \
'''
{
"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 0.1,
"yhQrX8CZTTfSjKmaq5h7DgSShyEsumCRBi": 0.2
} ''' \
6 \
false \
"Example Transaction"
'''
[""]
''' \
true
Result:
3a5bbaa1a7aa3a8af45e8f1adf79528f99efc61052b0616d41b33fb8fb7af347
Example from Dash Core 0.12.2 (PrivateSend)
From the account test1, send 0.1 dash to the first address and 0.2 dash to the second address using PrivateSend, with a comment of “Example Transaction”.
dash-cli -testnet sendmany \
"test1" \
'''
{
"ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv": 0.1,
"yhQrX8CZTTfSjKmaq5h7DgSShyEsumCRBi": 0.2
} ''' \
6 \
false \
"Example Transaction"
'''
[""]
''' \
false \
true
Result:
43337c8e4f3b21bedad7765fa851a6e855e4bb04f60d6b3e4c091ed21ffc5753
See also
- SendFrom: spends an amount from a local account to a dash address.
- SendToAddress: spends an amount to a given address.
- Move: moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
SendRawTransaction
The sendrawtransaction
RPC validates a transaction and broadcasts it to the peer-to-peer network.
Parameter #1—a serialized transaction to broadcast
Name | Type | Presence | Description |
---|---|---|---|
Transaction | string (hex) | Required (exactly 1) |
The serialized transaction to broadcast encoded as hex |
Parameter #2–whether to allow high fees
Name | Type | Presence | Description |
---|---|---|---|
Allow High Fees | bool | Optional (0 or 1) |
Set to true to allow the transaction to pay a high transaction fee. Set to false (the default) to prevent Bitcoin Core from broadcasting the transaction if it includes a high fee. Transaction fees are the sum of the inputs minus the sum of the outputs, so this high fees check helps ensures user including a change address to return most of the difference back to themselves |
Parameter #3–whether to use InstantSend
Name | Type | Presence | Description |
---|---|---|---|
Use InstantSend | bool | Optional (0 or 1) |
Set to true to send as an InstantSend transaction. Set to false (the default) to send as a normal transaction |
Result—a TXID or error message
Name | Type | Presence | Description |
---|---|---|---|
result |
null/string (hex) | Required (exactly 1) |
If the transaction was accepted by the node for broadcast, this will be the TXID of the transaction encoded as hex in RPC byte order. If the transaction was rejected by the node, this will set to null , the JSON-RPC error field will be set to a code, and the JSON-RPC message field may contain an informative error message |
Examples from Dash Core 0.12.2
Broadcast a signed transaction:
dash-cli -testnet sendrawtransaction 01000000016b490886c0198b\
028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e0601000000694630\
43022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe943354\
45ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f\
561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71b\
d4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa99504\
ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8\
ebb5b64486dc43400c0226b428a488ac00000000
Result:
2f124cb550d9967b81914b544dea3783de23e85d67a9816f9bada665ecfe1cd5
See also
- 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.
- DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction.
- SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
SendToAddress
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The sendtoaddress
RPC spends an amount to a given address.
Parameter #1—to address
Name | Type | Presence | Description |
---|---|---|---|
To Address | string | Required (exactly 1) |
A P2PKH or P2SH address to which the dash should be sent |
Parameter #2—amount to spend
Name | Type | Presence | Description |
---|---|---|---|
Amount | number (dash) | Required (exactly 1) |
The amount to spent in dash |
Parameter #3—a comment
Name | Type | Presence | Description |
---|---|---|---|
Comment | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Default is no comment |
Parameter #4—a comment about who the payment was sent to
Name | Type | Presence | Description |
---|---|---|---|
Comment To | string | Optional (0 or 1) |
A locally-stored (not broadcast) comment assigned to this transaction. Meant to be used for describing who the payment was sent to. Default is no comment |
Parameter #5—automatic fee subtraction
Name | Type | Presence | Description |
---|---|---|---|
Subtract Fee From Amount | boolean | Optional (0 or 1) |
The fee will be deducted from the amount being sent. The recipient will receive less dash than you enter in the amount field. Default is false |
Parameter #6—use InstantSend
Name | Type | Presence | Description |
---|---|---|---|
Use InstantSend | bool | Optional (0 or 1) |
If set to true , send this transaction as InstantSend (default: false). |
Parameter #7—use PrivateSend
Name | Type | Presence | Description |
---|---|---|---|
Use PrivateSend | bool | Optional (0 or 1) |
If set to true , use anonymized funds only (default: false). |
Result—a TXID of the sent transaction
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The TXID of the sent transaction, encoded as hex in RPC byte order |
Example from Dash Core 0.12.2
Spend 0.1 dash to the address below with the comment “sendtoaddress example” and the comment-to “Nemo From Example.com”:
dash-cli -testnet sendtoaddress ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv \
1.0 "sendtoaddress example" "Nemo From Example.com"
Result:
70e2029d363f0110fe8a0aa2ba7bd771a579453135568b2aa559b2cb30f875aa
Example from Dash Core 0.12.2 (InstantSend)
Spend 0.1 dash via InstantSend to the address below with the comment “sendtoaddress example” and the comment-to “Nemo From Example.com”:
dash-cli -testnet sendtoaddress ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv \
1.0 "sendtoaddress example" "Nemo From Example.com" false true
Result:
af002b9c931b5efb5b2852df3d65efd48c3b9ac2ba0ef8a4cf97b894f3ff08c2
Example from Dash Core 0.12.2 (PrivateSend)
Spend 0.1 dash via PrivateSend to the address below with the comment “sendtoaddress example” and the comment-to “Nemo From Example.com”:
dash-cli -testnet sendtoaddress ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv \
1.0 "sendtoaddress example" "Nemo From Example.com" false false true
Result:
949833bc49e0643f63e2afed1704ccccf005a93067a4e46165b06ace42544694
Example from Dash Core 0.12.2 (InstantSend + PrivateSend)
Spend 0.1 dash via InstantSend and PrivateSend to the address below with the comment “sendtoaddressexample” and the comment-to “Nemo From Example.com”:
dash-cli -testnet sendtoaddress ySutkc49Khpz1HQN8AfWNitVBLwqtyaxvv \
1.008 "sendtoaddress example" "Nemo From Example.com" false true true
Result:
ba4bbe29fa06b67d6f3f3a73e381627e66abe22e217ce329aefad41ea72c3922
See also
- InstantSendToAddress: InstantSend an amount to a given address.
- SendFrom: spends an amount from a local account to a dash address.
- SendMany: creates and broadcasts a transaction which sends outputs to multiple addresses.
- Move: moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
SetAccount
Requires wallet support.
The setaccount
RPC puts the specified address in the given account.
Warning:
setaccount
will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
Parameter #1—a dash address
Name | Type | Presence | Description |
---|---|---|---|
Address | string (base58) | Required (exactly 1) |
The P2PKH or P2SH address to put in the account. Must already belong to the wallet |
Parameter #2—an account
Name | Type | Presence | Description |
---|---|---|---|
Account | string | Required (exactly 1) |
The name of the account in which the address should be placed. May be the default account, an empty string (“”) |
Result—null
if successful
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Set to JSON null if the address was successfully placed in the account |
Example from Dash Core 0.12.2
Put the address indicated below in the “doc test” account.
dash-cli -testnet setaccount \
yMTFRnrfJ4NpnYVeidDNHVwT7uuNsVjevq "doc test"
(Success: no result displayed.)
See also
- GetAccount: returns the name of the account associated with the given address.
- ListAccounts: lists accounts and their balances.
- GetAddressesByAccount: returns a list of every address assigned to a particular account.
SetBan
Added in Bitcoin Core 0.12.0
The setban
RPC attempts add or remove a IP/Subnet from the banned list.
Parameter #1—IP/Subnet of the node
Name | Type | Presence | Description |
---|---|---|---|
IP(/Netmask) | string | Required (exactly 1) |
The node to add or remove as a string in the form of <IP address> . The IP address may be a hostname resolvable through DNS, an IPv4 address, an IPv4-as-IPv6 address, or an IPv6 address |
Parameter #2—whether to add or remove the node
Name | Type | Presence | Description |
---|---|---|---|
Command | string | Required (exactly 1) |
What to do with the IP/Subnet address above. Options are: • add to add a node to the addnode list• remove to remove a node from the list. If currently connected, this will disconnect immediately |
Parameter #3—time how long the ip is banned
Name | Type | Presence | Description |
---|---|---|---|
Bantime | numeric (int) |
Optional (0 or 1) |
Time in seconds how long (or until when if absolute is set) the entry is banned. The default is 24h which can also be overwritten by the -bantime startup argument |
Parameter #4—whether a relative or absolute timestamp
Name | Type | Presence | Description |
---|---|---|---|
Absolute | bool | Optional (0 or 1) |
If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT) |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always JSON null |
Example from Dash Core 0.12.2
Ban the following node.
dash-cli -testnet setban 192.0.2.113 add 2592000
Result (no output from dash-cli
because result is set to null
).
See also
- ListBanned: lists all banned IPs/Subnets.
- ClearBanned: clears list of banned nodes.
SetGenerate
Requires wallet support.
Removed in Bitcoin Core 0.13.0.
The setgenerate
RPC enables or disables hashing to attempt to find the next block.
Parameter #1—enable/disable generation
Name | Type | Presence | Description |
---|---|---|---|
generate |
boolean | Required (exactly 1) |
Set to true to turn on generation, false to turn off. |
Parameter #2—processor limit
Name | Type | Presence | Description |
---|---|---|---|
genproclimit |
number (int) | Optional (exactly 1) |
Set the processor limit for when generation is on. Can be -1 for unlimited. |
Result—the generated block header hashes
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always JSON null |
Example from Dash Core 0.12.2
Enable generation using 1 processor:
dash-cli -testnet setgenerate 1
Result:
(Success: no result displayed. Process manager shows 100% CPU usage.)
See also
- Generate: mines blocks immediately (before the RPC call returns).
- GenerateToAddress: mines blocks immediately to a specified address.
- GetMiningInfo: returns various mining-related information.
- GetBlockTemplate: gets a block template or proposal for use with mining software.
SetNetworkActive
Added in Bitcoin Core 0.14.0
The setnetworkactive
RPC disables/enables all P2P network activity.
Parameter #1—whether to disable or enable all P2P network activity
Name | Type | Presence | Description |
---|---|---|---|
Activate | bool | Required (exactly 1) |
Set to true to enable all P2P network activity. Set to false to disable all P2P network activity |
Result—null
or error on failure
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
JSON null . The JSON-RPC error field will be set only if you entered an invalid parameter |
Example from Dash Core 0.12.2
dash-cli setnetworkactive true
Result (no output from dash-cli
because result is set to null
).
See also
- GetNetworkInfo: returns information about the node’s connection to the network.
SetTxFee
Requires wallet support.
The settxfee
RPC sets the transaction fee per kilobyte paid by transactions created by this wallet.
Parameter #1—the transaction fee amount per kilobyte
Name | Type | Presence | Description |
---|---|---|---|
Transaction Fee Per Kilobyte | number (dash) | Required (exactly 1) |
The transaction fee to pay, in dash, for each kilobyte of transaction data. Be careful setting the fee too low—your transactions may not be relayed or included in blocks |
Result: true
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
bool (true) | Required (exactly 1) |
Set to true if the fee was successfully set |
Example from Dash Core 0.12.2
Set the transaction fee per kilobyte to 10,000 duffs.
dash-cli -testnet settxfee 0.00010000
Result:
true
See also
- GetWalletInfo: provides information about the wallet.
- GetNetworkInfo: returns information about the node’s connection to the network.
SignMessage
Requires wallet support. Requires an unlocked wallet or an unencrypted wallet.
The signmessage
RPC signs a message with the private key of an address.
Parameter #1—the address corresponding to the private key to sign with
Name | Type | Presence | Description |
---|---|---|---|
Address | string (base58) | Required (exactly 1) |
A P2PKH address whose private key belongs to this wallet |
Parameter #2—the message to sign
Name | Type | Presence | Description |
---|---|---|---|
Message | string | Required (exactly 1) |
The message to sign |
Result—the message signature
Name | Type | Presence | Description |
---|---|---|---|
result |
string (base64) | Required (exactly 1) |
The signature of the message, encoded in base64. |
Example from Dash Core 0.12.2
Sign a the message “Hello, World!” using the following address:
dash-cli -testnet signmessage yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb "Hello, World!"
Result:
H4XULzfHCf16In2ECk9Ta9QxQPq639zQto2JA3OLlo3JbUdrClvJ89+A1z+Z9POd6l8LJhn1jGpQYF8mX4jkQvE=
See also
- VerifyMessage: verifies a signed message.
SignMessageWithPrivKey
Added in Bitcoin Core 0.13.0
Not implemented in Dash Core (as of 0.12.2)
SignRawTransaction
The signrawtransaction
RPC signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
Parameter #1—the transaction to sign
Name | Type | Presence | Description |
---|---|---|---|
Transaction | string (hex | Required (exactly 1) |
The transaction to sign as a serialized transaction |
Parameter #2—unspent transaction output details
Name | Type | Presence | Description |
---|---|---|---|
Dependencies | array | Optional (0 or 1) |
The previous outputs being spent by this transaction |
→ Output |
object | Optional (0 or more) |
An output being spent |
→ →txid |
string (hex) | Required (exactly 1) |
The TXID of the transaction the output appeared in. The TXID must be encoded in hex in RPC byte order |
→ →vout |
number (int) | Required (exactly 1) |
The index number of the output (vout) as it appeared in its transaction, with the first output being 0 |
→ →scriptPubKey |
string (hex) | Required (exactly 1) |
The output’s pubkey script encoded as hex |
→ →redeemScript |
string (hex) | Optional (0 or 1) |
If the pubkey script was a script hash, this must be the corresponding redeem script |
Parameter #3—private keys for signing
Name | Type | Presence | Description |
---|---|---|---|
Private Keys | array | Optional (0 or 1) |
An array holding private keys. If any keys are provided, only they will be used to sign the transaction (even if the wallet has other matching keys). If this array is empty or not used, and wallet support is enabled, keys from the wallet will be used |
→ Key |
string (base58) | Required (1 or more) |
A private key in base58check format to use to create a signature for this transaction |
Parameter #4—signature hash type
Name | Type | Presence | Description |
---|---|---|---|
SigHash | string | Optional (0 or 1) |
The type of signature hash to use for all of the signatures performed. (You must use separate calls to the signrawtransaction RPC if you want to use different signature hash types for different signatures. The allowed values are: ALL , NONE , SINGLE , ALL|ANYONECANPAY , NONE|ANYONECANPAY , and SINGLE|ANYONECANPAY |
Result—the transaction with any signatures made
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
The results of the signature |
→hex |
string (hex) | Required (exactly 1) |
The resulting serialized transaction encoded as hex with any signatures made inserted. If no signatures were made, this will be the same transaction provided in parameter #1 |
→complete |
bool | Required (exactly 1) |
The value true if transaction is fully signed; the value false if more signatures are required |
Example from Dash Core 0.12.2
Sign the hex generated in the example section for the createrawtransaction
RPC:
dash-cli -testnet signrawtransaction 01000000016b490886c0198b028c6c5cb14\
5c4eb3b1055a224a7a105aadeff41b69ec91e060100000000ffffffff0200205fa012000\
0001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001\
976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000
Result:
{
"hex": "01000000016b490886c0198b028c6c5cb145c4eb3b1055a224a7a105aadeff41b69ec91e060100000069463043022033a61c56fa0867ed67b76b023204a9dc0ee6b0d63305dc5f65fe94335445ff2f021f712f55399d5238fc7146497c431fc4182a1de0b96fc22716e0845f561d542e012102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29ffffffff0200205fa0120000001976a914485485425fa99504ec1638ac4213f3cfc9f32ef388acc0a8f9be010000001976a914811eacc14db8ebb5b64486dc43400c0226b428a488ac00000000",
"complete": true
}
See also
- 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.
- DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction.
- SendRawTransaction: validates a transaction and broadcasts it to the peer-to-peer network.
SentinelPing
The sentinelping
RPC sends a Sentinel Ping to the network.
Parameter #1—sentinel version
Name | Type | Presence | Description |
---|---|---|---|
Version | string | Required (exactly 1) |
Sentinel version in the form ‘x.x.x’ |
Result—the message signature
Name | Type | Presence | Description |
---|---|---|---|
Result | bool | Required (exactly 1) |
Ping result |
Example from Dash Core 0.12.2
dash-cli -testnet sentinelping
Result:
true
See also: none
Spork
The spork
RPC reads or updates spork settings on the network.
To display the status of sporks, use the show
or active
syntax.
Parameter #1—Command mode
Name | Type | Presence | Description |
---|---|---|---|
mode |
string | Required (exactly 1) |
The command mode to use:show - Display spork valuesactive - Display spork activation status |
Command Mode - show
Result—spork values
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Object containing status |
→Spork Value |
int64_t | Required (1 or more) |
Spork value (epoch datetime to enable/disable) |
Example from Dash Core 0.12.2
dash-cli -testnet spork show
Result:
{
"SPORK_2_INSTANTSEND_ENABLED": 0,
"SPORK_3_INSTANTSEND_BLOCK_FILTERING": 0,
"SPORK_5_INSTANTSEND_MAX_VALUE": 1000,
"SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT": 0,
"SPORK_9_SUPERBLOCKS_ENABLED": 0,
"SPORK_10_MASTERNODE_PAY_UPDATED_NODES": 0,
"SPORK_12_RECONSIDER_BLOCKS": 0,
"SPORK_13_OLD_SUPERBLOCK_FLAG": 4070908800,
"SPORK_14_REQUIRE_SENTINEL_FLAG": 0
}
Command Mode - active
Result—spork active status
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Object containing status |
→Spork Activation Status |
bool | Required (1 or more) |
Spork activation status |
Example from Dash Core 0.12.2
dash-cli -testnet spork active
Result:
{
"SPORK_2_INSTANTSEND_ENABLED": true,
"SPORK_3_INSTANTSEND_BLOCK_FILTERING": true,
"SPORK_5_INSTANTSEND_MAX_VALUE": true,
"SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT": true,
"SPORK_9_SUPERBLOCKS_ENABLED": true,
"SPORK_10_MASTERNODE_PAY_UPDATED_NODES": true,
"SPORK_12_RECONSIDER_BLOCKS": true,
"SPORK_13_OLD_SUPERBLOCK_FLAG": false,
"SPORK_14_REQUIRE_SENTINEL_FLAG": true
}
To update the state of a spork activation, use the <name> [value]
syntax.
Command Mode - update
Parameter #1—Spork name
Name | Type | Presence | Description |
---|---|---|---|
name |
string | Required (exactly 1) |
The name of the spork to update |
Parameter #2—Spork value
Name | Type | Presence | Description |
---|---|---|---|
value |
int | Required (exactly 1) |
The value to assign the spork |
Result—spork update status
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Update status (success or failure ) |
Example from Dash Core 0.12.2
dash-cli -testnet spork SPORK_2_INSTANTSEND_ENABLED 0
Result:
failure
See also: none
Stop
The stop
RPC safely shuts down the Dash Core server.
Parameters: none
Result—the server is safely shut down
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The string “Dash Core server stopping” |
Example from Dash Core 0.12.2
dash-cli -testnet stop
Result:
Dash Core server stopping
See also: none
SubmitBlock
The submitblock
RPC accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs.
Parameter #1—the new block in serialized block format as hex
Name | Type | Presence | Description |
---|---|---|---|
Block | string (hex) | Required (exactly 1) |
The full block to submit in serialized block format as hex |
Parameter #2—additional parameters
Name | Type | Presence | Description |
---|---|---|---|
Parameters | object | Optional (0 or 1) |
A JSON object containing extra parameters. Not used directly by Dash Core and also not broadcast to the network. This is available for use by mining pools and other software. A common parameter is a workid string |
Result—null
or error string
Name | Type | Presence | Description |
---|---|---|---|
result |
null/string | Required (exactly 1) |
If the block submission succeeded, set to JSON null . If submission failed, set to one of the following strings: duplicate , duplicate-invalid , inconclusive , or rejected . The JSON-RPC error field will still be set to null if submission failed for one of these reasons |
Example from Dash Core 0.12.2
Submit the following block with the workid, “test”.
dash-cli -testnet submitblock 0100002032e3965d5fdd7a883209d516599337eb4cb82f\
7aea22ecc114942c1f00000000244388a3bd2c38a85bf337755a1a165d0df2b335e3886058\
40e08a3cdf1ce1a4297ede598f6a011d027c1c300201000000010000000000000000000000\
000000000000000000000000000000000000000000ffffffff1202791f0e2f5032506f6f6c\
2d74444153482fffffffff044d75bb8b010000001976a914d4a5ea2641e9dd37f7a5ad5c92\
9df4743518769188acac2ea68f010000001976a9148d0934de58f969df3b53a72b4f47211d\
890ebf5588ac68b9ea03000000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b9\
80e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d\
7281bdc9430f35ac00000000000000002a6a28f47e935509fc85533dc78197e93e87d1c793\
43bda495429d8e3680069f6a22780000000002000000000000000100000001078e0c77e3b0\
4323d0834841f965543aaae2b275f684f55fbaf22e1c83bff97e010000006a473044022077\
6e96d202cc4f50f79d269d7cd36712c7486282dda0cb6eae583c916c98b34c022070941efb\
3201cf500cc6b879d6570fc477d4c3e6a8d91286e84465235f542c42012102dddbfc3fe06b\
96e3a36f3e815222cd1cb9586b3193c4a0de030477f621956d51feffffff02a00bd1000000\
00001976a914d7b47d4b40a23c389f5a17754d7f60f511c7d0ec88ac316168821300000019\
76a914c9190e507834b78a624d7578f1ad3819592ca1aa88ac771f0000 \
'{ "workid": "test" }'
Result (the block above was already on a local block chain):
duplicate
See also
- GetBlockTemplate: gets a block template or proposal for use with mining software.
ValidateAddress
The validateaddress
RPC returns information about the given Dash address.
Parameter #1—a P2PKH or P2SH address
Name | Type | Presence | Description |
---|---|---|---|
Address | string (base58) | Required (exactly 1) |
The P2PKH or P2SH address to validate encoded in base58check format |
Result—information about the address
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the address |
→isvalid |
bool | Required (exactly 1) |
Set to true if the address is a valid P2PKH or P2SH address; set to false otherwise |
→address |
string (base58) | Optional (0 or 1) |
The Dash address given as parameter |
→scriptPubKey |
string (hex) | Optional (0 or 1) |
The hex encoded scriptPubKey generated by the address |
→ismine |
bool | Optional (0 or 1) |
Set to true if the address belongs to the wallet; set to false if it does not. Only returned if wallet support enabled |
→iswatchonly |
bool | Optional (0 or 1) |
Set to true if the address is watch-only. Otherwise set to false . Only returned if address is in the wallet |
→isscript |
bool | Optional (0 or 1) |
Set to true if a P2SH address; otherwise set to false . Only returned if the address is in the wallet |
→script |
string | Optional (0 or 1) |
Only returned for P2SH addresses belonging to this wallet. This is the type of script: • 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 |
→hex |
string (hex) | Optional (0 or 1) |
Only returned for P2SH addresses belonging to this wallet. This is the redeem script encoded as hex |
→addresses |
array | Optional (0 or 1) |
Only returned for P2SH addresses belonging to the wallet. A P2PKH addresses used in this script, or the computed P2PKH addresses of any pubkeys in this script. This array will be empty for nonstandard script types |
→ → Address |
string | Optional (0 or more) |
A P2PKH address |
→sigsrequired |
number (int) | Optional (0 or 1) |
Only returned for multisig P2SH addresses belonging to the wallet. The number of signatures required by this script |
→pubkey |
string (hex) | Optional (0 or 1) |
The public key corresponding to this address. Only returned if the address is a P2PKH address in the wallet |
→iscompressed |
bool | Optional (0 or 1) |
Set to true if a compressed public key or set to false if an uncompressed public key. Only returned if the address is a P2PKH address in the wallet |
→account |
string | Optional (0 or 1) |
Deprecated: will be removed in a later version of Bitcoin Core The account this address belong to. May be an empty string for the default account. Only returned if the address belongs to the wallet |
→hdkeypath |
string | Optional (0 or 1) |
Added in Bitcoin Core 0.13.0 The HD keypath if the key is HD and available |
→hdmasterkeyid |
string (hash160) | Optional (0 or 1) |
Added in Bitcoin Core 0.13.0 The Hash160 of the HD master public key |
Example from Dash Core 0.12.2
Validate the following P2PKH address from the wallet:
dash-cli validateaddress yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb
Result:
{
"isvalid": true,
"address": "yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"scriptPubKey": "76a9141b767409bd8717b56cfcb00747811432ab1aa8a788ac",
"ismine": true,
"iswatchonly": false,
"isscript": false,
"pubkey": "02eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29",
"iscompressed": true,
"account": "Test"
}
Validate the following P2SH multisig address from the wallet:
dash-cli -testnet validateaddress 8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW
Result:
{
"isvalid": true,
"address": "8uJLxDxk2gEMbidF5vT8XLS2UCgQmVcroW",
"scriptPubKey": "a914a33155e490d146e656a9bac2cbee9c625ef42f0a87",
"ismine": true,
"iswatchonly": false,
"isscript": true,
"script": "multisig",
"hex": "522102eacba539d92eb88d4e73bb32749d79f53f6e8d7947ac40a71bd4b26c13b6ec29210311f97539724e0de38fb1ff79f5148e5202459d06ed07193ab18c730274fd0d882103251f25a5c0291446d801ba6df122f67a7dd06c60a9b332b7b29cc94f3b8f57d053ae",
"addresses": [
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"yWAk1cDVvsRdPYjnzcFkySJux75yaCE7xz",
"yVJj7TB3ZhMcSP2wo65ZFNqy23BQH9tT87"
],
"sigsrequired": 2,
"account": "test account"
}
See also
- 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.
- GetNewAddress: returns a new Dash address for receiving payments. If an account is specified, payments received with the address will be credited to that account.
VerifyChain
The verifychain
RPC verifies each entry in the local block chain database.
Parameter #1—how thoroughly to check each block
Name | Type | Presence | Description |
---|---|---|---|
Check Level | number (int) | Optional (0 or 1) |
How thoroughly to check each block, from 0 to 4. Default is the level set with the -checklevel command line argument; if that isn’t set, the default is 3 . Each higher level includes the tests from the lower levelsLevels are: 0. Read from disk to ensure the files are accessible 1. Ensure each block is valid 2. Make sure undo files can be read from disk and are in a valid format 3. Test each block undo to ensure it results in correct state 4. After undoing blocks, reconnect them to ensure they reconnect correctly |
Parameter #2—the number of blocks to check
Name | Type | Presence | Description |
---|---|---|---|
Number Of Blocks | number (int) | Optional (0 or 1) |
The number of blocks to verify. Set to 0 to check all blocks. Defaults to the value of the -checkblocks command-line argument; if that isn’t set, the default is 288 |
Result—verification results
Name | Type | Presence | Description |
---|---|---|---|
result |
bool | Required (exactly 1) |
Set to true if verified; set to false if verification failed for any reason |
Example from Dash Core 0.12.2
Verify the most recent 400 blocks in the most through way:
dash-cli -testnet verifychain 4 400
Result (took < 1 second on a mobile workstation; it would’ve taken much longer on mainnet):
true
See also
- GetBlockChainInfo: provides information about the current state of the block chain.
- 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.
VerifyMessage
The verifymessage
RPC verifies a signed message.
Parameter #1—the address corresponding to the signing key
Name | Type | Presence | Description |
---|---|---|---|
Address | string (base58) | Required (exactly 1) |
The P2PKH address corresponding to the private key which made the signature. A P2PKH address is a hash of the public key corresponding to the private key which made the signature. When the ECDSA signature is checked, up to four possible ECDSA public keys will be reconstructed from from the signature; each key will be hashed and compared against the P2PKH address provided to see if any of them match. If there are no matches, signature validation will fail |
Parameter #2—the signature
Name | Type | Presence | Description |
---|---|---|---|
Signature | string (base64) | Required (exactly 1) |
The signature created by the signer encoded as base-64 (the format output by the signmessage RPC) |
Parameter #3—the message
Name | Type | Presence | Description |
---|---|---|---|
Message | string | Required (exactly 1) |
The message exactly as it was signed (e.g. no extra whitespace) |
Result: true
, false
, or an error
Name | Type | Presence | Description |
---|---|---|---|
result |
bool/null | Required (exactly 1) |
Set to true if the message was signed by a key corresponding to the provided P2PKH address; set to false if it was not signed by that key; set to JSON null if an error occurred |
Example from Dash Core 0.12.2
Check the signature on the message created in the example for
signmessage
:
dash-cli -testnet verifymessage \
yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb \
H4XULzfHCf16In2ECk9Ta9QxQPq639zQto2JA3OLlo3JbUdrClvJ89+A1z+Z9POd6l8LJhn1jGpQYF8mX4jkQvE= \
'Hello, World!'
Result:
true
See also
- SignMessage: signs a message with the private key of an address.
VerifyTxOutProof
The verifytxoutproof
RPC verifies that a proof points to one or more transactions in a block, returning the transactions the proof commits to and throwing an RPC error if the block is not in our best block chain.
Parameter #1—The hex-encoded proof generated by gettxoutproof
Name | Type | Presence | Description |
---|---|---|---|
proof |
string | Required | A hex-encoded proof |
Result—txid(s) which the proof commits to
Name | Type | Presence | Description |
---|---|---|---|
result |
string | Required (exactly 1) |
The txid(s) which the proof commits to, or empty array if the proof is invalid |
Example from Dash Core 0.12.2
Verify a proof:
dash-cli verifytxoutproof \
01000020ed72cc6a7294782a7711d8fa7ef74716ef062dc50bb0820f7eec923801000000\
aa5d17c5128043803b67c7ab03e4d3ffbc9604b54f877f1c5cf9ed3adeaa19b2cd7ed659\
f838011d10a70a480200000002033c89c2baecba9fc983c85dcf365c2d9cc93aca1dee2e\
5ac18124464056542e8faab0c579e651e9438c2904df5a498bc37a37acd528a251386fde\
f0476ba0e00105
Result:
[
"e0a06b47f0de6f3851a228d5ac377ac38b495adf04298c43e951e679c5b0aa8f"
]
See also
- GetTxOutProof: returns a hex-encoded proof that one or more specified transactions were included in a block.
merkleblock
message: A description of the format used for the proof.
VoteRaw
The voteraw
RPC compiles and relays a governance vote with provided external signature instead of signing vote internally
Parameter #1—masternode transaction hash
Name | Type | Presence | Description |
---|---|---|---|
masternode-tx-hash |
string (hex) | Required (exactly 1) |
Hash of the masternode collateral transaction |
Parameter #2—vote signal
Name | Type | Presence | Description |
---|---|---|---|
masternode-tx-index |
string | Required (exactly 1) |
Index of the masternode collateral transaction |
Parameter #3—governance hash
Name | Type | Presence | Description |
---|---|---|---|
governance-hash |
string (hex) | Required (exactly 1) |
Hash of the governance object |
Parameter #4—vote signal
Name | Type | Presence | Description |
---|---|---|---|
signal |
string | Required (exactly 1) |
Vote signal: funding , valid , or delete |
Parameter #5—vote outcome
Name | Type | Presence | Description |
---|---|---|---|
outcome |
string | Required (exactly 1) |
Vote outcome: yes , no , or abstain |
Parameter #6—time
Name | Type | Presence | Description |
---|---|---|---|
time |
int64_t | Required (exactly 1) |
Create time |
Parameter #7—vote signature
Name | Type | Presence | Description |
---|---|---|---|
vote-sig |
string (base64) | Required (exactly 1) |
The vote signature created by external application (i.e. Dash Masternode Tool or dashmnb). Must match the Dash Core (governance vote signature format). |
Result—votes for specified governance
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
The vote result |
Example from Dash Core 0.12.2
dash-cli -testnet voteraw \
f6c83fd96bfaa47887c4587cceadeb9af6238a2c86fe36b883c4d7a6867eab0f 1 \
65a358fefaace40fc07053350be23e519178519290f963dab8ba92f6f85f98c3 \
funding yes 1512507255 \
H1jXKZQp1TZWBPW11E665OwmGBYV1038FohEr0au7zp+O5BCKmVDP/3rGq38ZMy3KOpwnBu6ehd6jlas79hsRBY=
Result:
Voted successfully
See also:
- GObject: provides a set of commands for managing governance objects and displaying information about them.
WalletLock
Requires wallet support. Requires an unlocked wallet.
The walletlock
RPC removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase
again before being able to call any methods which require the wallet to be unlocked.
Parameters: none
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always set to JSON null |
Example from Dash Core 0.12.2
dash-cli -testnet walletlock
(Success: nothing printed.)
See also
- EncryptWallet: encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.
- WalletPassphrase: stores the wallet decryption key in memory for the indicated number of seconds. Issuing the
walletpassphrase
command while the wallet is already unlocked will set a new unlock time that overrides the old one. - WalletPassphraseChange: changes the wallet passphrase from ‘old passphrase’ to ‘new passphrase’.
WalletPassphrase
Requires wallet support. Requires an encrypted wallet.
The walletpassphrase
RPC stores the wallet decryption key in memory for the indicated number of seconds. Issuing the walletpassphrase
command while the wallet is already unlocked will set a new unlock time that overrides the old one.
Warning: if using this RPC on the command line, remember
that your shell probably saves your command lines (including the
value of the passphrase parameter).
Parameter #1—the passphrase
Name | Type | Presence | Description |
---|---|---|---|
Passphrase | string | Required (exactly 1) |
The passphrase that unlocks the wallet |
Parameter #2—the number of seconds to leave the wallet unlocked
Name | Type | Presence | Description |
---|---|---|---|
Seconds | number (int) | Required (exactly 1) |
The number of seconds after which the decryption key will be automatically deleted from memory |
Parameter #3—unlock for PrivateSend mixing only
Name | Type | Presence | Description |
---|---|---|---|
Mixing Only | bool | Optional (0 or 1) |
If true , the wallet will be locked for sending functions but unlocked for mixing transactions (default: false) |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always set to JSON null |
Example from Dash Core 0.12.2
Unlock the wallet for 10 minutes (the passphrase is “test”):
dash-cli -testnet walletpassphrase test 600
(Success: no result printed.)
Unlock the wallet for mixing transactions only for 10 minutes (the passphrase is “test”):
dash-cli -testnet walletpassphrase test 600 true
(Success: no result printed.)
See also
- EncryptWallet: encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.
- WalletPassphraseChange: changes the wallet passphrase from ‘old passphrase’ to ‘new passphrase’.
- WalletLock: removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call
walletpassphrase
again before being able to call any methods which require the wallet to be unlocked.
WalletPassphraseChange
Requires wallet support. Requires an encrypted wallet.
The walletpassphrasechange
RPC changes the wallet passphrase from ‘old passphrase’ to ‘new passphrase’.
Warning: if using this RPC on the command line, remember
that your shell probably saves your command lines (including the
value of the passphrase parameter).
Parameter #1—the current passphrase
Name | Type | Presence | Description |
---|---|---|---|
Current Passphrase | string | Required (exactly 1) |
The current wallet passphrase |
Parameter #2—the new passphrase
Name | Type | Presence | Description |
---|---|---|---|
New Passphrase | string | Required (exactly 1) |
The new passphrase for the wallet |
Result—null
on success
Name | Type | Presence | Description |
---|---|---|---|
result |
null | Required (exactly 1) |
Always set to JSON null |
Example from Dash Core 0.12.2
Change the wallet passphrase from “test” to “example”:
dash-cli -testnet walletpassphrasechange "test" "example"
(Success: no result printed.)
See also
- EncryptWallet: encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.
- WalletPassphrase: stores the wallet decryption key in memory for the indicated number of seconds. Issuing the
walletpassphrase
command while the wallet is already unlocked will set a new unlock time that overrides the old one. - WalletLock: removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call
walletpassphrase
again before being able to call any methods which require the wallet to be unlocked.
HTTP REST
Dash Core provides an unauthenticated HTTP REST interface. The interface
runs on the same port as the JSON-RPC interface, by default port 9998 for
mainnet and port 19998 for testnet. It must be enabled by either starting Dash
Core with the -rest
option or by specifying rest=1
in the
configuration file. Make sure that the RPC interface is also activated.
Set server=1
in dash.conf
or supply the -server
argument when
starting Dash Core. Starting Dash Core with dashd
automatically
enables the RPC interface.
The interface is not intended for public access and is only accessible from localhost by default.
Warning: A web browser can access a HTTP REST interface running on
localhost, possibly allowing third parties to use cross-site scripting
attacks to download your transaction and block data, reducing your
privacy. If you have privacy concerns, you should not run a browser on
the same computer as a REST-enabled Dash Core node.
The interface uses standard HTTP status codes and returns a plain-text description of errors for debugging.
Quick Reference
- GET Block gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. Updated in Bitcoin Core 0.13.0
- GET Block/NoTxDetails gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns. Updated in Bitcoin Core 0.13.0
- GET ChainInfo returns information about the current state of the block chain. New in Bitcoin Core 0.11.0, Updated in Bitcoin Core 0.12.0
- GET GetUtxos returns an UTXO set given a set of outpoints. New in Bitcoin Core 0.11.0
- GET Headers returns a specified amount of block headers in upward direction. New in Bitcoin Core 0.11.0, Updated in Bitcoin Core 0.13.0
- GET MemPool/Contents returns all transaction in the memory pool with detailed information. New in Bitcoin Core 0.12.0
- GET MemPool/Info returns information about the node’s current transaction memory pool. New in Bitcoin Core 0.12.0
- GET Tx 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 this method may fail on historic transactions unless you use the non-default
txindex=1
in your Dash Core startup settings. Updated in Bitcoin Core 0.13.0
Requests
Warning: the block chain and memory pool can include arbitrary data
which several of the commands below will return in hex format. If you
convert this data to another format in an executable context, it could
be used in an exploit. For example, displaying a pubkey script as
ASCII text in a webpage could add arbitrary Javascript to that page and
create a cross-site scripting (XSS) exploit. To avoid problems, please
treat block chain and memory pool data as an arbitrary input from an
untrusted source.
GET Block
The GET block
operation gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
Request
GET /block/<hash>.<format>
Parameter #1—the header hash of the block to retrieve
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | path (hex) | Required (exactly 1) |
The hash of the header of the block to get, encoded as hex in RPC byte order |
Parameter #2—the output format
Name | Type | Presence | Description |
---|---|---|---|
Format | suffix | Required (exactly 1) |
Set to .json for decoded block contents in JSON, or .bin or hex for a serialized block in binary or hex |
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
An object containing the requested block |
→hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1 |
→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→size |
number (int) | Required (exactly 1) |
The size of this block in serialized block format, counted in bytes |
→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→tx |
array | Required (exactly 1) |
An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block |
→ → Transaction |
object | Required (1 or more) |
An object describing a particular transaction within this block |
→ → →txid |
string (hex) | Required (exactly 1) |
The transaction’s TXID encoded as hex in RPC byte order |
→ → →size |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The serialized transaction size |
→ → →version |
number (int) | Required (exactly 1) |
The transaction format version number |
→ → →locktime |
number (int) | Required (exactly 1) |
The transaction’s locktime: either a Unix epoch date or block height; see the Locktime parsing rules |
→ → →vin |
array | Required (exactly 1) |
An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0 |
→ → → → Input |
object | Required (1 or more) |
An object describing one of this transaction’s inputs. May be a regular input or a coinbase |
→ → → → →txid |
string | Optional (0 or 1) |
The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction |
→ → → → →vout |
number (int) | Optional (0 or 1) |
The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0 . Not present if this is a coinbase transaction |
→ → → → →scriptSig |
object | Optional (0 or 1) |
An object describing the signature script of this input. Not present if this is a coinbase transaction |
→ → → → → →asm |
string | Required (exactly 1) |
The signature script in decoded form with non-data-pushing opcodes listed |
→ → → → → →hex |
string (hex) | Required (exactly 1) |
The signature script encoded as hex |
→ → → → →coinbase |
string (hex) | Optional (0 or 1) |
The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction |
→ → → → →value |
number (Dash) | Optional (exactly 1) |
The number of Dash paid to this output. May be 0 .Only present if spentindex enabled |
→ → → → →valueSat |
number (duffs) | Optional (exactly 1) |
The number of duffs paid to this output. May be 0 .Only present if spentindex enabled |
→ → → → → →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.Only present if spentindex enabled |
→ → → → → → → Address |
string | Required (1 or more) |
A P2PKH or P2SH address |
→ → → → →sequence |
number (int) | Required (exactly 1) |
The input sequence number |
→ → →vout |
array | Required (exactly 1) |
An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0 |
→ → → → Output |
object | Required (1 or more) |
An object describing one of this transaction’s outputs |
→ → → → →value |
number (Dash) | Required (exactly 1) |
The number of Dash paid to this output. May be 0 |
→ → → → →valueSat |
number (duffs) | Required (exactly 1) |
The number of duffs paid to this output. May be 0 |
→ → → → →n |
number (int) | Required (exactly 1) |
The output index number of this output within this 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) |
→ → → → → →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 | Required (1 or more) |
A P2PKH or P2SH address |
→time |
number (int) | Required (exactly 1) |
The value of the time field in the block header, indicating approximately when the block was created |
→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113 |
→nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→previousblockhash |
string (hex) | Required (exactly 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order |
→nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Examples from Dash Core 0.12.2
Request a block in hex-encoded serialized block format:
curl http://localhost:19998/rest/block/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
Result (wrapped):
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed701010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff13037a94000e\
2f5032506f6f6c2d74444153482fffffffff06a1f9ef04000000001976a91414\
e3832cd7192ffb358a31d842636c4db8dfb1ac88ac6c357f3c000000001976a9\
149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac31f49e010000000019\
76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac40230e43000000\
001976a914c4541983721b26ada79770bf22de4885e19f566188ac0200000000\
0000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9\
440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d72\
81bdc9430f35ac00000000000000002a6a28c855abe6461b1003ea36feb88a3b\
d50c5696e5784d11f8cd5e892978685de1d6000000000100000000000000
Get the same block in JSON:
curl http://localhost:19998/rest/block/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
Result (whitespace added):
{
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":20,
"size":414,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"tx":[
{
"txid":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"size":333,
"version":1,
"locktime":0,
"vin":[
{
"coinbase":"037a94000e2f5032506f6f6c2d74444153482f",
"sequence":4294967295
}
],
"vout":[
{
"value":0.82835873,
"valueSat":82835873,
"n":0,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 14e3832cd7192ffb358a31d842636c4db8dfb1ac OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a91414e3832cd7192ffb358a31d842636c4db8dfb1ac88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yNDtusuhm6otr3eeGh3SqdpNczV4aZSx1b"
]
}
},
{
"value":10.14969708,
"valueSat":1014969708,
"n":1,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 9262f2289e1f021dca954d8cf07a7ad72c2cc24d OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a9149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yZfU36R8dhdnFaK3AwfnubrLXAG2G1WiVn"
]
}
},
{
"value":0.27194417,
"valueSat":27194417,
"n":2,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 d93f7ffa324b77d361e89a3c9c8df46ccdb4b392 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yg89Yt5Tjzs9nRpX3wJCuvr7KuQvgkvmeC"
]
}
},
{
"value":11.25000000,
"valueSat":1125000000,
"n":3,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 c4541983721b26ada79770bf22de4885e19f5661 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914c4541983721b26ada79770bf22de4885e19f566188ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yeDY39aiqbBHbJft5F6rokR23EaZca6UTU"
]
}
},
{
"value":0.00000002,
"valueSat":2,
"n":4,
"scriptPubKey":{
"asm":"047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d7281bdc9430f35 OP_CHECKSIG",
"hex":"41047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d7281bdc9430f35ac",
"reqSigs":1,
"type":"pubkey",
"addresses":[
"yb21342iADyqAotjwcn4imqjvAcdYhnzeH"
]
}
},
{
"value":0.00000000,
"valueSat":0,
"n":5,
"scriptPubKey":{
"asm":"OP_RETURN c855abe6461b1003ea36feb88a3bd50c5696e5784d11f8cd5e892978685de1d60000000001000000",
"hex":"6a28c855abe6461b1003ea36feb88a3bd50c5696e5784d11f8cd5e892978685de1d60000000001000000",
"type":"nulldata"
}
}
]
}
],
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
}
See also
- GET Block/NoTxDetails gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.
- GetBestBlockHash RPC: returns the header hash of the most recent block on the best block chain.
- GetBlock RPC: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.
GET Block/NoTxDetails
The GET block/notxdetails
operation gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.
Request
GET /block/notxdetails/<hash>.<format>
Parameter #1—the header hash of the block to retrieve
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | path (hex) | Required (exactly 1) |
The hash of the header of the block to get, encoded as hex in RPC byte order |
Parameter #2—the output format
Name | Type | Presence | Description |
---|---|---|---|
Format | suffix | Required (exactly 1) |
Set to .json for decoded block contents in JSON, or .bin or hex for a serialized block in binary or hex |
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
An object containing the requested block |
→hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #1 |
→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→size |
number (int) | Required (exactly 1) |
The size of this block in serialized block format, counted in bytes |
→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→tx |
array | Required (exactly 1) |
An array containing all transactions in this block. The transactions appear in the array in the same order they appear in the serialized block |
→ → TXID |
string (hex) | Required (1 or more) |
The TXID of a transaction in this block, encoded as hex in RPC byte order |
→time |
number (int) | Required (exactly 1) |
The value of the time field in the block header, indicating approximately when the block was created |
→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113 |
→nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→previousblockhash |
string (hex) | Required (exactly 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order |
→nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Examples from Dash Core 0.12.2
Request a block in hex-encoded serialized block format:
curl http://localhost:19998/rest/block/notxdetails/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
Result (wrapped):
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed701010000000100000000000000000000\
00000000000000000000000000000000000000000000ffffffff13037a94000e\
2f5032506f6f6c2d74444153482fffffffff06a1f9ef04000000001976a91414\
e3832cd7192ffb358a31d842636c4db8dfb1ac88ac6c357f3c000000001976a9\
149262f2289e1f021dca954d8cf07a7ad72c2cc24d88ac31f49e010000000019\
76a914d93f7ffa324b77d361e89a3c9c8df46ccdb4b39288ac40230e43000000\
001976a914c4541983721b26ada79770bf22de4885e19f566188ac0200000000\
0000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b980e00d467aa9\
440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d72\
81bdc9430f35ac00000000000000002a6a28c855abe6461b1003ea36feb88a3b\
d50c5696e5784d11f8cd5e892978685de1d6000000000100000000000000
Get the same block in JSON:
curl http://localhost:19998/rest/block/notxdetails/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
Result (whitespace added):
{
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":55,
"size":414,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"tx":[
"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884"
],
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
}
See also
- GET Block: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlock RPC: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.
- GetBestBlockHash RPC: returns the header hash of the most recent block on the best block chain.
GET ChainInfo
The GET chaininfo
operation returns information about the current state of the block chain. Supports only json
as output format.
Request
GET /chaininfo.json
Parameters: none
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
Information about the current state of the local block chain |
→chain |
string | Required (exactly 1) |
The name of the block chain. One of main for mainnet, test for testnet, or regtest for regtest |
→blocks |
number (int) | Required (exactly 1) |
The number of validated blocks in the local best block chain. For a new node with just the hardcoded genesis block, this will be 0 |
→headers |
number (int) | Required (exactly 1) |
The number of validated headers in the local best headers chain. For a new node with just the hardcoded genesis block, this will be zero. This number may be higher than the number of blocks |
→bestblockhash |
string (hex) | Required (exactly 1) |
The hash of the header of the highest validated block in the best block chain, encoded as hex in RPC byte order. This is identical to the string returned by the getbestblockhash RPC |
→difficulty |
number (real) | Required (exactly 1) |
The difficulty of the highest-height block in the best block chain |
→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113 |
→verificationprogress |
number (real) | Required (exactly 1) | Estimate of what percentage of the block chain transactions have been verified so far, starting at 0.0 and increasing to 1.0 for fully verified. May slightly exceed 1.0 when fully synced to account for transactions in the memory pool which have been verified before being included in a block |
→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes checked from the genesis block to this block, encoded as big-endian hex |
→pruned |
bool | Required (exactly 1) |
Indicates if the blocks are subject to pruning |
→pruneheight |
number (int) | Optional (0 or 1) |
The lowest-height complete block stored if pruning is activated |
→softforks |
array | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 An array of objects each describing a current or previous soft fork |
→ → Softfork |
object | Required (3 or more) |
A specific softfork |
→ → →id |
string | Required (exactly 1) |
The name of the softfork |
→ → →version |
numeric (int) |
Required (exactly 1) |
The block version used for the softfork |
→ → →enforce |
string : object | Optional (0 or 1) |
The progress toward enforcing the softfork rules for new-version blocks |
→ → → →status |
bool | Required (exactly 1) |
Indicates if the threshold was reached |
→ → → →found |
numeric (int) |
Optional (0 or 1) |
Number of blocks that support the softfork |
→ → → →required |
numeric (int) |
Optional (0 or 1) |
Number of blocks that are required to reach the threshold |
→ → → →window |
numeric (int) |
Optional (0 or 1) |
The maximum size of examined window of recent blocks |
→ → →reject |
object | Optional (0 or 1) |
The progress toward enforcing the softfork rules for new-version blocks |
→ → → →status |
bool | Optional (0 or 1) |
Indicates if the threshold was reached |
→ → → →found |
numeric (int) |
Optional (0 or 1) |
Number of blocks that support the softfork |
→ → → →required |
numeric (int) |
Optional (0 or 1) |
Number of blocks that are required to reach the threshold |
→ → → →window |
numeric (int) |
Optional (0 or 1) |
The maximum size of examined window of recent blocks |
→bip9_softforks |
object | Required (exactly 1) |
Added in Bitcoin Core 0.12.1 The status of BIP9 softforks in progress |
→ → Name |
string : object | Required (1 or more) |
A specific BIP9 softfork |
→ → →status |
string | Required (exactly 1) |
Set to one of the following reasons: • defined if voting hasn’t started yet• started if the voting has started • locked_in if the voting was successful but the softfort hasn’t been activated yet• active if the softfork was activated• failed if the softfork has not receieved enough votes |
Examples from Dash Core 0.12.2
Get blockchain info in JSON:
curl http://localhost:19998/rest/chaininfo.json
Result (whitespace added):
{
"chain":"test",
"blocks":38066,
"headers":38066,
"bestblockhash":"0000000006c6f812d4721c09b3a3ce6547d2291ff822ee39597515f75822ed3e",
"difficulty":18.8278810867833,
"mediantime":1512591324,
"verificationprogress":0.9999996159024219,
"chainwork":"00000000000000000000000000000000000000000000000000093549c2729cb1",
"pruned":false,
"softforks":[
{
"id":"bip34",
"version":2,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status":true,
"found":100,
"required":75,
"window":100
}
},
{
"id":"bip66",
"version":3,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status":true,
"found":100,
"required":75,
"window":100
}
},
{
"id":"bip65",
"version":4,
"enforce":{
"status":true,
"found":100,
"required":51,
"window":100
},
"reject":{
"status":true,
"found":100,
"required":75,
"window":100
}
}
],
"bip9_softforks":[
{
"id":"csv",
"status":"active"
},
{
"id":"dip0001",
"status":"active"
}
]
}
See also
- GetBlockChainInfo RPC: provides information about the current state of the block chain.
GET GetUtxos
The GET getutxos
operation returns an UTXO set given a set of outpoints.
Request
GET /getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>
Parameter #1—Include memory pool transactions
Name | Type | Presence | Description |
---|---|---|---|
Check mempool | string | Optional (0 or 1) |
Set to checkmempool to include transactions that are currently in the memory pool to the calculation |
Parameter #2—List of Outpoints
Name | Type | Presence | Description |
---|---|---|---|
Outpoint | vector | Required (1 or more) |
The list of outpoints to be queried. Each outpoint is the TXID of the transaction, encoded as hex in RPC byte order with an additional -n parameter for the output index (vout) number, with the index starting from 0 |
Parameter #3—the output format
Name | Type | Presence | Description |
---|---|---|---|
Format | suffix | Required (exactly 1) |
Set to .json for decoded block contents in JSON, or .bin or hex for a serialized block in binary or hex |
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
The requested UTXO set |
→→chainHeight |
number (int) | Required (exactly 1) |
The height of the chain at the moment the result was calculated |
→chaintipHash |
number (int) | Required (exactly 1) |
The block hash of the top of the chain at the moment the result was calculated |
→bitmap |
number (int) | Required (exactly 1) |
Whether each requested output was found in the UTXO set or not. A 1 is returned for those that were found and a 0 is returned for those that were not found. Results are returned in the same order as outpoints were requested in the input parameters |
→utxos |
array | Required (exactly 1) |
An array of objects each describing an outpoint that is unspent |
→→Unspent Outpoint |
object | Optional (0 or more) |
A UTXO match based on the query |
→→→txvers |
number (int) | Required (exactly 1) |
The version number of the transaction the UTXO was found in |
→height |
number (int) | Required (exactly 1) | The height of the block containing the defining transaction, or 0x7FFFFFFF if the tx is in the mempool |
→ → →value |
number (int) | Required (exactly 1) |
The value of the 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) |
→ → → →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) |
Array of 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 |
Examples from Dash Core 0.12.2
Request the UTXO set:
curl http://localhost:19998/rest/getutxos/checkmempool/7b6caf68c33794b0bda65e63691739919f13156b57c7ec20a0b4de1f33c580bd-0.hex
Result (wrapped):
c39400005ac8db505390f3c77635132117a7fdf07b2eb45c3d9fe38535b77b05\
0000000001010101000000c394000050ae3b16000000001976a9146f4def95a3\
15e83bef5e1197ace4aa7ec55f2ecc88ac
Same request in JSON:
curl http://localhost:19998/rest/getutxos/checkmempool/7b6caf68c33794b0bda65e63691739919f13156b57c7ec20a0b4de1f33c580bd-0.json
Result (whitespace added):
{
"chainHeight":38083,
"chaintipHash":"00000000057bb73585e39f3d5cb42e7bf0fda71721133576c7f3905350dbc85a",
"bitmap":"1",
"utxos":[
{
"txvers":1,
"height":38083,
"value":3.73010000,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 6f4def95a315e83bef5e1197ace4aa7ec55f2ecc OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a9146f4def95a315e83bef5e1197ace4aa7ec55f2ecc88ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"yWTyDaMb1KZSRYwrq2DDW3Q4rKYuuPutDS"
]
}
}
]
}
See also
- GetTxOutSetInfo RPC: 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.
GET Headers
The GET headers
operation returns a specified amount of block headers in upward direction.
Request
GET /headers/<count>/<hash>.<format>
Parameter #1—the amount of block headers to retrieve
Name | Type | Presence | Description |
---|---|---|---|
Amount | number (int) | Required (exactly 1) |
The amount of block headers in upward direction to return (including the start header hash) |
Parameter #2—the header hash of the block to retrieve
Name | Type | Presence | Description |
---|---|---|---|
Header Hash | path (hex) | Required (exactly 1) |
The hash of the header of the block to get, encoded as hex in RPC byte order |
Parameter #3—the output format
Name | Type | Presence | Description |
---|---|---|---|
Format | suffix | Required (exactly 1) |
Set to .json for decoded block contents in JSON, or .bin or hex for a serialized block in binary or hex |
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | array | Required (exactly 1) |
An array containing the requested block headers |
→ Block Header |
object | Required (1 or more) |
An object containing a block header. The amount of the objects is the same as the amount provided in parameter #1 |
→→hash |
string (hex) | Required (exactly 1) |
The hash of this block’s block header encoded as hex in RPC byte order. This is the same as the hash provided in parameter #2 |
→→confirmations |
number (int) | Required (exactly 1) |
The number of confirmations the transactions in this block have, starting at 1 when this block is at the tip of the best block chain. This score will be -1 if the the block is not part of the best block chain |
→→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→→version |
number (int) | Required (exactly 1) |
This block’s version number. See block version numbers |
→→merkleroot |
string (hex) | Required (exactly 1) |
The merkle root for this block, encoded as hex in RPC byte order |
→→time |
number (int) | Required (exactly 1) |
The value of the time field in the block header, indicating approximately when the block was created |
→→mediantime |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The median time of the 11 blocks before the most recent block on the blockchain. Used for validating transaction locktime under BIP113 |
→→nonce |
number (int) | Required (exactly 1) |
The nonce which was successful at turning this particular block into one that could be added to the best block chain |
→→bits |
string (hex) | Required (exactly 1) |
The value of the nBits field in the block header, indicating the target threshold this block’s header had to pass |
→→difficulty |
number (real) | Required (exactly 1) |
The estimated amount of work done to find this block relative to the estimated amount of work done to find block 0 |
→→chainwork |
string (hex) | Required (exactly 1) |
The estimated number of block header hashes miners had to check from the genesis block to this block, encoded as big-endian hex |
→→previousblockhash |
string (hex) | Required (exactly 1) |
The hash of the header of the previous block, encoded as hex in RPC byte order |
→→nextblockhash |
string (hex) | Optional (0 or 1) |
The hash of the next block on the best block chain, if known, encoded as hex in RPC byte order |
Examples from Dash Core 0.12.2
Request 2 block headers in hex-encoded serialized block format:
curl http://localhost:19998/rest/headers/2/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.hex
Result (wrapped):
0000002097e8135d73afa52145f6d0b4d0f957030cd598837ddc6750271fb109\
000000008478305a7abf2f7cb21a889fb68d53c3e51685349e18e1b104b5956c\
100bfea2c72d285a84030a1cd0041ed70000002051b45fe788d100ff8be0bc39\
e88b59829f01c17a82786bcf46bfcc000000000004dc24bddd15f790efcd7af3\
8d03f805cc1c74516888ccec8874db2ac8beb043092e285a999f091c5d6ec419
Get the same block headers in JSON:
curl http://localhost:19998/rest/headers/2/0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451.json
Result (whitespace added):
[
{
"hash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"confirmations":80,
"height":38010,
"version":536870912,
"merkleroot":"a2fe0b106c95b504b1e1189e348516e5c3538db69f881ab27c2fbf7a5a307884",
"time":1512582599,
"mediantime":1512582025,
"nonce":3609068752,
"bits":"1c0a0384",
"difficulty":25.56450187425715,
"chainwork":"00000000000000000000000000000000000000000000000000092fc476457b68",
"previousblockhash":"0000000009b11f275067dc7d8398d50c0357f9d0b4d0f64521a5af735d13e897",
"nextblockhash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51"
},
{
"hash":"0000000000a9baff28a79db2a50e13af8f313138f4568339f58d73eda14a4d51",
"confirmations":79,
"height":38011,
"version":536870912,
"merkleroot":"43b0bec82adb7488eccc886851741ccc05f8038df37acdef90f715ddbd24dc04",
"time":1512582665,
"mediantime":1512582146,
"nonce":432303709,
"bits":"1c099f99",
"difficulty":26.60134045579303,
"chainwork":"00000000000000000000000000000000000000000000000000092fdf1051882b",
"previousblockhash":"0000000000ccbf46cf6b78827ac1019f82598be839bce08bff00d188e75fb451",
"nextblockhash":"0000000008de9da638149042323fc05ded619a922ff1fac6e66f66fc773bd716"
}
]
See also
- GET Block/NoTxDetails gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block. The JSON object includes TXIDs for transactions within the block rather than the complete transactions GET block returns.
- GetBlock RPC: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.
- GetBlockHash RPC: returns the header hash of a block at the given height in the local best block chain.
- GetBlockHeader RPC: gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header.
GET MemPool/Contents
The GET mempool/contents
operation returns all transaction in the memory pool with detailed information. Supports only json
as output format.
Request
GET /mempool/contents.json
Parameters: none
Result as JSON
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A object containing transactions currently in the memory pool. May be empty |
→ TXID |
string : object | Optional (0 or more) |
The TXID of a transaction in the memory pool, encoded as hex in RPC byte order |
→ →size |
number (int) | Required (exactly 1) |
The size of the serialized transaction in bytes |
→ →fee |
number (bitcoins) | Required (exactly 1) |
The transaction fee paid by the transaction in decimal bitcoins |
→ →modifiedfee |
number (bitcoins) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The transaction fee with fee deltas used for mining priority in decimal bitcoins |
→ →time |
number (int) | Required (exactly 1) |
The time the transaction entered the memory pool, Unix epoch time format |
→ →height |
number (int) | Required (exactly 1) |
The block height when the transaction entered the memory pool |
→ →startingpriority |
number (int) | Required (exactly 1) |
The priority of the transaction when it first entered the memory pool |
→ →currentpriority |
number (int) | Required (exactly 1) |
The current priority of the transaction |
→ →descendantcount |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The number of in-mempool descendant transactions (including this one) |
→ →descendantsize |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The size of in-mempool descendants (including this one) |
→ →descendantfees |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The modified fees (see modifiedfee above) of in-mempool descendants (including this one) |
→ →depends |
array | Required (exactly 1) |
An array holding TXIDs of unconfirmed transactions this transaction depends upon (parent transactions). Those transactions must be part of a block before this transaction can be added to a block, although all transactions may be included in the same block. The array may be empty |
→ → → Depends TXID |
string | Optional (0 or more) | The TXIDs of any unconfirmed transactions this transaction depends upon, encoded as hex in RPC byte order |
Examples from Dash Core 0.12.2
Get all transactions in the memory pool in JSON:
curl http://localhost:19998/rest/mempool/contents.json
Result (whitespace added):
{
"b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32":{
"size":225,
"fee":0.00010000,
"modifiedfee":0.00010000,
"time":1512596309,
"height":38094,
"startingpriority":1934576927.410256,
"currentpriority":1934576927.410256,
"descendantcount":1,
"descendantsize":225,
"descendantfees":10000,
"depends":[
]
}
}
See also
- GET MemPool/Info: returns information about the node’s current transaction memory pool.
- GetMemPoolInfo RPC: returns information about the node’s current transaction memory pool.
- GetRawMemPool RPC: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.
GET MemPool/Info
The GET mempool/info
operation returns information about the node’s current transaction memory pool. Supports only json
as output format.
Request
GET /mempool/info.json
Parameters: none
Result as JSON
Name | Type | Presence | Description |
---|---|---|---|
result |
object | Required (exactly 1) |
A object containing information about the memory pool |
→size |
number (int) | Required (exactly 1) |
The number of transactions currently in the memory pool |
→bytes |
number (int) | Required (exactly 1) |
The total number of bytes in the transactions in the memory pool |
→usage |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.11.0 Total memory usage for the mempool in bytes |
→maxmempool |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 Maximum memory usage for the mempool in bytes |
→mempoolminfee |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The lowest fee per kilobyte paid by any transaction in the memory pool |
Examples from Dash Core 0.12.2
Get memory pool info in JSON:
curl http://localhost:19998/rest/mempool/info.json
Result (whitespace added):
{
"size":1,
"bytes":1256,
"usage":3376,
"maxmempool":300000000,
"mempoolminfee":0.00000000
}
See also
- GET MemPool/Contents: returns all transaction in the memory pool with detailed information.
- GetMemPoolInfo RPC: returns information about the node’s current transaction memory pool.
GET Tx
The GET tx
operation 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 this method may fail on historic transactions unless you use the non-default txindex=1
in your Dash Core startup settings.
Note: if you begin using txindex=1
after downloading the block chain, you must rebuild your indexes by starting Bitcoin Core with the option -reindex
. This may take several hours to complete, during which time your node will not process new blocks or transactions. This reindex only needs to be done once.
Request
GET /tx/<txid>.<format>
Parameter #1—the TXID of the transaction to retrieve
Name | Type | Presence | Description |
---|---|---|---|
TXID | path (hex) | Required (exactly 1) |
The TXID of the transaction to get, encoded as hex in RPC byte order |
Parameter #2—the output format
Name | Type | Presence | Description |
---|---|---|---|
Format | suffix | Required (exactly 1) |
Set to .json for decoded transaction contents in JSON, or .bin or hex for a serialized transaction in binary or hex |
Response as JSON
Name | Type | Presence | Description |
---|---|---|---|
Result | object | Required (exactly 1) |
An object describing the request transaction |
→txid |
string (hex) | Required (exactly 1) |
The transaction’s TXID encoded as hex in RPC byte order |
→size |
number (int) | Required (exactly 1) |
Added in Bitcoin Core 0.12.0 The serialized transaction size |
→version |
number (int) | Required (exactly 1) |
The transaction format version number |
→locktime |
number (int) | Required (exactly 1) |
The transaction’s locktime: either a Unix epoch date or block height; see the Locktime parsing rules |
→vin |
array | Required (exactly 1) |
An array of objects with each object being an input vector (vin) for this transaction. Input objects will have the same order within the array as they have in the transaction, so the first input listed will be input 0 |
→ → Input |
object | Required (1 or more) |
An object describing one of this transaction’s inputs. May be a regular input or a coinbase |
→ → →txid |
string | Optional (0 or 1) |
The TXID of the outpoint being spent, encoded as hex in RPC byte order. Not present if this is a coinbase transaction |
→ → →vout |
number (int) | Optional (0 or 1) |
The output index number (vout) of the outpoint being spent. The first output in a transaction has an index of 0 . Not present if this is a coinbase transaction |
→ → →scriptSig |
object | Optional (0 or 1) |
An object describing the signature script of this input. Not present if this is a coinbase transaction |
→ → → →asm |
string | Required (exactly 1) |
The signature script in decoded form with non-data-pushing opcodes listed |
→ → → →hex |
string (hex) | Required (exactly 1) |
The signature script encoded as hex |
→ → →coinbase |
string (hex) | Optional (0 or 1) |
The coinbase (similar to the hex field of a scriptSig) encoded as hex. Only present if this is a coinbase transaction |
→ → →value |
number (Dash) | Optional (exactly 1) |
The number of Dash paid to this output. May be 0 .Only present if spentindex enabled |
→ → →valueSat |
number (duffs) | Optional (exactly 1) |
The number of duffs paid to this output. May be 0 .Only present if spentindex enabled |
→ → → →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.Only present if spentindex enabled |
→ → → → → Address |
string | Required (1 or more) |
A P2PKH or P2SH address |
→ → →sequence |
number (int) | Required (exactly 1) |
The input sequence number |
→vout |
array | Required (exactly 1) |
An array of objects each describing an output vector (vout) for this transaction. Output objects will have the same order within the array as they have in the transaction, so the first output listed will be output 0 |
→ → Output |
object | Required (1 or more) |
An object describing one of this transaction’s outputs |
→ → →value |
number (Dash) | Required (exactly 1) |
The number of Dash paid to this output. May be 0 |
→ → →valueSat |
number (duffs) | Required (exactly 1) |
The number of duffs paid to this output. May be 0 |
→ → →n |
number (int) | Required (exactly 1) |
The output index number of this output within this 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) |
→ → → →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 | Required (1 or more) |
A P2PKH or P2SH address |
→blockhash |
string (hex) | Optional (0 or 1) |
If the transaction has been included in a block on the local best block chain, this is the hash of that block encoded as hex in RPC byte order |
→height |
number (int) | Required (exactly 1) |
The height of this block on its block chain |
→confirmations |
number (int) | Required (exactly 1) |
If the transaction has been included in a block on the local best block chain, this is how many confirmations it has. Otherwise, this is 0 |
→time |
number (int) | Optional (0 or 1) |
If the transaction has been included in a block on the local best block chain, this is the block header time of that block (may be in the future) |
→blocktime |
number (int) | Optional (0 or 1) |
This field is currently identical to the time field described above |
Examples from Dash Core 0.12.2
Request a transaction in hex-encoded serialized transaction format:
curl http://localhost:19998/rest/tx/b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32.hex
Result (wrapped):
0100000001c91d4bb14e061f8f6b775ca8e62ec8a66739b375f169bce1964cee\
a2368197e5000000006a473044022050644e406be3e463d94868c617309dc021\
174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f\
69c462f120eb64b47eeb77f0a62e9bd361012102f542dde7c155717ac8df05d0\
fc8f65e2ecc078ecad42b23462f27832b441ffa5feffffff0200e1f505000000\
001976a91443d11ad5889532f22f069b18b24489b1f94f253188ac7dbafa0800\
0000001976a914bb900427682b8f7cae6779fb955a610ff71d68c888acce940000
Get the same transaction in JSON:
curl http://localhost:19998/rest/tx/b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32.json
Result (whitespace added):
{
"txid":"b06edec446fbcc0fc04a6e2774a843823f5238c2e15de40e61767a44f6788d32",
"size":225,
"version":1,
"locktime":38094,
"vin":[
{
"txid":"e5978136a2ee4c96e1bc69f175b33967a6c82ee6a85c776b8f1f064eb14b1dc9",
"vout":0,
"scriptSig":{
"asm":"3044022050644e406be3e463d94868c617309dc021174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f69c462f120eb64b47eeb77f0a62e9bd361[ALL] 02f542dde7c155717ac8df05d0fc8f65e2ecc078ecad42b23462f27832b441ffa5",
"hex":"473044022050644e406be3e463d94868c617309dc021174551dbb340665f48119e110a72b2022022f3cc93deeb4c44ce70bebe8e7f0f69c462f120eb64b47eeb77f0a62e9bd361012102f542dde7c155717ac8df05d0fc8f65e2ecc078ecad42b23462f27832b441ffa5"
},
"sequence":4294967294
}
],
"vout":[
{
"value":1.00000000,
"valueSat":100000000,
"n":0,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 43d11ad5889532f22f069b18b24489b1f94f2531 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a91443d11ad5889532f22f069b18b24489b1f94f253188ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"ySW2cuvm2wJ4EU5KzX4waYfFPV3xQni6Nm"
]
}
},
{
"value":1.50649469,
"valueSat":150649469,
"n":1,
"scriptPubKey":{
"asm":"OP_DUP OP_HASH160 bb900427682b8f7cae6779fb955a610ff71d68c8 OP_EQUALVERIFY OP_CHECKSIG",
"hex":"76a914bb900427682b8f7cae6779fb955a610ff71d68c888ac",
"reqSigs":1,
"type":"pubkeyhash",
"addresses":[
"ydRBjVr78ejCqXuGs2wbtYoFpGbDkqV8V4"
]
}
}
],
"blockhash":"0000000003b6a57e3614176e5b93caf9498009853e06d16028ebffeb361afda5",
"height":38095,
"confirmations":9,
"time":1512596315,
"blocktime":1512596315
}
See also
- GetRawTransaction RPC: 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. - GetTransaction RPC: gets detailed information about an in-wallet transaction.