1

I'm trying to use the fundrawtransaction RPC command in order to create a transaction spending an HTLC output. Here is the command i've entered:

fundrawtransaction "02000000019ab30b02450c227d38d11f1e32de4139c4b14e6496e8c791615673be577691e10000000000fdffffff01a00f000000000000160014d095ce864aa19d47371c4a87c3c61a3cdd180b0b00000000" "{\"changeAddress\": \"bc1qccvnpr2rgfh4k7mcaty4dn3nesmtsyhwn5d58q\", \"outputs\": [{\"script\": \"6352210242625461fa5e6d69921fc95973b9ad4b139cbd16bbb4dd82a59c15f90193b25567a8f1e84f1a9abb1dce8d2a0b2a1e3cbb0c5fb41baf5f8220e14e7d059b463e3b88ac76a91402ec9dcf6c138a3d8c7ae214e2ce37577766f321388670a02211af0daf491b036b0eb4ded2861dbc7b21e11c8b010f70cc282f4e9e3fb81c752ae87\", \"amount\": 0}]}"

I'm getting this error:

Unexpected key outputs (code -3)

I don't understand what this error relates to.

1 Answer 1

1

You are passing a JSON key outputs in the second argument to fundrawtransaction (named "options"). This is not a recognized parameter.

It looks like you are trying to pass a redeemscript to the command for it to be able to create a valid scriptsig. You probably want to pass this script as part of the solving_data key inside the "options" parameter. See the documentation for fundrawtransaction.

Note fundrawtransaction only works for legacy script though. I see you are trying to pass an amount key as well, i assume it's for the Bitcoin Core wallet to sign the transaction using a Segwit signature hash. You should probably use PSBT commands in the Bitcoin Core wallet instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.