Current section
Files
Jump to
Current section
Files
priv/rpc/util.json
{
"ns": "Util",
"items": [
{
"name": "createmultisig",
"desc": "createmultisig nrequired [\"key\",...]\n\nCreates a multi-signature address with n signature of m keys required.\nIt returns a json object with the address and redeemScript.\n\nArguments:\n1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n2. \"keys\" (string, required) A json array of keys which are bitcoin addresses or hex-encoded public keys\n [\n \"key\" (string) bitcoin address or hex-encoded public key\n ,...\n ]\n\nResult:\n{\n \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n}\n\nExamples:\n\nCreate a multisig address from 2 addresses\n> bitcoin-cli createmultisig 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"\n\nAs a json rpc call\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createmultisig\", \"params\": [2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "numeric",
"required": true,
"name": "nrequired",
"desc": "The number of required signatures out of the n keys or addresses.",
"default": null
},
{
"type": "string",
"required": true,
"name": "keys",
"desc": "A json array of keys which are bitcoin addresses or hex-encoded public keys [ \"key\" (string) bitcoin address or hex-encoded public key ,... ]",
"default": null
}
]
},
{
"name": "estimatefee",
"desc": "estimatefee nblocks\n\nDEPRECATED. Please use estimatesmartfee for more intelligent estimates.\nEstimates the approximate fee per kilobyte needed for a transaction to begin\nconfirmation within nblocks blocks. Uses virtual transaction size of transaction\nas defined in BIP 141 (witness data is discounted).\n\nArguments:\n1. nblocks (numeric, required)\n\nResult:\nn (numeric) estimated fee-per-kilobyte\n\nA negative value is returned if not enough transactions and blocks\nhave been observed to make an estimate.\n-1 is always returned for nblocks == 1 as it is impossible to calculate\na fee that is high enough to get reliably included in the next block.\n\nExample:\n> bitcoin-cli estimatefee 6\n\n",
"args": [
{
"type": "numeric",
"required": true,
"name": "nblocks",
"desc": "",
"default": null
}
]
},
{
"name": "estimatesmartfee",
"desc": "estimatesmartfee conf_target (\"estimate_mode\")\n\nEstimates the approximate fee per kilobyte needed for a transaction to begin\nconfirmation within conf_target blocks if possible and return the number of blocks\nfor which the estimate is valid. Uses virtual transaction size as defined\nin BIP 141 (witness data is discounted).\n\nArguments:\n1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\n2. \"estimate_mode\" (string, optional, default=CONSERVATIVE) The fee estimate mode.\n Whether to return a more conservative estimate which also satisfies\n a longer history. A conservative estimate potentially returns a\n higher feerate and is more likely to be sufficient for the desired\n target, but is not as responsive to short term drops in the\n prevailing fee market. Must be one of:\n \"UNSET\" (defaults to CONSERVATIVE)\n \"ECONOMICAL\"\n \"CONSERVATIVE\"\n\nResult:\n{\n \"feerate\" : x.x, (numeric, optional) estimate fee-per-kilobyte (in BTC)\n \"errors\": [ str... ] (json array of strings, optional) Errors encountered during processing\n \"blocks\" : n (numeric) block number where estimate was found\n}\n\nThe request target will be clamped between 2 and the highest target\nfee estimation is able to return based on how long it has been running.\nAn error is returned if not enough transactions and blocks\nhave been observed to make an estimate for any number of blocks.\n\nExample:\n> bitcoin-cli estimatesmartfee 6\n\n",
"args": [
{
"type": "numeric",
"required": true,
"name": "conf_target",
"desc": "Confirmation target in blocks (1 - 1008)",
"default": null
},
{
"type": "string",
"required": false,
"name": "estimate_mode",
"desc": "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\"",
"default": "CONSERVATIVE"
}
]
},
{
"name": "signmessagewithprivkey",
"desc": "signmessagewithprivkey \"privkey\" \"message\"\n\nSign a message with the private key of an address\n\nArguments:\n1. \"privkey\" (string, required) The private key to sign the message with.\n2. \"message\" (string, required) The message to create a signature of.\n\nResult:\n\"signature\" (string) The signature of the message encoded in base 64\n\nExamples:\n\nCreate the signature\n> bitcoin-cli signmessagewithprivkey \"privkey\" \"my message\"\n\nVerify the signature\n> bitcoin-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"\n\nAs json rpc\n> 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:8332/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "privkey",
"desc": "The private key to sign the message with.",
"default": null
},
{
"type": "string",
"required": true,
"name": "message",
"desc": "The message to create a signature of.",
"default": null
}
]
},
{
"name": "validateaddress",
"desc": "validateaddress \"address\"\n\nReturn information about the given bitcoin address.\n\nArguments:\n1. \"address\" (string, required) The bitcoin address to validate\n\nResult:\n{\n \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n \"address\" : \"address\", (string) The bitcoin address validated\n \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n \"ismine\" : true|false, (boolean) If the address is yours or not\n \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n \"isscript\" : true|false, (boolean) If the key is a script\n \"script\" : \"type\" (string, optional) The output script type. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash\n \"hex\" : \"hex\", (string, optional) The redeemscript for the p2sh address\n \"addresses\" (string, optional) Array of addresses associated with the known redeemscript\n [\n \"address\"\n ,...\n ]\n \"sigsrequired\" : xxxxx (numeric, optional) Number of signatures required to spend multisig output\n \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n \"iscompressed\" : true|false, (boolean) If the address is compressed\n \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n \"timestamp\" : timestamp, (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)\n \"hdkeypath\" : \"keypath\" (string, optional) The HD keypath if the key is HD and available\n \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The Hash160 of the HD master pubkey\n}\n\nExamples:\n> bitcoin-cli validateaddress \"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"validateaddress\", \"params\": [\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "address",
"desc": "The bitcoin address to validate",
"default": null
}
]
},
{
"name": "verifymessage",
"desc": "verifymessage \"address\" \"signature\" \"message\"\n\nVerify a signed message\n\nArguments:\n1. \"address\" (string, required) The bitcoin address to use for the signature.\n2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n3. \"message\" (string, required) The message that was signed.\n\nResult:\ntrue|false (boolean) If the signature is verified or not.\n\nExamples:\n\nUnlock the wallet for 30 seconds\n> bitcoin-cli walletpassphrase \"mypassphrase\" 30\n\nCreate the signature\n> bitcoin-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"\n\nVerify the signature\n> bitcoin-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"\n\nAs json rpc\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifymessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"signature\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n\n",
"args": [
{
"type": "string",
"required": true,
"name": "address",
"desc": "The bitcoin address to use for the signature.",
"default": null
},
{
"type": "string",
"required": true,
"name": "signature",
"desc": "The signature provided by the signer in base 64 encoding (see signmessage).",
"default": null
},
{
"type": "string",
"required": true,
"name": "message",
"desc": "The message that was signed.",
"default": null
}
]
}
],
"desc": "utility functions"
}