-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multiple Native Tokens #1
Conversation
@PaulRBerg, ready for your review Note 1: I've used "assets", instead of "tokens", throughout the EIP, because it feels more appropriate in this context (vs SabVM) Note 2: The only EIP section that is yet to be written is the Test Case one. However, I believe there's no point in starting to work on it until (and unless) the general idea is approved on the Ethereum Magicians forum first. Looking forward to your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @IaroslavMazur. Here's a log of the high-level changes I made:
- I formatted the Markdown using Prettier.
- Implemented the changes discussed on Slack, i.e., adding new opcodes as opposed to changing existing ones.
- I removed the
BALANCES
opcode. - I removed all notes about there being a governance process for listing tokens. It's outside the scope of this EIP.
- I refactored the EIP to say Multiple Native Tokens instead of Multiple Native Assets because (i) this is what it's said in the SabVM code, and (ii) our design isn't meant to envision NFTs, as opposed to Fuel's design, which does incorporate NFTs
- I polished the Motivation, the Rationale, the Backwards Compatibility, and the Security Considerations section
- I added a section about Prior Art (i.e. FuelVM inspiration)
And left many other comments below, as well as TODOs in the code.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. | ||
|
||
A global `token_id` -> `token_supply` mapping is introduced to keep track of the existing NAs and their circulating supply. This mapping is also being used to validate the supported NAs (a NA is supported iff its id can be found in the mapping). The supply of a NA increases as a result of the `MINT` opcode execution - and decreases during the execution of its `BURN` counterparty. The `token_id` of a NA is the Ethereum address of its associated smart contract. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the token_id
obtained by hashing the contract address with a subID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was - in the design of MNTs for our L2.
For Ethereum, however, I think that it'd be better to only allow one-to-one contract-to-NT relations (i.e. a smart contract may only have 1 associated NT). For extra security - and so that every single NT that is being added would have to be explicitly validated/approved (vs approving a smart contract once - and having it create an unlimited number of NTs afterwards).
With this new design, it's no longer needed to obtain the token ids by hashing: given the 1-1 relation, the id/address of the smart contract can simply be the id of the associated NT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I like this proposal but for a different reason, which is: simplicity and the laser-focus on replacing ERC-20s (which is the overarching goal of this EIP).
So OK great, let's keep it like this.
P.S. there might have been a misunderstanding when I asked you to start drafting this EIP. I'm sorry for that.
This EIP wasn't meant to be implemented on Ethereum Mainnet itself. It was meant to be proposed as a cool idea that could be explored in EVM-based rollups.
I clarified this in my latest review of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this proposal but for a different reason, which is: simplicity and the laser-focus on replacing ERC-20s (which is the overarching goal of this EIP).
Agree with the beauty of the added simplicity
P.S. there might have been a misunderstanding when I asked you to start drafting this EIP. I'm sorry for that.
This EIP wasn't meant to be implemented on Ethereum Mainnet itself. It was meant to be proposed as a cool idea that could be explored in EVM-based rollups.
No worries, there's nothing to be sorry for! Because we weren't sure whether we want to go the EIP or RIP route, I needed to pick one in order to have a fixed mental framework to draft the proposal based off which - and picked EIP.
If now you've got more reasons to think we should, instead, make this an RIP, then, I'll look deeper/again into what creating an RIP implies - and what must, therefore, be changed about this proposal for it to qualify as one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
I don't think the RIP process is formal as to require research — it's just like an EIP but called RIP.
I will have a think about EIPs vs RIPs today — but I am slightly more inclined to go with the former because MNTs could be beneficial for Mainnet, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contrary to the EIPs (that suggest changes to Ethereum), RIPs are, mainly, focused on suggesting changes that would be beneficial/applicable to all/most EVM Rollups. An example of such changes would be various standards that enhance the interoperability of the rollups - or the ease with which a tool created for a rollup can be migrated to another ones.
If we choose to go for an RIP, instead, we'd need to go through the existing RIPs/ecosystem to make sure our MNT proposal fits well as it is - or there is opportunity for a better design of MNTs, when taking the Rollup "wrapper" architecture as a base for the implementation (instead of that of Ethereum).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulRBerg, thank you for reviewing the PR and for your feedback!
I've replied to your comments, implemented the changes I agree with, leaving the rest of the subjects open for debate.
Also, I've left the TODO inside the Abstract section untouched, and am waiting for us to reach a consensus about the rest of the EIP before re-writing the Abstract section.
Notes:
- I've removed the
DELEGATECALL
mentions from the NT-related contexts, because this kind of CALL inherits the transferred tokens from its parent context. - I've renamed the
...2
opcodes toNT...
- I've introduced the
transferred_tokens_no
value in the opcode and tx structure, in order to be able to detect the ill-formed/ill-transported data sequences.
Looking forward to your further feedback!
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. | ||
|
||
A global `token_id` -> `token_supply` mapping is introduced to keep track of the existing NAs and their circulating supply. This mapping is also being used to validate the supported NAs (a NA is supported iff its id can be found in the mapping). The supply of a NA increases as a result of the `MINT` opcode execution - and decreases during the execution of its `BURN` counterparty. The `token_id` of a NA is the Ethereum address of its associated smart contract. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was - in the design of MNTs for our L2.
For Ethereum, however, I think that it'd be better to only allow one-to-one contract-to-NT relations (i.e. a smart contract may only have 1 associated NT). For extra security - and so that every single NT that is being added would have to be explicitly validated/approved (vs approving a smart contract once - and having it create an unlimited number of NTs afterwards).
With this new design, it's no longer needed to obtain the token ids by hashing: given the 1-1 relation, the id/address of the smart contract can simply be the id of the associated NT.
Great feedback @IaroslavMazur, and thank you for completing the remaining TODOs. I agree with all of your proposed changes, except:
Interesting. So we don't need an
I've renamed this to Could you please update the abstract? |
No. If Alice
Works for me!
Absolutely! I'll do this last thing, though, once we've resolved all of the active discussions, in order to minimize the eventual back-and-forth changes of the Abstract summary. |
Oooh, you're right. We don't need |
6ff234d
to
bf0e9ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! 🤝
--------- Co-authored-by: Paul Razvan Berg <prberg@proton.me>
--------- Co-authored-by: Paul Razvan Berg <prberg@proton.me>
--------- Co-authored-by: Paul Razvan Berg <prberg@proton.me>
--------- Co-authored-by: Paul Razvan Berg <prberg@proton.me>
No description provided.