bitcoin-etl icon indicating copy to clipboard operation
bitcoin-etl copied to clipboard

Will bitcoin-etl support the BTC taproot soft fork

Open cberson-asymmetrik opened this issue 2 years ago • 4 comments

Hi, I was wondering if bitcoin-etl will be supporting the BTC taproot soft fork coming in November. The changes are outlined in BIP340, BIP341, and BIP342.

Thanks!

cberson-asymmetrik avatar Sep 01 '21 13:09 cberson-asymmetrik

Hi, we'll have to look into it. We rely on the bitcoin node API and do minimal processing in this tool so if the changes will be reflected in the API we'll just need to upgrade our nodes

medvedev1088 avatar Sep 02 '21 12:09 medvedev1088

I tested with tx 777c998695de4b7ecec54c058c73b2cab71184cf1655840935cd9388923dc288 in block 709632:

From the bitcoin node API response

txid | "777c998695de4b7ecec54c058c73b2cab71184cf1655840935cd9388923dc288"
[...]
vin | […]
vout |  0 |   value | 0.0003 n | 0
scriptPubKey |  
   asm | "1 667bdd93c7c029767fd516…a175ac9f1220cf508963ff3"
   hex | "5120667bdd93c7c029767fd5…a175ac9f1220cf508963ff3"
  address | "bc1pveaamy78cq5hvl74zmfw…44j03ygx02zyk8lesgk06f6"
   type | "witness_v1_taproot"
[...]

using BtcStreamerAdapter.export_blocks_and_transactions() I get

{'index': 0, 'script_asm': '1 667bdd93c7c029767fd516d2ea292624b938fefefa175ac9f1220cf508963ff3', 'script_hex': '5120667bdd93c7c029767fd516d2ea292624b938fefefa175ac9f1220cf508963ff3', 'required_signatures': None, 'type': 'nonstandard', 'addresses': ['nonstandardd3b29c9218fdc3ba0a265fc7cfb1d692ad9e4e18'], 'value': 30000}

The address and type information is lost because the dict key used for creating a BtcTransactionOutput does not match the API response data: 'addresses' vs. 'address'

https://github.com/blockchain-etl/bitcoin-etl/blob/2d0012f776366b8682563c80ba2cb4820a826582/bitcoinetl/mappers/transaction_output_mapper.py#L49

Edit: https://github.com/blockchain-etl/bitcoin-etl/issues/55#issuecomment-971598288 "The root cause of this issue is that core 22.0 changed the raw json structure."

mdragaschnig avatar Nov 18 '21 14:11 mdragaschnig

Any updates on this please?

Trudko avatar Dec 20 '21 13:12 Trudko

It's been added in this PR https://github.com/blockchain-etl/bitcoin-etl/pull/57

medvedev1088 avatar Dec 20 '21 14:12 medvedev1088