bitcoin core – `addmultisigaddress` syntax for POST request

0
40


I was doing 2 things wrong:

  1. backslash is used in shell
  2. Extra quotes had to be removed

Thanks Pieter Wuille for the help.

Below request works fine:

POST / HTTP/1.1
Host: localhost:18333
Authorization: Basic YmFzZTY0dXNlcjpiYXNlNjRwYXNz
Content-Type: text/plain
Content-Length: 180

{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, ["bcrt1qvtp07jfnk5wcslr6xjmntnkxchzt7j2rzswnqn","bcrt1qzwpuwrykaacx7057tnafyrd4nnfecc602gptca"]]}

Response:

{
    "result": {
        "address": "bcrt1q5pza3z8vmt29xv2kyw9nvd30t0sgrfnzv55s6g9q22df4pkqp65qtuf0nn",
        "redeemScript": "5221024b72aac0b3a6dab576b344fa36384d39e95c0bc05f4e6ddf6567b581c50031712103e38d84ad58ddc696ee67e08ebec0df5931ce729fdd234acb50a2ed6785a9badc52ae",
        "descriptor": "wsh(multi(2,[7aabbdcc/0'/0'/16']024b72aac0b3a6dab576b344fa36384d39e95c0bc05f4e6ddf6567b581c5003171,[7aabbdcc/0'/0'/17']03e38d84ad58ddc696ee67e08ebec0df5931ce729fdd234acb50a2ed6785a9badc))#yg7pyr0r"
    },
    "error": null,
    "id": "curltest"
}



Source link

Leave a reply