These docs are for v0.15.0. Click to read the latest docs for v19.0.0-redirect.

Util RPCs

CreateMultiSig

The createmultisig RPC creates a P2SH multi-signature address.

Parameter #1---the number of signatures required

NameTypePresenceDescription
Requirednumber (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

NameTypePresenceDescription
Keys Or AddressesarrayRequired
(exactly 1)
An array of strings with each string being a public key or address

Key Or Address
stringRequired
(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

NameTypePresenceDescription
resultobjectRequired
(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

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

NameTypePresenceDescription
Blocksnumber (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 2 and 25 blocks

Result---the fee the transaction needs to pay per kilobyte

❗️

Inability to estimate

If the node doesn't have enough information to make an estimate, the value -1 will be returned.

NameTypePresenceDescription
resultnumber (Dash)Required
(exactly 1)
The estimated fee the transaction should pay in order to be included within the specified number of blocks.

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.

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 confirmations the transaction may wait before being included

NameTypePresenceDescription
conf_targetnumber (int)Required
(exactly 1)
Confirmation target in blocks (1 - 1008)

Parameter #2---estimate mode

NameTypePresenceDescription
estimate_modestringOptional
Default=
CONSERVATIVE
The fee estimate mode. Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of:
UNSET (defaults to CONSERVATIVE)
ECONOMICAL
CONSERVATIVE

Result---the fee the transaction needs to pay per kilobyte

NameTypePresenceDescription
resultobjectRequired
(exactly 1)
JSON Object containing estimate information

feerate
number (Dash)Optional
(0 or 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, this field will not be returned

error
JSON array (strings)Optional
(0 or 1)
Errors encountered during processing

blocks
numberRequired
(exactly 1)
Block number where the estimate was found

Examples from Dash Core 0.15.0

dash-cli estimatesmartfee 6

Result:

{
  "feerate": 0.00044345,
  "blocks": 6
}

Requesting data the node can't calculate (out of range):

dash-cli estimatesmartfee 2

Result:

{
  "errors": [
    "Insufficient data or no feerate found"
  ],
  "blocks": 2
}

See also

  • SetTxFee: sets the transaction fee per kilobyte paid by transactions created by this wallet.

SignMessageWithPrivKey

Added in Dash Core 0.12.3 / Bitcoin Core 0.13.0

The signmessagewithprivkey RPC signs a message with a given private key.

Parameter #1---the private key to sign with

NameTypePresenceDescription
Private Keystring (base58)Required
(exactly 1)
The private key to sign the message with encoded in base58check using wallet import format (WIF)

Parameter #2---the message to sign

NameTypePresenceDescription
MessagestringRequired
(exactly 1)
The message to sign

Result---the message signature

NameTypePresenceDescription
resultstring (base64)Required
(exactly 1)
The signature of the message, encoded in base64.

Example from Dash Core 0.12.3

Sign a the message "Hello, World!" using the following private key:

dash-cli signmessagewithprivkey cNKbZBqUCjuBRSnAJWwFWxKESJ5Lw\
G4uxBSJ1UeBNBGVRupFKr6S "Hello, World!"

Result:

IBx8jxFjutPlcZcFdQPlA2n/B4yTrYhH43qYJURKRj7LWhSD0ERE/nnRLOnXi/gwULUcqfqOKqnqkSvuJjlgEvc=

See also

ValidateAddress

The validateaddress RPC returns information about the given Dash address.

Parameter #1---a P2PKH or P2SH address

NameTypePresenceDescription
Addressstring (base58)Required
(exactly 1)
The P2PKH or P2SH address to validate encoded in base58check format

Result---information about the address

NameTypePresenceDescription
resultobjectRequired
(exactly 1)
Information about the address

isvalid
boolRequired
(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
boolOptional
(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
boolOptional
(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
boolOptional
(0 or 1)
Set to true if a P2SH address; otherwise set to false. Only returned if the address is in the wallet

script
stringOptional
(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
arrayOptional
(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
stringOptional
(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
boolOptional
(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
stringOptional
(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

timestamp
number (int)Optional
(0 or 1)
Added in Dash Core 0.12.3

The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)

hdkeypath
stringOptional
(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.3

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": "Msig 1",
  "timestamp": 0
}

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"
  "timestamp": 0  
}

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.

VerifyMessage

The verifymessage RPC verifies a signed message.

Parameter #1---the address corresponding to the signing key

NameTypePresenceDescription
Addressstring (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

NameTypePresenceDescription
Signaturestring (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

NameTypePresenceDescription
MessagestringRequired
(exactly 1)
The message exactly as it was signed (e.g. no extra whitespace)

Result: true, false, or an error

NameTypePresenceDescription
resultbooleanRequired
(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.

What’s Next