-
Notifications
You must be signed in to change notification settings - Fork 118
Add bsv namespace (BSV Blockchain) #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sirdeggen
wants to merge
2
commits into
ChainAgnostic:main
Choose a base branch
from
sirdeggen:bsv-namespace
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+211
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||||
| --- | ||||||||
| namespace-identifier: bsv | ||||||||
| title: BSV Blockchain | ||||||||
| author: Deggen (@sirdeggen) <d.kellenschwiler@bsvassociation.org> | ||||||||
| status: Draft | ||||||||
| type: Informational | ||||||||
| created: 2026-07-10 | ||||||||
| requires: ["CAIP-2"] | ||||||||
| --- | ||||||||
|
|
||||||||
| # Namespace for the BSV Blockchain | ||||||||
|
|
||||||||
| BSV is a proof-of-work UTXO blockchain descended from the original Bitcoin protocol. | ||||||||
| This namespace identifies BSV networks by their human-readable network name, mirroring | ||||||||
| how BSV wallets and application infrastructure already refer to the network they | ||||||||
| operate on. | ||||||||
|
|
||||||||
| Registered networks: | ||||||||
|
|
||||||||
| - `bsv:mainnet` — BSV main network | ||||||||
| - `bsv:testnet` — BSV public test network | ||||||||
| - `bsv:ttn` — Teranode Test Net (public Teranode scaling test network / Teratestnet) | ||||||||
| - `bsv:tstn` — Teranode Scaling Test Net (private, per-deployment scaling test network) | ||||||||
|
|
||||||||
| ## Rationale | ||||||||
|
|
||||||||
| BSV shares its genesis block with BTC and BCH, all three tracing back to Satoshi's | ||||||||
| 2009 genesis block. The [bip122][] namespace disambiguates such forks by using the | ||||||||
| hash of the first block *after* divergence rather than the genesis hash — Bitcoin Cash, | ||||||||
| for example, is registered as `bip122:000000000000000000651ef99cb9fcbe`. A BSV | ||||||||
| identifier could in principle be constructed the same way, from BSV's fork block. | ||||||||
|
|
||||||||
| This namespace exists for a different reason. The BSV application layer — BRC-100 | ||||||||
| wallets, overlay services, ARC transaction broadcasters, and SPV clients — universally | ||||||||
| identifies a network by a stable human-readable name, never by a fork-block hash. | ||||||||
| A BRC-100 wallet self-reports its network via a `getNetwork` call; SV Node's | ||||||||
| `getblockchaininfo` returns a `chain` field of `main` or `test`. A CAIP-2 identifier | ||||||||
| that mirrors this name lets cross-chain tooling (payment protocols such as x402, | ||||||||
| CAIP-10 account references, CAIP-19 asset references) map directly onto the | ||||||||
| identifiers applications already exchange, without a full-node RPC round-trip to | ||||||||
| recover a fork-block hash. Following the precedent set by the [casper][] namespace, | ||||||||
| whose Chain ID "should not be confused with the genesis_hash," this namespace uses | ||||||||
| the network name as the CAIP-2 reference. | ||||||||
|
|
||||||||
| `ttn` and `tstn` are included so high-throughput payment protocols can exercise | ||||||||
| Teranode test environments without overloading `bsv:testnet` or inventing ad-hoc | ||||||||
| names that later need client migration. | ||||||||
|
|
||||||||
| ## Governance | ||||||||
|
|
||||||||
| The BSV protocol is stewarded by the [BSV Association][], a Switzerland-based | ||||||||
| non-profit that maintains the network's technical standards and the reference node | ||||||||
| implementation. Application-layer standards are published through the openly editable | ||||||||
| [BRC (Bitcoin Request for Comment)][BRCs] process, which defines wallet interfaces | ||||||||
| (BRC-100), key derivation (BRC-42/BRC-43), payment protocols (BRC-29), and transaction | ||||||||
| serialization (BRC-62/BRC-95), among others. Changes to this namespace should be | ||||||||
| discussed with the BSV Association and the BRC maintainers. | ||||||||
|
|
||||||||
| ## References | ||||||||
|
|
||||||||
| - [BSV Association][] - the non-profit stewarding the BSV protocol and its standards | ||||||||
| - [BRCs][] - the Bitcoin Request for Comment repository defining BSV application standards | ||||||||
| - [bip122][] - the CAIP-2 namespace for Bitcoin-based networks, which identifies forks by fork-block hash | ||||||||
| - [casper][] - a CAIP-2 namespace precedent using a human-readable Chain ID rather than a genesis hash | ||||||||
|
|
||||||||
| [BSV Association]: https://www.bsvblockchain.org/ | ||||||||
| [BRCs]: https://github.com/bitcoin-sv/BRCs | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| [bip122]: https://namespaces.chainagnostic.org/bip122/README | ||||||||
| [casper]: https://namespaces.chainagnostic.org/casper/README | ||||||||
|
|
||||||||
| ## Copyright | ||||||||
| Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). | ||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| --- | ||
| namespace-identifier: bsv-caip2 | ||
| title: BSV Blockchain - Networks | ||
| author: Deggen (@sirdeggen) <d.kellenschwiler@bsvassociation.org> | ||
| discussions-to: ["https://github.com/ChainAgnostic/namespaces/pull/190", "https://github.com/x402-foundation/x402/pull/2890"] | ||
| status: Draft | ||
| type: Standard | ||
| created: 2026-07-10 | ||
| requires: ["CAIP-2"] | ||
| --- | ||
|
|
||
| # CAIP-2 | ||
|
|
||
| *For context, see the [CAIP-2][] specification.* | ||
|
|
||
| ## Introduction | ||
|
|
||
| The BSV Chain ID is a human-readable identifier for a BSV network. It is the network | ||
| name a BSV node and its client tooling use to describe the chain they operate on — | ||
| not the genesis block hash, which BSV shares with BTC and BCH. | ||
|
|
||
| ## Specification | ||
|
|
||
| ### Semantics | ||
|
|
||
| BSV networks are identified by a stable, well-known network name. This namespace | ||
| registers the networks in general use for production and public/private scaling | ||
| tests. Classic mainnet and testnet remain the baseline networks; Teranode Test Net | ||
| (`ttn`) and Teranode Scaling Test Net (`tstn`) identify the Teranode-era scaling | ||
| test networks. Local-only environments such as regtest/mockchain are out of scope | ||
| for this registration. | ||
|
|
||
| ### Syntax | ||
|
|
||
| The Chain ID consists of the prefix `bsv:` followed by the network name. | ||
|
|
||
| The reference is a case-sensitive string matching the CAIP-2 reference grammar | ||
| `[-_a-zA-Z0-9]{1,32}`. This namespace defines four references: | ||
|
|
||
| - `mainnet` — the BSV main network | ||
| - `testnet` — the BSV public test network | ||
| - `ttn` — Teranode Test Net (public Teranode scaling test network; also known as Teratestnet) | ||
| - `tstn` — Teranode Scaling Test Net (private, per-deployment Teranode scaling test network) | ||
|
|
||
| A validating regular expression for the fully-qualified Chain ID: | ||
|
|
||
| ``` | ||
| bsv:(mainnet|testnet|ttn|tstn) | ||
| ``` | ||
|
|
||
| ### Resolution Mechanics | ||
|
|
||
| To resolve the network name for a BSV node, send a JSON-RPC `getblockchaininfo` | ||
| request; the `chain` field of the result identifies the network. Map the node's | ||
| `chain` value to the CAIP-2 reference as follows where applicable: `main` → | ||
| `mainnet`, `test` → `testnet`. Teranode deployments that self-identify as `ttn` | ||
| or `tstn` map to those references unchanged. | ||
|
|
||
| ```jsonc | ||
| // Request | ||
| { | ||
| "jsonrpc": "1.0", | ||
| "id": 1, | ||
| "method": "getblockchaininfo", | ||
| "params": [] | ||
| } | ||
|
|
||
| // Response (abridged) | ||
| { | ||
| "result": { | ||
| "chain": "main" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Application-layer clients typically resolve the network without a node round-trip: a | ||
| [BRC-100][] wallet returns the network directly from its `getNetwork` call | ||
| (e.g. `{ "network": "mainnet" }` or `{ "network": "testnet" }`), which maps to the | ||
| CAIP-2 reference for mainnet/testnet. Wallets and services that operate on Teranode | ||
| test networks SHOULD report `ttn` or `tstn` so the CAIP-2 reference matches the | ||
| application-layer identifier without translation. | ||
|
|
||
| ## Rationale | ||
|
|
||
| BSV descends from the original Bitcoin protocol and therefore shares Satoshi's genesis | ||
| block with BTC and BCH. The [bip122][] namespace addresses this by referencing the hash | ||
| of a chain's first post-fork block (as it does for Bitcoin Cash), so a BSV entry under | ||
| `bip122` is technically possible. This namespace instead uses the network name because | ||
| that is the identifier BSV's wallet and infrastructure layer already exchanges — see the | ||
| namespace [README][] for the full rationale. This mirrors the [casper][] namespace, which | ||
| likewise uses a human-readable Chain ID distinct from the genesis hash. | ||
|
|
||
| `ttn` and `tstn` are registered now so payment and cross-chain tooling (e.g. x402) can | ||
| target Teranode test environments without overloading `bsv:testnet` or inventing | ||
| ad-hoc identifiers that later need migration. | ||
|
|
||
| ### Backwards Compatibility | ||
|
|
||
| No prior CAIP or namespace assigns BSV identifiers, so there are no legacy identifiers to | ||
| maintain. Tooling that prefers a hash-based identifier can independently register BSV under | ||
| [bip122][] using its fork-block hash; the two schemes can coexist without collision because | ||
| they occupy different namespaces. Clients MUST NOT treat a `bip122` identifier that only | ||
| names the shared genesis block as a BSV network — that reference is ambiguous across the | ||
| BTC/BCH/BSV split. | ||
|
|
||
| ## Test Cases | ||
|
|
||
| This is a list of manually composed examples: | ||
|
|
||
| ``` | ||
| # BSV Mainnet | ||
| bsv:mainnet | ||
|
|
||
| # BSV Testnet | ||
| bsv:testnet | ||
|
|
||
| # BSV Teranode Test Net (Teratestnet) | ||
| bsv:ttn | ||
|
|
||
| # BSV Teranode Scaling Test Net | ||
| bsv:tstn | ||
| ``` | ||
|
|
||
| ## References | ||
|
|
||
| - [BRC-100][] - the BSV wallet-to-application interface, whose `getNetwork` method reports the network name | ||
| - [bip122][] - the CAIP-2 namespace for Bitcoin-based networks, which identifies forks by fork-block hash | ||
| - [casper][] - a CAIP-2 namespace precedent using a human-readable Chain ID rather than a genesis hash | ||
| - [README][] - the BSV namespace README with the full rationale | ||
|
|
||
| [CAIP-2]: https://chainagnostic.org/CAIPs/caip-2 | ||
| [BRC-100]: https://github.com/bitcoin-sv/BRCs/blob/master/wallet/0100.md | ||
| [bip122]: https://namespaces.chainagnostic.org/bip122/caip2 | ||
| [casper]: https://namespaces.chainagnostic.org/casper/caip2 | ||
| [README]: ./README.md | ||
|
|
||
| ## Copyright | ||
|
|
||
| Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.