bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Add support for testnet4

Open notmandatory opened this issue 1 year ago • 3 comments

There is a core PR (bitcoin/bitcoin#29775) in the works to update testnet3 to testnet4. If/when this is merged we should update the BDK testnet genesis hash to use the new one. Also examples and docs should be updated, especially changing testnet3 electrum/esplora URLs to equivalent ones for testnet4.

notmandatory avatar May 06 '24 14:05 notmandatory

Dear friends,

Recently, I have implemented support for Testnet4 in both rust-bitcoin and Blockstream/electrs. I am also keenly interested in contributing to this feature in BDK.

I noticed that the current plan is to replace Testnet3 with Testnet4 in BDK once the relevant changes are merged into the Bitcoin Core repository. However, I am concerned that this direct replacement might pose compatibility challenges for users, requiring them to choose between the two test networks in a given version.

In the rust-bitcoin community, we decided to add a TestnetVersion to accommodate both existing test networks as well as any future ones.

I would love to hear the BDK community's thoughts on this and am eager to contribute to implementing Testnet4 support in BDK based on our collective consensus.

BinChengZhao avatar Jul 09 '24 09:07 BinChengZhao

@BinChengZhao it looks like the proposed rust-bitcoin/rust-bitcoin#2945 is a breaking change and we're not planning to change our rust-bitcoin minor version for the bdk 1.0 milestone. But even with current bdk 1.0-alpha you are able to use a custom genesis hash to support any testnet you want.

For now I'm targeting this issue, with full enum support for different testnet versions, to a future bdk 2.0 milestone.

notmandatory avatar Jul 09 '24 13:07 notmandatory

@BinChengZhao it looks like the proposed rust-bitcoin/rust-bitcoin#2945 is a breaking change and we're not planning to change our rust-bitcoin minor version for the bdk 1.0 milestone. But even with current bdk 1.0-alpha you are able to use a custom genesis hash to support any testnet you want.

For now I'm targeting this issue, with full enum support for different testnet versions, to a future bdk 2.0 milestone.

Thank you very much for your hint, I will try it out by custom genesis hash first. :)

BinChengZhao avatar Jul 10 '24 03:07 BinChengZhao