Skip to content

Withdraw CAIP-20 and/or extend CAIP-19 to special-case native assets #354

@u59149403

Description

@u59149403

I propose to withdraw CAIP-20.

We should refer to native currencies of chains (I mean word "chain" in CAIP-2 sense) just by using word "native".

I. e. we should refer to ether as eip155:1/native.

Why? The main reason is this: some native currencies simply don't have SLIP-44. For example, let's consider eip155:199 (BitTorrent chain). Its native currency BTT is not listed in SLIP-44. SLIP-44 contains ByteTrade BTT (slip44:34952, https://bytetrade.io ), but it is completely different from BitTorrent BTT ( https://bt.io/btt ). (In fact, link https://bytetrade.io is broken now, so it seems that this project is dead.)

Moreover, it seems BitTorrent BTT simply will never be added to SLIP-44. SLIP-44 says: "Coin types will be added only if there is a wallet implementing BIP-0044 for desired coin". There is no such wallet for BTT, so it will never be added. In fact, page https://app.bt.io/wallet , titled "BitTorrent Chain Wallet", doesn't offer any desktop wallet, but instead simply offers to connect MetaMask.

So, currently CAIP-19 cannot refer to BitTorrent BTT, and, assuming CAIPs will not change, will never be able.

But my proposal allows to refer to it simply as eip155:199/native.

Okay, now let me provide other arguments.

As well as I understand, every chain (in CAIP-2 sense) have exactly one so-called native currency. (I'm not aware of any chains, which have no native currency or have multiply native currencies.)

As well as I understand, SLIP-44 lists native currencies. Thus, every entry in SLIP-44 also indirectly describes chain (in CAIP-2 sense) of that currency. But some SLIP-44 currencies are native currencies of multiple chains. For example, ether (slip44:60) is native currency for Ethereum (eip155:1) and Base (eip155:8453). But still every SLIP-44 native currency has some designated main chain. For example, main chain for ether (slip44:60) is Ethereum (eip155:1).

Okay, so, in short: SLIP-44 lists native currencies, and every chain (in CAIP-2 sense) has exactly one native currency. Thus, CAIP-2 id is enough to identify that currency. Thus SLIP-44 id is not needed, it is okay to just use word "native".

Using word "native" is simpler for implementations. I plan to write trading bot, which will operate across different EIP-155 chains. Also I want to maintain my accounting system. And I want my bot to write to that accounting system automatically. Also, I want my accounting system to be future-proof in case I will later switch to non-EIP-155 chains. So, I plan to use CAIP-19 ids to refer to assets in that accounting system. My bot obviously will know EIP-155 id of every chain it works with. Because EIP-155 is natural way to refer to chains in Ethereum ecosystem. Even if I for some reason don't know chain EIP-155 id, I can always learn it using eth_chainId JSON-RPC method. I can even get it on-chain using CHAINID opcode. But there is no robust way to get SLIP-44 id. Yes, I can get SLIP-44 from https://github.com/ethereum-lists/chains . But, as I said above, some native currencies don't have SLIP-44, for example, BTT. Sometimes SLIP-44 is absent in that Github repo. For example, it did not contain SLIP-44 for TRX until I submitted PR some days ago: ethereum-lists/chains#7223 . Sometimes information in that repo is outright wrong, for example, SLIP-44 for World Chain native currency (ether) was specified wrongly. I submitted PR and it is not yet accepted as of now: ethereum-lists/chains#7238 .

In short, requirement to know SLIP-44 is complication for developers. It is way easier to just write "native".

I think all this applies not only to EIP-155 chains, but also to all other. So I propose to remove CAIP-20 and instead create new CAIP, which allows using word "native" for all CAIP-2 chains.

Current wording creates unnecessary complications for me, so this is one single reason why I may decide not to use CAIP-19 for my project.

(But I'm not opposed to using SLIP-44 to refer to chains in CAIP-2 sense. In such scheme bitcoin chain would be slip44:0 and bitcoin currency would be slip44:0/native. But I'm just thinking out loud. I'm not sure about this, so you can just ignore this paragraph.)

If you want, I can write PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions