Aleo Network - Namespace Chains
Author | Jonathan Gonzalez, jonathan@puzzle.online) |
---|---|
Discussions-To |
|
Status | Draft |
Type | Standard |
Created | 2023-09-12 |
Table of Contents
CAIP-2
For context, see the CAIP-2 specification.
Rationale
The namespace aleo
refers to the Aleo Network Layer 1 blockchain.
To date, Aleo consists of a single network: a testnet network (Testnet3).
An identifier for a Aleo chain consists of the namespace prefix “aleo:” followed by the chain id.
Syntax
The Aleo chain ID system maps between a human-readabe string (used to discriminate networks in the paths of node endpoints, for example) and an unsigned 16-bit binary integer, known colloquially as an “u16
number”, ranging from 0 to 65535 which is used internally.
For example, at time or writing, the u16 number 3
maps to testnet3
and 0
will map to mainnet
once the latter has been released.
The canonical location of the mapping of u16 integers to network name strings is still to be determined by the community, but in the case of conflicts between the community documentation and this document, the former should be taken as canonical.
Backwards Compatibility
n/a
Resolution Method
To resolve a reference for the Aleo namespace, get the latest block information from the chain you are interested in from an Aleo API node. An example using Javascript:
fetch('https://api.explorer.aleo.org/v1/testnet3/latest/block')
.then(response => response.json())
.then(response => console.log(response.header.metadata.network))
will log 3
.
Test Cases
This is a manually composed example.
# Aleo Testnet3
aleo:3
# Aleo mainnet
aleo:0
Additional Considerations (*OPTIONAL)
Mainnet will release sometime Q1 2024. The API is subject to change and the example above (particularly other properties) may become inaccurate over time.
References
- Aleo Network Documentation: Developer docs for the Aleo Network.
Copyright
Copyright and related rights waived via CC0.
Citation
Please cite this document as:
Jonathan Gonzalez, jonathan@puzzle.online), "namespaces/aleo-caip2: Aleo Network - Namespace Chains [DRAFT]," Chain Agnostic Namespaces, aleo-caip2, September 2023 / . [Online serial]. Available: https://github.com/ChainAgnostic/namespaces/aleo-caip2.md