bitcoinjs/bitcoinjs-lib

Question: Bitcoinjs-lib will support Testnet4?

22388o opened this issue · 4 comments

Currently, Testnet3 suffered some issues and I would like to know, if this library will support this new testnet.

This library is mostly just serialization. AFAICT Testnet4 will use the same version bytes for various things.

If there's anything off with the current testnet values, let me know.

/**
* Represents the testnet network configuration.
*/
export const testnet: Network = {
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'tb',
bip32: {
public: 0x043587cf,
private: 0x04358394,
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef,
};

Oh, ok. Thanks @junderw

If there's anything off with the current testnet values, let me know.

I'll check current value in the testnet4 :)

Anyway. thank you so much @junderw

@junderw is compatible with testnet3 support

https://github.com/bitcoin/bips/blob/92ca582b6bc88423ec9e024f08885a326f5b9a3c/bip-testnet4.mediawiki#compatibility

Simply by adding the network parameters for Testnet 4 (magic number, etc), a client can connect to and use Testnet 4 without further modifications. The block headers have valid proof of work, so clients can trivially check that blocks are "probably" valid.

However, without the implementation of the changes detailed in Specifications, a client could follow a chain that does not follow the rules. Any fully validating node should check these rules and reject blocks that fail to follow them. Clients should either validate these rules or connect to trusted peers that do full validation.