Skip to content

Improve likeness with bitcoind getrawtransaction

Dagur Valberg Johannsson requested to merge github/fork/dagurval/verbose-tx into master

Created by: dagurval

The electrum specification for verbose transaction is as follows:

The result is a coin-specific dictionary – whatever the coin daemon returns when asked for a verbose form of the raw transaction.

In other words, it's undefined. In addition the performance of fetching the details from bitcoind is much worse that just creating it ourselves, as we can do so from the data in our transaction cache. This is also what ElectrsCash does.

This PR makes the output more like what we'd expect from any bitcoind, be it BU, BCHN or others. This is a breaking change.

The following changes have been made:

  • txout -> value should not return satoshis, but as coins (/ 100 000 000). However, just changing the unit is dangerous, as we don't know what applications expect satoshis now. It's better to break these by removing the field. This field has been split into txout -> value_satoshi and txout -> value_coin. The value field is scheduled to be re-added in 6 months.
  • txout -> scriptPubKey is now an object with fields hex, asm and type, rather than a hex string.
  • txout -> n is added.
  • txin -> scriptSig is now an object with fields hex and asm

Test plan

Thanks to Sahid Miller from electrum-cash telegram for reporting incompatibility issues.

Merge request reports