Skip to content
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

add namesapce for Armonia Meta Chain(AMAX) #64

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions amax/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
namespace-identifier: amax
title: AMAX Namespace
author: Ray (@dragonmaster), Nariss(@Narsiss)
status: Draft
type: Informational
created: 2023-04-14
updated: 2023-04-14
requires: ["CAIP-2","CAIP-10"]
---

# Namespace for AMAX Blockchains

The AMAX blockchain introduces some interesting variations on the account
model but for the sake of cross-chain addressing conforms quite well to
CASA-style URIs.

## References

- [Official website](https://amax.network)
- [AMAX Documentation](https://docs.amax.network/en/latest/API/AMAX-RPC/)
- [Account and Permissions][]: (https://developers.eos.io/welcome/v2.1/introduction-to-eosio/core_concepts)
- [Developer Portal](https://developers.eos.io/welcome/v2.1/welcome-to-eosio/index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this blockchain related to EOS in some way? See a bunch of EOS links.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with OED that this PR doesn't really explain its relationship to EOS.io well enough to be helpful to outsiders assessing AMAX support without context, which is a core design goal of a successful namespace.

It would appear that Amax shares with EOS.io an RPC interface and Rust crate for accessing them, and this comment also implies that AMAX should be considered as one network within the broader eos.io namespace despite its custom functionality. The precedent here is Polkadot, where each custom network composes its own runtime from shared or custom Rust crates, but interoperability is guaranteed by namespace-wide interfaces (i.e. XCM).

Perhaps it would make more sense to combine the two PRs ( #64 and #5 ) into an EOS.io namespace that uses AMAX examples in the ### Test Cases sections and has AMAX-specific sections added if CAIP-2 or CAIP-10 operate differently on the AMAX network than they do in EOSIO more generally?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way, if other custom networks in EOS.io want to add sections, they'll have a much smaller PR to open, and a template/comparison point in yours!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMAX is an EOS homomorphic chain, meaning most of its RPC interfaces are consistent with EOS. To add support for the AMAX network, what do we need to do? Do we need to first assist in adding the EOS namespace?
Some key points:

  1. As AMAX is homomorphic to EOS, their RPC interfaces and parameters are mostly the same. This means DApps and tools developed for EOS can also work on AMAX with little modification.
  2. However, AMAX is an independent blockchain network separate from EOS. To enable support for AMAX, its own network configuration and parameters need to be added. This includes adding the AMAX network to platforms and specifying nodes, chainID, symbols, etc.
  3. Adding the AMAX network can start from the backend, i.e. integrating AMAX nodes and chain data. The frontend modifications come after to display the AMAX network and tokens.
  4. Integrating AMAX may not require first launching support for EOS, as they are separate blockchain networks. However, considering they share similar RPC interfaces, adding EOS compatibility can provide references and experiences for supporting AMAX.
  5. Full support for AMAX needs to encompass displaying its network status, reading/transferring its native tokens, accessing its dApps and resources, etc. This requires connecting to AMAX nodes for interaction with its chain data and business logic.

Please tell us next steps to add AMAX namespaces

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey sorry for the delay. from what you're telling me, this sounds like amax is one network within the eos namespace using different configurations of the same tooling and frameworks. As such, I think it makes more sense to make an EOS.io namespace with AMAX examples (and, if it's not too much extra work, maybe also examples from main-net EOS.io, or other custom networks on the same RPC/engine). My only request would be that you add an explanation of the EOS.io concept of a "network" to the CAIP-2 entry for this namespace-- i.e., sections describing each of the following (with AMAX examples!):

  • displaying the network status of a given network (usually referred to in other CAIP-2s as "resolution mechanics", i.e. getting network status info from a node to confirm you're calling the network you think you are)
  • setting/getting native token info (particularly if not included in the status method above)

- [Standard Account Name][]: Canonical definition of account name constraints

- [Mainnet](https://expnode.amaxscan.io/v1/chain/get_info)
- [Testnet](https://test-chain.ambt.art/v1/chain/get_info)

[Standard Account Name]: https://developers.eos.io/welcome/v2.1/glossary/index/#standard-account-name

## Copyright

Copyright and related rights waived via [CC0](../LICENSE).
80 changes: 80 additions & 0 deletions amax/caip10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
namespace-identifier: amax
title: AMAX Namespace - Addresses
author: Narsiss (@Narsiss)
status: Draft
type: Standard
created: 2023-04-14
updated: 2023-04-14
requires: ["CAIP-2", "CAIP-10"]
---

# CAIP-10

*For context, see the [CAIP-10][] specification.*

## Rationale

AMAX aligns squarely with the "account" model rather than the "UXTO" model.
Each account instantiated in a given chain exists thereafter in the state of
that chain; independent of any other additional state maintained by deployed
smart contracts, the [token][] smart contract maintains a native-token
balance for each account, and can be queried in various modes from any active
node.

For any valid account on a given chain, not just current native-token balance
but also the "CPU" compute availability abstraction and the details of
authorization/proof-of-control can be requested from the chain's nodes using the
[get_account][] API call. It is worth noting that unlike other account-based
systems, the [permissions][] object (and the sui generis multi-signature system it
references) may be required to prove control of an account or authorize a
transaction. This is, of course, out of scope of this document.

## Syntax

See the more recent [Standard Account Name][] definition from the Glossary and
the [Naming Best Practices][] from the CDT section of the AMAX developer
documentation for up-to-date guidance. At time of press, the following regex
accurately validated standard account names on AMAX:
```
[a-z][.a-z1-5]{10}[a-z1-5]
```

### Backwards Compatibility

Not applicable or unknown.

## Test Cases

This is a list of manually composed examples:

```
amax:2403d6f602a87977f898aa3c62c79a76:armoniaadmin
amax:208dacab3cd2e181c86841613cf05d9c:solotestacct

```

## References



- [Official website](https://amax.network)
- [AMAX Documentation](https://docs.amax.network/en/latest/API/AMAX-RPC/)
- [Standard Account Name][]: Canonical definition of account name constraints
- [Chain ID][]: A github PR discussion detailing some key design decisions around `chain_id`
- [Developer Portal](https://developers.eos.io/welcome/v2.1/welcome-to-eosio/index)

[Transactions Protocol]: https://docs.amax.network/en/latest/API/AMAX-RPC/#wallet_sign_trx
[get_info]: https://docs.amax.network/en/latest/API/AMAX-RPC/#get_info
[get_account]: https://docs.amax.network/en/latest/API/AMAX-RPC/#get_account
[token]: https://developers.eos.io/welcome/v2.2/tutorials/eosio_token
[Chain ID]: https://github.com/EOSIO/eos/pull/3425
[Standard Account Name]: https://developers.eos.io/welcome/v2.1/glossary/index/#standard-account-name
[Account and Permissions]: https://developers.eos.io/welcome/v2.1/introduction-to-eosio/core_concepts
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md


## Rights

Copyright and related rights waived via CC0.
75 changes: 75 additions & 0 deletions amax/caip2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
namespace-identifier: amax
title: AMAX Namespace - Chains
author: Narsiss(@Narsiss)
status: Draft
type: Standard
created: 2023-04-14
updated: 2023-04-14
requires: ["CAIP-2", "CAIP-10"]
replaces: CAIP-7
---

# CAIP-2

*For context, see the [CAIP-2][] specification.*

## Rationale

An explanation of and specification for `chain_id` in the AMAX development
environment can be found in the algorithm for signing transactions in the
[Transactions Protocol][] section of the developer documents, because a valid
`chain_id` is required to authorize any transaction on that chain. Further
information on querying nodes for `chain_id` can be found in the [get_info][] section of the API documentation, and the PR [Chain ID][] that
merged in those capabilities.

## Syntax

The Chain ID, or rather the `chain_id` as defined by AMAX, is always a
64-character hexadecimal string containing the SHA256 hash of the genesis state
of a given chain chain. In order to fit the CAIP-2 reference format, a 32
character prefix of the Chain ID is used; note, however, that the longer
original will be needed to authorize new transactions.

### Resolution Method

See [Chain ID][] and [get_info] for more information about querying
network nodes for [a SHA256 hash of the] genesis state, which is referred to as
`chain ID` and required for authorizing transactions on said chain.

## Test Cases

This is a list of manually composed examples

```
# AMAX Mainnet
//get_info() --> chain_id=2403d6f602a87977f898aa3c62c79a760f458745904a15b3cd63a106f62adc16
amax:2403d6f602a87977f898aa3c62c79a76

# AMAX Testnet
//get_info() --> chain_id=208dacab3cd2e181c86841613cf05d9c60786c677e4ce86b266d0a58884968f7
amax:208dacab3cd2e181c86841613cf05d9c

```

## References

- [Official website](https://amax.network)
- [AMAX Documentation](https://docs.amax.network/en/latest/API/AMAX-RPC/)
- [Standard Account Name][]: Canonical definition of account name constraints
- [Chain ID][]: A github PR discussion detailing some key design decisions around `chain_id`
- [Developer Portal](https://developers.eos.io/welcome/v2.1/welcome-to-eosio/index)

[Transactions Protocol]: https://docs.amax.network/en/latest/API/AMAX-RPC/#wallet_sign_trx
[get_info]: https://docs.amax.network/en/latest/API/AMAX-RPC/#get_info
[Chain ID]: https://github.com/EOSIO/eos/pull/3425
[Standard Account Name]: https://developers.eos.io/welcome/v2.1/glossary/index/#standard-account-name
[Account and Permissions]: https://developers.eos.io/welcome/v2.1/introduction-to-eosio/core_concepts
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md



## Rights

Copyright and related rights waived via CC0.