diff --git a/aleo/README.md b/aleo/README.md new file mode 100644 index 00000000..b3b57ad8 --- /dev/null +++ b/aleo/README.md @@ -0,0 +1,28 @@ +--- +namespace-identifier: aleo +title: Aleo Network +author: Jonathan Gonzalez (@jonandgon, jonathan@puzzle.online) +discussions-to: +status: Draft +type: Standard +created: 2023-09-12 +requires: ["CAIP-2", "CAIP-10"] +--- + +# Namespace for Aleo Network Blockchains + +This document defines the applicability of CAIP schemes to the networks of the Aleo Network blockchain ecosystem. + +# Syntax + +The `aleo` namespace profiles CAIP scheme and behaviors for referring to networks and other objects within the Aleo Network blockchain ecosystem. + +# References + +- [Aleo Network Documentation][]: Developer docs for the Aleo Network. + +[Aleo Network Documentation]: https://developer.aleo.org + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/aleo/caip10.md b/aleo/caip10.md new file mode 100644 index 00000000..a83a13e7 --- /dev/null +++ b/aleo/caip10.md @@ -0,0 +1,71 @@ +--- +namespace-identifier: aleo-caip10 +title: Aleo Network - Namespace Accounts +author: Jonathan Gonzalez (@jonandgon, jonathan@puzzle.online) +discussions-to: +status: Draft +type: Standard +created: 2023-09-12 +requires: CAIP-10 +--- + + + +# CAIP-10 + +*For context, see the [CAIP-10][] specification.* + + +## Rationale + +An Aleo account address is a unique identifier that allows users to transfer value and record data to one another in transactions. + +The account address is comprised of a public key for the account encryption scheme. + +## Syntax + +Address Format Example +`aleo1dg722m22fzpz6xjdrvl9tzu5t68zmypj5p74khlqcac0gvednygqxaax0j` + +An account address is formatted as a `Bech32` string, comprised of 63 characters. The account address is encoded with an address prefix that reads `aleo1`. + +A regular expression for validating an Aleo address can be defined as: + +`^aleo1[a-z0-9]{58}$` + +## Test Cases + +```env +# Aleo Testnet3 +aleo:3:aleo1ml2xr6fawppd6uaf8gn95uy2fpqqg8gk74k0lu8na7uvayk64v8qu8hw5u + +# Aleo Mainnet +aleo:0:aleo1ml2xr6fawppd6uaf8gn95uy2fpqqg8gk74k0lu8na7uvayk64v8qu8hw5u +``` + +## Additional Considerations (*OPTIONAL) + +Account addresses / keys are chain-agnostic. + +Mainnet will release sometime at the end of 2023 / beginning of 2024. The API is subject to change. + +## References + +- [Aleo Network Documentation][]: Developer docs for the Aleo Network. +- [Aleo Account Documentation][]: Developer docs for account creation. + +[Aleo Network Documentation]: https://developer.aleo.org +[Aleo Account Documentation]: https://developer.aleo.org/concepts/accounts +[CAIP-2]: https://chainAgnostic.org/CAIPS/caip-2 +[CAIP-10]: https://chainAgnostic.org/CAIPS/caip-10 +[aleo CAIP-2]: aleo/caip2 + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/aleo/caip2.md b/aleo/caip2.md new file mode 100644 index 00000000..127e0e79 --- /dev/null +++ b/aleo/caip2.md @@ -0,0 +1,82 @@ +--- +namespace-identifier: aleo-caip2 +title: Aleo Network - Namespace Chains +author: Jonathan Gonzalez (@jonandgon, jonathan@puzzle.online) +discussions-to: +status: Draft +type: Standard +created: 2023-09-12 +requires (*optional): <["CAIP-2"]> +replaces (*optional): +--- + + + +# 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: + +```env +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. + +```env +# 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. + +[Aleo Network Documentation]: https://developer.aleo.org +[node endpoints]: https://developer.aleo.org/testnet/getting_started/overview/#query-the-network +[CAIP-2]: https://chainAgnostic.org/CAIPS/caip-2 + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).