elements icon indicating copy to clipboard operation
elements copied to clipboard

RawBlindRawTransaction jrpc2Errors

Open sputn1ck opened this issue 2 years ago • 5 comments

I'm trying to call rawblindrawtransaction from my jrpc2.0 library.

Elementsd returns the error -8:Unknown named parameter inputamountblinders

The raw request I send is:

{"jsonrpc":"2.0","method":"rawblindrawtransaction","params":{"hexstring":"longhex...","ignoreblindfail":true,"inputamount":[100000],"inputamountblinders":["89aaaea292f84f8e2cbc0b2c4fdd0c93226fec6aeb6f9ca422bf31d62da47ada"],"inputasset":["25b251070e29ca19043cf33ccd7324e2ddab03ecc4ae0b5e77c4fc0e5cf6c95a"],"inputassetblinder":["e3880a1dc357e782987e3df8e0776f102bdb5d41b94d22263da9aae60ba0f4f5"]},"id":14}

When I remove inputamountblinders I get the error -1:JSON value is not an array as expected

Where the raw request was:

{"jsonrpc":"2.0","method":"rawblindrawtransaction","params":{"hexstring":"longhex...","ignoreblindfail":true,"inputamount":[100000],"inputasset":["25b251070e29ca19043cf33ccd7324e2ddab03ecc4ae0b5e77c4fc0e5cf6c95a"],"inputassetblinder":["9f9d2a667ebf6faa82eafe04aa9426d85b70ae366b752ea6d3449f0baacfade9"]},"id":14}

Is the serialization by the jrpc client wrong?

sputn1ck avatar Nov 26 '21 15:11 sputn1ck

Have you ever succeeded in using named parameters on any other of the Elements-only RPCs? I have never done that, it might be that we don't support them yet. We should, as that's a framework thing that I think we should have inherited from upstream, but you never know.

stevenroose avatar Nov 26 '21 15:11 stevenroose

On some other calls it seems to do fine e.g.

{"jsonrpc":"2.0","method":"generatetoaddress","params":{"address":"ert1qfkht0df45q00kzyayagw6vqhfhe8ve7z7wecm0xsrkgmyulewlzqumq3ep","nblocks":1},"id":3}

I suspect it might be that the jrpc2 library cannot handle named string arrays correctly or something like that

sputn1ck avatar Nov 26 '21 15:11 sputn1ck

generatetoaddress is not Elements-only. Did you try other blinding-related calls?

stevenroose avatar Nov 26 '21 15:11 stevenroose

{"jsonrpc":"2.0","method":"blindrawtransaction","params":{"hexstring":"longhex.."},"id":5}

also seems to work, but it has only one single string param

sputn1ck avatar Nov 26 '21 15:11 sputn1ck

Which version of Elements are you using? I'm not surprised this is broken on 0.18, but a little bit surprised about 0.21 or master.

apoelstra avatar Dec 21 '21 15:12 apoelstra