I have been trying to use getrawtransaction to work with raw transactions in regtest and I have not been able to get it to parse correctly. the general format I am using is this. I am running this on powershell on windows 10 if that matters

.\bitcoin-cli -rpcport=18532 -rpcuser=alice -rpcpassword=supersecretpassword createrawtransaction '[{"txid":"7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1","vout":0}]' '{"bcrt1q27y3n03u3s52z8nlq2nt9xqyxxvk5lwxjmjxnh":25,"bcrt1qmgj8qfvhqqc049facx94qyeh57xl0lu96hck2":24.95}'

I have tried all kinds of variations on quote schemes and escaping, but the json always fails to parse with the error error: Error parsing JSON: [{txid:7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1,vout:0}]

any idea what I might be doing wrong?


1 Answer 1


Using quotes and escaping like this should work on Windows:

createrawtransaction "[{\"txid\":\"7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1\",\"vout\":0}]" "{\"bcrt1q27y3n03u3s52z8nlq2nt9xqyxxvk5lwxjmjxnh\":25,\"bcrt1qmgj8qfvhqqc049facx94qyeh57xl0lu96hck2\":24.95}"

There are a few other problems with your command, you aren't using the -regtest parameter and the second output address is not valid, but those are unrelated to this error.

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.