0

I am trying to sign a multisig unsigned raw transaction but keep getting "JSON value is not a string as expected", I am stumped and have tried many variations. Can anyone point out what I am doing wrong? Similar syntax works on other rpc calls via curl.


curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransactionwithkey", "params":["0200000001f19aed4a275e9557778fcedffef11721dba3e8ad55eecab00954072ad2b3de610000000000010000000200e1f5050000000017a914753fb5395547d92c86447ef75d2eab46b3f47fc88730fb154e0200000017a9143c6d367277a9deed4119b3f7eb63dea807881d988700000000", ''[{"txid": "61deb3d22a075409b0caee55ade8a3db2117f1fedfce8f7757955e274aed9af1", "vout": 0, "scriptPubKey": "a9143c6d367277a9deed4119b3f7eb63dea807881d9887", "redeemScript": "532102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc92103f8af80bf1a98b5828473a757c26d8e1949e65b8d2d6fcd94bf71f640b212632653ae"}]'', ''["cRYhEC98686RyVJt7CPcZy5JwK27Lv1DFRVemrb7cWsJi4CY1MtK"]''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/
result = Optional({
    error =     {
        code = "-1";
        message = "JSON value is not a string as expected";
    };
    id = curltest;
    result = "<null>";
})

EDIT

I was doing multiple things wrong. My first mistake was following an outdated tutorial... The below code is working fine:

curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransactionwithkey", "params":["0200000001f19aed4a275e9557778fcedffef11721dba3e8ad55eecab00954072ad2b3de610000000000010000000200e1f5050000000017a914753fb5395547d92c86447ef75d2eab46b3f47fc88730fb154e0200000017a9143c6d367277a9deed4119b3f7eb63dea807881d988700000000", ''["cRYhEC98686RyVJt7CPcZy5JwK27Lv1DFRVemrb7cWsJi4CY1MtK"]'', ''[{ "txid": "61deb3d22a075409b0caee55ade8a3db2117f1fedfce8f7757955e274aed9af1", "vout": 0, "scriptPubKey": "a9143c6d367277a9deed4119b3f7eb63dea807881d9887", "redeemScript": "532102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc92103f8af80bf1a98b5828473a757c26d8e1949e65b8d2d6fcd94bf71f640b212632653ae", "amount": 100 }]''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/
result = Optional({
    error = "<null>";
    id = curltest;
    result =     {
        complete = 0;
        errors =         (
                        {
                error = "Unable to sign input, invalid stack size (possibly missing key)";
                scriptSig = 00473044022050cf7497e9ddfda12a0f24583e6a27925c5a1d2f0164a674bc6e48074fd650e00220104d6c7872a7c9ab7c9962d971f2e55c87a83eb051c74528afafe397298caa6f01004c69532102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc92103f8af80bf1a98b5828473a757c26d8e1949e65b8d2d6fcd94bf71f640b212632653ae;
                sequence = 1;
                txid = 61deb3d22a075409b0caee55ade8a3db2117f1fedfce8f7757955e274aed9af1;
                vout = 0;
                witness =                 (
                );
            }
        );
        hex = 0200000001f19aed4a275e9557778fcedffef11721dba3e8ad55eecab00954072ad2b3de6100000000b500473044022050cf7497e9ddfda12a0f24583e6a27925c5a1d2f0164a674bc6e48074fd650e00220104d6c7872a7c9ab7c9962d971f2e55c87a83eb051c74528afafe397298caa6f01004c69532102254aba14091e45a9067fbe5b225b3863d1c49650226d583dcede06a7c33f86132102ad64a03b7fc53c02f68eac04743b819bfeeabe6ca7007f473dbaf7c3570f5dc92103f8af80bf1a98b5828473a757c26d8e1949e65b8d2d6fcd94bf71f640b212632653ae010000000200e1f5050000000017a914753fb5395547d92c86447ef75d2eab46b3f47fc88730fb154e0200000017a9143c6d367277a9deed4119b3f7eb63dea807881d988700000000;
    };
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.