feat: Add Testnet4 and Signet network support#458
feat: Add Testnet4 and Signet network support#458Sukuna0007Abhi wants to merge 2 commits intocaravan-bitcoin:mainfrom
Conversation
Resolves caravan-bitcoin#356 - Added TESTNET4 network enum value - Implemented custom network configurations for Signet and Testnet4 - Updated networkData() to return proper network objects for all networks - Updated networkLabel() to return 'Testnet3' for clarity and added labels for Testnet4, Signet, and Regtest - Added Testnet4 and Signet support in transactions/utils.ts with custom network definitions - Updated BlockchainClient to validate and support Testnet4 and Signet networks - Updated Blockstream provider validation to indicate it doesn't support Testnet4 or Signet - Added comprehensive tests for all new network types - Updated BitcoinIcon component to include TESTNET4 type This change addresses the confusion around Testnet versions and adds support for Testnet4 which is now used by default in Trezor Connect. Signed-off-by: Sukuna0007Abhi <appsonly310@gmail.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Legend101Zz
left a comment
There was a problem hiding this comment.
Thanks for the PR @Sukuna0007Abhi .... on my first review , I guess the PR is not complete yet . The changes in the packages are necessary but not sufficient. You'll also need coordinator (frontend) changes to fully support Testnet4 and Signet.
listing down the changes you'll need :
-
apps/coordinator/src/components/NetworkPicker.jsx
( currently only has radio buttons for Mainnet, Testnet (3), and Regtest. You'll need to add Testnet4 and Signet options ) -
packages/caravan-bitcoin/src/block_explorer.ts
(needs updating to handle Testnet4 and Signet , urls ) -
apps/coordinator/src/components/ClientPicker/index.jsx
( needs to handle port selection for private bitcoind clients on new networks , and also the ClientPicker already checks isRegtest to disable public explorers. You might want to add a check to warn users that Blockstream doesn't support Testnet4 or Signet) -
apps/coordinator/src/selectors/wallet.ts , also I guess has some network specific logic
also one main thing , the wallet config we have currently stores network config as ( when a user downloads there wallet ) :
"name": "My Multisig Wallet",
"uuid": "abc123...",
"addressType": "P2WSH",
"network": "testnet", // ← Network is stored here
"client": {
"type": "public",
"provider": "mempool"
},
"quorum": {
"requiredSigners": 2,
"totalSigners": 3
},
"extendedPublicKeys": [...],
"startingAddressIndex": 0,
"ledgerPolicyHmacs": []
}
we'd want it to look like
{
"name": "My Testnet4 Wallet",
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"addressType": "P2WSH",
"network": "testnet4",
"client": {
"type": "public",
"provider": "mempool"
},
"quorum": {
"requiredSigners": 2,
"totalSigners": 3
},
"extendedPublicKeys": [
{
"name": "Key 1",
"bip32Path": "m/48'/1'/0'/2'",
"xpub": "tpub...",
"xfp": "aabbccdd",
"method": "trezor"
}
],
"startingAddressIndex": 0,
"ledgerPolicyHmacs": []
}
so you might want to look at apps/coordinator/src/selectors/wallet.ts
this will also let you connect caravan to testnet4 and check if everything works :)
Signet I am not sure if you'd be able to test it ....
PS: @bucko13 does this make sense to you the change in network in wallet config ?
| * Custom network configuration for Signet. | ||
| * Signet is a test network with centralized signing. | ||
| */ | ||
| const signet: BitcoinJSNetwork = { |
There was a problem hiding this comment.
can we just export both signet and testnet4, so in transactions package we would not need to redefine them ?
Resolves #356
This change addresses the confusion around Testnet versions and adds support for Testnet4 which is now used by default in Trezor Connect.
Issue Number:
Fixes #356
Snapshots/Videos:
If relevant, did you update the documentation?
probably no needChecklist
npm run changeset)Pls review @bucko13 @Legend101Zz