Multi-Signature

簽署 PSBT 以獲得 3 個多重簽名中的 2 個

  • January 26, 2021

創建未簽名的 PSBT:


{
   "jsonrpc": "1.0",
   "id": "curltest",
   "method": "walletcreatefundedpsbt",
   "params": [
       [
           {
               "txid": "8b7e8c1898d473fe0229d1adf58aca6299df781e0ff77622a6d6f73273322942",
               "vout": 1
           }
       ],
       [
           {
               "tb1qv49u5nkg3y3nma4jmhp8ppl5mj4vyyattlhfyh": 0.005
           }
       ],
       0,
       {
           "includeWatching": true,
           "changeAddress": "tb1q3lkrtkwnt0txka5te0gt02vuk47trssaaxvhml",
           "feeRate": 0.0001
       },
       true
   ]
}

結果:


{
   "result": {
       "psbt": "cHNidP8BAHECAAAAAUIpMnMy99amInb3Dx5435liyor1rdEpAv5z1JgYjH6LAQAAAAD/////AjaaBwAAAAAAFgAUj+w12dNb1mt2i8vQt6mctXyxwh0goQcAAAAAABYAFGVLyk7IiSM99rLdwnCH9NyqwhOrAAAAAAABAP0hAQIAAAAFLYKKRQsSgx1v3UqETLYL4JCJWenWEn1pB7w/Tz96TdMAAAAAAP3///8tgopFCxKDHW/dSoRMtgvgkIlZ6dYSfWkHvD9PP3pN0wIAAAAA/f///1v4E5Wd/iNzkoNsZsQFQPAj2iRHlmxxmnjaPdEa7TEtAQAAAAD9////LYKKRQsSgx1v3UqETLYL4JCJWenWEn1pB7w/Tz96TdMBAAAAAP3///8pCFtwy3cF4hAMEihbDo3FVncbOKOTqx/LaoVTo1y9hwEAAAAA/f///wLOgi4AAAAAABYAFAv2sYJ4ALY+wb56YP2cI99/Y5biQEIPAAAAAAAiACBdKDYRhxYlihF1dZCM7Kobi25NNKylHThp1cWjEjTxDnsVHQABAStAQg8AAAAAACIAIF0oNhGHFiWKEXV1kIzsqhuLbk00rKUdOGnVxaMSNPEOAQVpUiEDe68lJzJ5hEVUKScCjod3qtntXQ9gMg4qa6g2LDMwhVQhAlKXOTSX1IxzZ37WAglDONf6o41uMvUm2k/Oniqutlu6IQNs3xVmKT6xvTJLTc4jB+JwmQmnPSZFCX6JMkA+neL4Q1OuIgYCUpc5NJfUjHNnftYCCUM41/qjjW4y9SbaT86eKq62W7oEN8HtHCIGA2zfFWYpPrG9MktNziMH4nCZCac9JkUJfokyQD6d4vhDBCnQwHAiBgN7ryUnMnmERVQpJwKOh3eq2e1dD2AyDiprqDYsMzCFVARbIBXQACICAuNOa3WDX2adJy31UOYgFUi2M79B12ijzcvzjVTG0mbsEJGMV+YAAACAAAAAgAcAAIAAAA==",
       "fee": 0.00001770,
       "changepos": 0
   },
   "error": null,
   "id": "curltest"
}

我嘗試使用的 UTXO 是 3 個多重簽名地址中的 2 個:tb1qt55rvyv8zcjc5yt4wkggem92rw9kunf54jj36wrf6hz6xy357y8qgpk8xa

我用這個請求創建了多重簽名:


{
   "jsonrpc": "1.0",
   "id": "curltest",
   "method": "createmultisig",
   "params": [
       2,
       [
           "037baf252732798445542927028e8777aad9ed5d0f60320e2a6ba8362c33308554",
           "025297393497d48c73677ed602094338d7faa38d6e32f526da4fce9e2aaeb65bba",
           "036cdf1566293eb1bd324b4dce2307e2709909a73d2645097e8932403e9de2f843"
       ]
   ]
}

使用此請求將地址添加到錢包:


{
   "jsonrpc": "1.0",
   "id": "curltest",
   "method": "importmulti",
   "params": [
       [
           {
               "desc": "sh(multi(2,037baf252732798445542927028e8777aad9ed5d0f60320e2a6ba8362c33308554,025297393497d48c73677ed602094338d7faa38d6e32f526da4fce9e2aaeb65bba,036cdf1566293eb1bd324b4dce2307e2709909a73d2645097e8932403e9de2f843))#t9xkhn5c",
               "timestamp": "now",
               "label": "gg1936",
               "watchonly": true
           }
       ]
   ]
}

現在我想使用未簽名的 PSBT 並對其進行簽名。應該使用哪個 RPC 呼叫,我應該在參數中提到什麼?

您要使用的命令是walletprocesspsbt. 您需要的唯一論據是 PSBT 本身。

引用自:https://bitcoin.stackexchange.com/questions/101887