Aleo Network - Namespace Chains
Author | Jonathan Gonzalez, jonathan@puzzle.online) |
---|---|
Discussions-To | https://github.com/ChainAgnostic/namespaces/pull/129 |
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.
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 1
maps to testnet
and 0
maps to mainnet
.
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.provable.com/v1/mainnet/latest/block')
.then(response => response.json())
.then(response => console.log(response.header.metadata.network))
will log 0
.
Test Cases
This is a manually composed example.
# Aleo Testnet
aleo:1
# Aleo Mainnet
aleo:0
Additional Considerations
Testnet3 has been deprecated and shut down in favor of Testnet.
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