parallelchain-io / prfcs

ParallelChain Request for Comments (PRFCs)
0 stars 0 forks source link

PRFC 2 v4 #5

Closed lyulka closed 8 months ago

lyulka commented 9 months ago

The PRFC 2 specification in this branch currently specifies that:

  1. An owner cannot be set as its own operator.
  2. An owner cannot be set as the spender of a token it currently owns.

However, it allows an account to be set as both the operator of an owner account and the spender of any of the tokens owned by the owner account.

Perhaps we should simplify the specification as well as make this more consistent by allowing an owner to be set as its own operator and an owner to be set as a spender of a token it currently owns. This change should be harmless.

lyulka commented 9 months ago

We may also want to add an (optional?) set of view methods for iterating through all tokens in a collection.

lyulka commented 9 months ago

@dtlkelvin I made the following changes to the PRFC 2 specification:

  1. Add optional view methods for enumerating through all tokens in a collection.
  2. Relax the uniqueness requirements of operator and spender to allow owners to set themselves to be their own operator or spender.
  3. Specify a Token Metadata JSON schema. Token URIs should point to a Token Metadata JSON schema.
lyulka commented 9 months ago

Summary of design meeting (29 January, 2024)

Oddities in ERC721

We noted several oddities in the ERC 721 specification:

  1. Multiple operators can be set for a single owner, but only a single spender can be set for a single token.
  2. There is no function to get a list of all operators assigned to an owner.
  3. The "name" of an asset can only be gotten through asset metadata, while the "name" of a collection can be gotten directly from a contract method.

Conclusions

Although the aforementioned features in ERC 721 are odd, we decided to bring PRFC 2 as close as possible to ERC 721 to maximise compatibility and minimise surprises for implementors that are already familiar with ERC 721. This entails the following changes:

  1. Add: set multiple operators.
  2. Replace operator function with is_operator.
  3. Remove Token and Collection structs.
  4. Add: metadata extension (same as ERC721Metadata).
lyulka commented 9 months ago

@dtlkelvin @manngayin612 I pushed the changes we agreed to in today's design meeting. Please review the changes again and comment here if you have any questions or doubts.