Skip to content

Util RPC Commands

Documentation for Raptoreum Util RPC calls.


createmultisig

Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.

Arguments

Position Name Type Required Default Description
1 nrequired numeric True The number of required signatures out of the n keys.
2 keys json array True A json array of hex-encoded public keys.
Keys
2.1 key string The hex-encoded public key.
### Result
{                            (json object)
  "address" : "str",         (string) The value of the new multisig address.
  "redeemScript" : "hex"     (string) The string value of the hex-encoded redemption script.
}
### Examples
 Create a multisig address from 2 public keys
 raptoreum-cli createmultisig 2 "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"
 As a json rpc call
 curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, "[\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\",\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/

deriveaddresses

Derives one or more addresses corresponding to an output descriptor. Examples of output descriptors are: pkh() P2PKH outputs for the given pubkey sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys raw() Outputs whose scriptPubKey equals the specified hex scripts In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", where "h" represents a hardened child key. For more information on output descriptors, see the documentation in the doc/descriptors.md file.

Arguments

Position Name Type Required Default Description
1 descriptor string True The descriptor
2 range numeric or array False If a ranged descriptor is used, this specifies the beginning of the range (in [begin,end] notation) to derive.
### Result
[           (json array)
  "str",    (string) the derived addresses
  ...
]
### Examples
 First three receive addresses
 raptoreum-cli deriveaddresses "pkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#cjjspncu" "[0,2]"

estimatesmartfee

Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid.

Arguments

Position Name Type Required Default Description
1 conf_target numeric True Confirmation target in blocks (1 - 1008)
2 estimate_mode string False CONSERVATIVE The fee estimate mode.

Result

{                   (json object)
  "feerate" : n,    (numeric, optional) estimate fee rate in RTM/kB
  "errors" : [      (json array) Errors encountered during processing
    "str",          (string) error
    ...
  ],
  "blocks" : n      (numeric) block number where estimate was found
                    The request target will be clamped between 2 and the highest target
                    fee estimation is able to return based on how long it has been running.
                    An error is returned if not enough transactions and blocks
                    have been observed to make an estimate for any number of blocks.
}

Examples

 raptoreum-cli estimatesmartfee 6

getdescriptorinfo

Analyses a descriptor.

Arguments

Position Name Type Required Default Description

Result

{                                   (json object)
  "descriptor" : "str",             (string) The descriptor in canonical form, without private keys
  "checksum" : "str",               (string) The checksum for the input descriptor
  "isrange" : true|false,           (boolean) Whether the descriptor is ranged
  "issolvable" : true|false,        (boolean) Whether the descriptor is solvable
  "hasprivatekeys" : true|false     (boolean) Whether the input descriptor contained at least one private key
}

Examples

Analyse a descriptor
 raptoreum-cli getdescriptorinfo "pkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)"


signmessagewithprivkey

Sign a message with the private key of an address

Arguments

Position Name Type Required Default Description

Result

"str"    (string) The signature of the message encoded in base 64

Examples

Create the signature
 raptoreum-cli signmessagewithprivkey "privkey" "my message"
Verify the signature
 raptoreum-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "signature" "my message"
As json rpc
 curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessagewithprivkey", "params": ["privkey", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/


validateaddress

Return information about the given raptoreum address.

Arguments

Position Name Type Required Default Description

Result

{                             (json object)
  "isvalid" : true|false,     (boolean) If the address is valid or not. If not, this is the only property returned.
  "address" : "str",          (string) The raptoreum address validated
  "scriptPubKey" : "hex",     (string) The hex-encoded scriptPubKey generated by the address
  "isscript" : true|false     (boolean) If the key is a script
}

Examples

 raptoreum-cli validateaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
 curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "validateaddress", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/


verifymessage

Verify a signed message

Arguments

Position Name Type Required Default Description

Result

true|false    (boolean) If the signature is verified or not.

Examples

Unlock the wallet for 30 seconds
 raptoreum-cli walletpassphrase "mypassphrase" 30
Create the signature
 raptoreum-cli signmessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "my message"
Verify the signature
 raptoreum-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "signature" "my message"
As json rpc
 curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/