Quantcast
Channel: How does `createrawtransaction` and `fundrawtransaction` work with Elements? - Bitcoin Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Sosthène for How does `createrawtransaction` and `fundrawtransaction` work with Elements?

$
0
0

Ok it turned out I was a bit confused about the way fees and change is handled here. Here are the commands that worked for me:

  1. createrawtransaction "[]" "[{\"$UADDR\":1.2},{\"$UCHANGE\":1.8}]" 0 false "{\"$UADDR\":\"$ASSET\",\"$UCHANGE\":\"$ASSET\"}"
  2. fundrawtransaction $RTX "{\"changeAddress\":\"$UFEECHANGE\",\"includeWatching\":true}"
  3. blindrawtransaction $RTX
  4. and then on the signing side signrawtransactionwithwallet $RTX

Some comments:

  1. the change address given in the fundrawtransaction command is actually used for the change of the fees paid in L-BTC, since here fees are explicit, not like in Bitcoin. That's why I added an explicit change address and amount for the asset I was sending.
  2. I used unconfidential addresses to create the raw transaction
  3. includeWatching is not implicitly true like in a bitcoin watch-only wallet
  4. the tx worked, it was broadcasted and accepted by the network, but there's still something wrong with the blinding, the destination output has not been blinded, and on the other hand I messed up the change of the fee, it seems I can't unblind it myself

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>