<p>Using quotes and escaping like this should work on Windows:</p>
<pre><code>createrawtransaction &quot;[{\&quot;txid\&quot;:\&quot;7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1\&quot;,\&quot;vout\&quot;:0}]&quot; &quot;{\&quot;bcrt1q27y3n03u3s52z8nlq2nt9xqyxxvk5lwxjmjxnh\&quot;:25,\&quot;bcrt1qmgj8qfvhqqc049facx94qyeh57xl0lu96hck2\&quot;:24.95}&quot;
</code></pre>
<p>There are a few other problems with your command, you aren't using the <code>-regtest</code> parameter and the second output address is not valid, but those are unrelated to this error.</p>

CC BY-SA 4.0
2023-05-10T16:52:25.963Z
2023-05-10T16:52:25.963Z
Vojtěch Strnad
<p>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</p>
<p><code>.\bitcoin-cli -rpcport=18532 -rpcuser=alice -rpcpassword=supersecretpassword createrawtransaction '[{&quot;txid&quot;:&quot;7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1&quot;,&quot;vout&quot;:0}]' '{&quot;bcrt1q27y3n03u3s52z8nlq2nt9xqyxxvk5lwxjmjxnh&quot;:25,&quot;bcrt1qmgj8qfvhqqc049facx94qyeh57xl0lu96hck2&quot;:24.95}'</code></p>
<p>I have tried all kinds of variations on quote schemes and escaping, but the json always fails to parse with the error
<code>error: Error parsing JSON: [{txid:7b2d65b85487a891a3e0a9c541975fa7e681e571ea18982da49402e594ca2af1,vout:0}]</code></p>
<p>any idea what I might be doing wrong?</p>
<p>Thanks</p>

<bitcoin-cli><regtest><windows><createrawtransaction>
json parsing error with createrawtransaction with bitcoin-cli in regtest
lookingforhelp
# json parsing error with createrawtransaction with bitcoin-cli in regtest

(Asked by: username_0 on 2023-05-10)

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?

Thanks

**Tags:** bitcoin-cli, regtest, windows, createrawtransaction


---

## 1 answers

### Answer by username_1 on 2023-05-10. Score: 3

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.


---

