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 EIP: Native Tokens #9026

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

PaulRBerg
Copy link
Contributor

This EIP introduces Multiple Native Tokens as a backward-compatible extension of the EVM, enabling
fungible tokens to function with native-like properties.

@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Nov 7, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented Nov 7, 2024

File EIPS/eip-7809.md

Requires 1 more reviewers from @axic, @g11tech, @gcolvin, @lightclient, @SamWilsn

@eth-bot eth-bot added the e-consensus Waiting on editor consensus label Nov 7, 2024
@PaulRBerg PaulRBerg changed the title Multiple Native Tokens Add EIP: Multiple Native Tokens Nov 7, 2024
@eth-bot eth-bot added the e-review Waiting on editor to review label Nov 7, 2024
---------

Co-authored-by: Paul Razvan Berg <[email protected]>
@PaulRBerg
Copy link
Contributor Author

Could we please get a number assigned to this EIP?

We have written an accompanying thread for posting on X/ Farcaster, which would attract more reviewers.

cc @abcoathup

@github-actions github-actions bot added the w-ci Waiting on CI to pass label Nov 7, 2024
EIPS/eip-xxxx.md Outdated Show resolved Hide resolved
EIPS/eip-xxxx.md Outdated Show resolved Hide resolved
EIPS/eip-xxxx.md Outdated Show resolved Hide resolved
@u59149403
Copy link

u59149403 commented Nov 8, 2024

Edit: I changed my opinion. See: https://ethereum-magicians.org/t/eip-7809-native-tokens/21615/9?u=u59149403

All these functionality already exists in https://eips.ethereum.org/EIPS/eip-223 . Read it carefully, including rationale. In particular pay attention to this phrase: "This standard allows payloads to be attached to transactions using the bytes calldata _data parameter, which can encode a second function call in the destination address, similar to how msg.data does in an ether transaction". In other words, 3rd parameter of transfer method may contain another call. I. e. you can perform "call with value", i. e. this is what your NTCALL does.

See also: https://eips.ethereum.org/EIPS/eip-1363

And finally: https://eips.ethereum.org/EIPS/eip-1155 . eip-1155 allows to transfer multiple tokens in single call. And send arbitrary data, which (similarly to eip 223) may contain another call.

So, I think existing EIPs already subsume your proposal. (Note: I'm not Ethereum developer)

EIPS/eip-xxxx.md Outdated
mapping. The supply of an NT increases as a result of executing the `MINT` opcode, and decreases as a result of
executing the `BURN` opcode. The `token_id` of an NT is the Ethereum address of its associated smart contract.

`ETH` becomes the 'Base Token', with its ID and supply initialized to zero. `ETH` is the only NT whose supply is not

Choose a reason for hiding this comment

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

I suggest initializing ETH's ID (i. e. ETH's unique contract address) to 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee instead. This value is already widely used by many dapps (in particular by DEXs) to refer to ETH. I. e. it is used as "pseudo-ERC-20" contract address for ETH. (Note: I'm not Ethereum developer)

@PaulRBerg PaulRBerg changed the title Add EIP: Multiple Native Tokens Add EIP: Native Tokens Nov 8, 2024
@PaulRBerg PaulRBerg changed the title Add EIP: Native Tokens EIP-7809: Native Tokens Nov 8, 2024
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Nov 8, 2024
@eth-bot eth-bot changed the title EIP-7809: Native Tokens Add EIP: Multiple Native Tokens Nov 8, 2024
@eth-bot eth-bot changed the title Add EIP: Multiple Native Tokens Add EIP: Native Tokens Nov 8, 2024
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Nov 8, 2024
@PaulRBerg PaulRBerg changed the title Add EIP: Native Tokens EIP 7809: Native Tokens Nov 8, 2024
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Nov 8, 2024
@eth-bot eth-bot changed the title EIP 7809: Native Tokens Add EIP: Native Tokens Nov 8, 2024
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

The commit dcdc6ee (as a parent of 3e75013) contains errors.
Please inspect the Run Summary for details.

@miohtama
Copy link

miohtama commented Nov 8, 2024

Good work! As there is some finally some work on this topic, here is the wish list (copied from other chains) on some of the items on the check list for better UX and DX which could be addresses in this spec, or other ERCs. It's important to have "full package" of the token features for building applications. Let's make sure the spec carries all the way through and addresses all the needs of application developers.

Some very important user stories include:

-[ ] 1. One RPC call to get balances of tokens of an address: wallets need to do know what tokens the user owns, now it is a good time to add an index for this as a standard full node RPC feature
-[ ] 2. Reject token transfers: Never ever lose your money when sending unsupported tokens to CEX
-[ ] 3. New token enumeration and events: You need to know when new tokens are created
-[ ] 4. Standardised rich token metadata including: icon, website, various discussion forums, source code, repository, issue tracker, legal contract, default price feed for a wallet to convert balance to USD (currently all of these are painfully manually tracked offchain)

Some list of token standard documentation from other relevant chains

@Dexaran
Copy link
Contributor

Dexaran commented Nov 12, 2024

@PaulRBerg what this opcode should do?

NTCALL - 0xb4 NTCALLCODE - 0xb5

(I suppose they act similar to call and callcode but the behaviour/logic of the opcodes is not written in the proposal, just the args)

Also, why is the transferring method so overcomplicated?

  • transferred_tokens_length: the number of transferred tokens
  • The list of transferred_tokens_length (token_id, token_amount) pairs
  • argsOffset: byte offset in the memory in bytes, the calldata of the sub context
  • argsSize: byte size to copy (size of the calldata)
  • retOffset: byte offset in the memory in bytes, where to store the return data of the sub context
  • retSize: byte size to copy (size of the return data)

I guess the idea was to let tokens be transferred with just one transaction but this overcomplicates the logic of transferring significantly and I can envision a huge number of mistakes the implementers will be making with that.

I would be in favour of keeping the logic as clean and simple as possible. Only allow 1 token to be transferred at a time, so that you would only need gas, address, token_id, quantity and data. No offsets, no lists in args.

@wjmelements
Copy link
Contributor

@Dexaran the preferred forum for discussion is specified by discussions-to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core w-ci Waiting on CI to pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants