Skip to content

Commit 3fee8ee

Browse files
authored
Add hive namespace with CAIP-2 and CAIP-10 profiles (#174)
2 parents 01d818d + b295b4a commit 3fee8ee

3 files changed

Lines changed: 295 additions & 0 deletions

File tree

hive/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
namespace-identifier: hive
3+
title: Hive
4+
author: ["@feruzm"]
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/174
6+
status: Draft
7+
type: Informational
8+
created: 2026-02-25
9+
requires: ["CAIP-2"]
10+
---
11+
12+
# Namespace for Hive
13+
14+
Hive is a delegated-proof-of-stake (DPoS) blockchain focused on social applications, digital publishing, and fast fee-less transactions. It uses account-based identity with human-readable account names.
15+
16+
This document defines the `hive` namespace as a Chain Agnostic Namespace (CAN) to allow standardized identification of Hive networks across multichain tooling using CAIP specifications.
17+
18+
## Rationale
19+
20+
Registering the `hive` namespace enables:
21+
22+
- Standard CAIP-2 chain identifiers for Hive networks
23+
- Use of CAIP-10 account identifiers for Hive account names
24+
- Interoperability with multichain wallets and tooling
25+
- Deterministic identification of Hive networks (mainnet, mirrornet)
26+
27+
Hive networks expose a protocol-defined `chain_id` used in transaction signing to prevent cross-network replay. This makes Hive suitable for deterministic CAIP-2 identification.
28+
29+
## Governance
30+
31+
Hive operates using a Delegated Proof of Stake (DPoS) consensus model. Network upgrades and parameter changes are coordinated by elected block producers ("witnesses") and stakeholders through on-chain governance mechanisms.
32+
33+
## References
34+
35+
- Hive homepage: https://hive.io/
36+
- Hive developer portal: https://developers.hive.io/
37+
- Hive configuration values (includes chain_id):
38+
https://developers.hive.io/tutorials-recipes/understanding-configuration-values.html
39+
40+
## Copyright
41+
42+
Copyright and related rights waived via CC0 1.0.

hive/caip10.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
namespace-identifier: hive-caip10
3+
title: Hive Namespace - CAIP-10 Account Identifiers
4+
author: ["@feruzm"]
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/174
6+
status: Draft
7+
type: Standard
8+
created: 2026-02-25
9+
requires: ["CAIP-2", "CAIP-10"]
10+
---
11+
12+
# CAIP-10
13+
14+
For context, see the [CAIP-10] specification.
15+
16+
## Rationale
17+
18+
Hive uses account-based identity with human-readable account names rather than hexadecimal address formats.
19+
20+
Each Hive account name:
21+
22+
- Is globally unique within a Hive network
23+
- Is used directly in transaction operations
24+
- Is validated at the protocol level
25+
- Is constrained by naming rules enforced by consensus
26+
27+
Because Hive [accounts] are stable identifiers and tied to a specific chain via `chain_id`, they are suitable for CAIP-10 account identifiers.
28+
29+
## Specification
30+
31+
A Hive [CAIP-10] account identifier MUST follow:
32+
33+
`hive:<reference>:<account>`
34+
35+
Where:
36+
37+
- `hive` is the namespace
38+
- `<reference>` is defined by the Hive CAIP-2 profile
39+
- `<account>` is a valid Hive account name
40+
41+
### Account Format
42+
43+
Hive account names MUST:
44+
45+
- Be between 3 and 16 characters in total length
46+
- Start with a lowercase letter (`a-z`)
47+
- Contain only lowercase letters (`a-z`), digits (`0-9`), hyphens (`-`), and dots (`.`)
48+
- Not start or end with a hyphen or dot
49+
- Not contain consecutive hyphens or dots
50+
- If dot-separated, each segment must be at least 3 characters and start with a letter
51+
52+
Regex:
53+
54+
```
55+
^(?=.{3,16}$)[a-z]([0-9a-z]|[0-9a-z\-](?=[0-9a-z])){2,}([\.](?=[a-z][0-9a-z\-][0-9a-z\-])[a-z]([0-9a-z]|[0-9a-z\-](?=[0-9a-z])){1,}){0,}$
56+
```
57+
58+
### Resolution
59+
60+
To validate a Hive CAIP-10 identifier:
61+
62+
1. Parse the namespace (`hive`).
63+
2. Validate the CAIP-2 reference according to the Hive CAIP-2 profile.
64+
3. Validate the account name against Hive naming rules.
65+
4. Query a Hive RPC endpoint to confirm account existence.
66+
67+
Account existence may be verified via:
68+
69+
- `condenser_api.get_accounts`
70+
- `database_api.find_accounts`
71+
72+
#### Example Request
73+
74+
```json
75+
{
76+
"jsonrpc": "2.0",
77+
"method": "condenser_api.get_accounts",
78+
"params": [["ecency"]],
79+
"id": 1
80+
}
81+
```
82+
83+
## Examples
84+
85+
### Hive Mainnet
86+
87+
```
88+
hive:beeab0de000000000000000000000000:ecency
89+
hive:beeab0de000000000000000000000000:good-karma
90+
hive:beeab0de000000000000000000000000:hive.fund
91+
hive:beeab0de000000000000000000000000:v4vapp.dhf
92+
```
93+
94+
### Hive Mirrornet
95+
96+
```
97+
hive:42000000000000000000000000000000:testuser
98+
```
99+
100+
## Security Considerations
101+
102+
Hive account names are human-readable and may be subject to phishing using visually similar names (e.g., `ecency` vs `ecency-fake`).
103+
104+
Applications SHOULD:
105+
106+
- Validate account existence before processing transactions
107+
- Display full CAIP-10 identifiers when clarity is required
108+
- Not assume account ownership without authority verification
109+
110+
Because Hive supports multiple authorities (owner, active, posting), CAIP-10 identifiers represent accounts, not individual keys.
111+
112+
## Test Cases
113+
114+
Valid:
115+
116+
```
117+
hive:beeab0de000000000000000000000000:ecency
118+
hive:beeab0de000000000000000000000000:good-karma
119+
hive:beeab0de000000000000000000000000:hive.fund
120+
hive:beeab0de000000000000000000000000:gtg
121+
hive:42000000000000000000000000000000:test-account
122+
```
123+
124+
Invalid:
125+
126+
```
127+
hive:beeab0de000000000000000000000000:UpperCase
128+
hive:beeab0de000000000000000000000000:ab
129+
hive:beeab0de000000000000000000000000:-invalid
130+
hive:beeab0de000000000000000000000000:3digits
131+
hive:beeab0de000000000000000000000000:has..double
132+
```
133+
134+
## References
135+
136+
- Hive configuration and [accounts] model
137+
138+
[accounts]: https://developers.hive.io/tutorials-recipes/understanding-configuration-values.html
139+
[CAIP-10]: https://chainagnostic.org/CAIPs/caip-10
140+
141+
## Copyright
142+
143+
Copyright and related rights waived via CC0 1.0.

hive/caip2.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
namespace-identifier: hive-caip2
3+
title: Hive Namespace - CAIP-2 Chain Identifiers
4+
author: ["@feruzm"]
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/174
6+
status: Draft
7+
type: Standard
8+
created: 2026-02-25
9+
requires: CAIP-2
10+
---
11+
12+
# CAIP-2
13+
14+
For context, see the [CAIP-2] specification:
15+
16+
## Rationale
17+
18+
Hive defines a 32-byte (`64` hex characters) `chain_id` value used for transaction signing and network identification.
19+
20+
Because CAIP-2 restricts the `reference` field to a maximum of 32 characters, this specification defines the `reference` as:
21+
22+
> The first 32 lowercase hexadecimal characters of Hive's `chain_id`.
23+
24+
This approach ensures:
25+
26+
- Deterministic chain identification
27+
- Compatibility with [CAIP-2] length constraints
28+
- Collision resistance appropriate for blockchain network identifiers
29+
- Alignment with other CAIP-2 namespace implementations
30+
31+
## Specification
32+
33+
### Namespace
34+
35+
`hive`
36+
37+
### Reference
38+
39+
The `reference` MUST:
40+
41+
- Be lowercase hexadecimal
42+
- Match the pattern: `[0-9a-f]{32}`
43+
44+
### Resolution
45+
46+
To derive a valid [CAIP-2] identifier:
47+
48+
1. Query a Hive node using `database_api.get_config`.
49+
2. Retrieve the `HIVE_CHAIN_ID` value from the response.
50+
3. Convert to lowercase.
51+
4. Truncate to the first 32 hexadecimal characters.
52+
53+
#### Example Request
54+
55+
```json
56+
{
57+
"jsonrpc": "2.0",
58+
"method": "database_api.get_config",
59+
"id": 1
60+
}
61+
```
62+
63+
#### Example Response (partial)
64+
65+
```json
66+
{
67+
"HIVE_CHAIN_ID": "beeab0de00000000000000000000000000000000000000000000000000000000"
68+
}
69+
```
70+
71+
## Known Networks (Non-Normative Examples)
72+
73+
### Hive Mainnet
74+
75+
Full chain_id: `beeab0de00000000000000000000000000000000000000000000000000000000`
76+
CAIP-2: `hive:beeab0de000000000000000000000000`
77+
78+
---
79+
80+
### Hive Mirrornet
81+
82+
Full chain_id: `42`
83+
CAIP-2: `hive:42000000000000000000000000000000` (zero-padded to 32 hex characters)
84+
85+
> **Note:** The mirrornet is a periodic snapshot of mainnet used for testing. There is no permanent public testnet at this time; mirrornet instances are ephemeral.
86+
87+
## Security Considerations
88+
89+
Applications MUST validate network configuration before accepting [CAIP-2] identifiers.
90+
91+
Hive uses account-based identity rather than address-based identity. Applications implementing [CAIP-10] should validate account existence via RPC.
92+
93+
## Test Cases
94+
95+
```
96+
hive:beeab0de000000000000000000000000
97+
hive:42000000000000000000000000000000
98+
```
99+
100+
## References
101+
102+
- Hive [configuration]
103+
104+
[CAIP-2]: https://chainagnostic.org/CAIPs/caip-2
105+
[CAIP-10]: https://chainagnostic.org/CAIPs/caip-10
106+
[configuration]: https://developers.hive.io/tutorials-recipes/understanding-configuration-values.html
107+
108+
## Copyright
109+
110+
Copyright and related rights waived via CC0 1.0.

0 commit comments

Comments
 (0)