NFT Royalties Standard #182
mikedotexe
started this conversation in
Ideas
Replies: 1 comment
-
I assert that the Royalty field on a token should almost certainly be an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In group discussions with community, the need for royalties has come across as vital and important to do right the first time.
This is likely a standard that experienced community members can contribute to best. Here are some notes on royalties that can be massaged into the form familiar with a NEAR Enhancement Proposal that would belong on the page: https://nomicon.io.
Non-Fungible Token Royalties
Version:
1.0.0
A standard for Non-Fungible Tokens to implement Royalties. Marketplace apps and other sellers of NFTs must split the proceeds of each sale of an NFT amongst the accounts specified by this standard.
Interface
A new attribute must be added to each
Token
struct:(Note: at the time of this writing, the NEP for NFTs is not finalized but can be viewed at this transient link that exists while the PR isn't merged. Please follow this to see what the diff below is building upon: https://nomicon-pr-174.onrender.com/Standards/NonFungibleToken/Core.html#nft-interface)
type Token = { id: string, owner_id: string, + royalty: Royalty, }
Rust Implementation Guidance
Taking some ideas from Mintbase and the Staking Pool contract regarding the safe representation of a fraction. Note that the rest of this document is helpful fodder for building an example of the implementation. An NEP spec should be addressing the functions and behavior, but it is very useful for the community to see an example in action.
There has not been a decision on the best place for an example implementation of royalties yet, but some possibilities are:
And now, onto the implementation details in Rust:
Where
SafeFraction
is a single 4-digit number, which may be safely multiplied with anotherSafeFraction
without resorting to storing a denominator field:Beta Was this translation helpful? Give feedback.
All reactions