Skip to content

feat: Add Testnet4 and Signet network support#458

Open
Sukuna0007Abhi wants to merge 2 commits intocaravan-bitcoin:mainfrom
Sukuna0007Abhi:issue-356-enhance
Open

feat: Add Testnet4 and Signet network support#458
Sukuna0007Abhi wants to merge 2 commits intocaravan-bitcoin:mainfrom
Sukuna0007Abhi:issue-356-enhance

Conversation

@Sukuna0007Abhi
Copy link

@Sukuna0007Abhi Sukuna0007Abhi commented Jan 25, 2026

Resolves #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.

Issue Number:

Fixes #356

Snapshots/Videos:

If relevant, did you update the documentation?

probably no need

Checklist

  • I have tested my changes thoroughly.
  • I have added or updated tests to cover my changes (if applicable).
  • I have verified that test coverage meets or exceeds 95% (if applicable).
  • I have run the test suite locally, and all tests pass.
  • I have written tests for all new changes/features
  • I have followed the project's coding style and conventions.
  • I have created a changeset to document my changes (npm run changeset)

Pls review @bucko13 @Legend101Zz

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>
@changeset-bot
Copy link

changeset-bot bot commented Jan 25, 2026

⚠️ No Changeset found

Latest commit: 4ce6232

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Feb 4, 2026 8:08pm

Request Review

Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just export both signet and testnet4, so in transactions package we would not need to redefine them ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Testnet4 and Signet

2 participants