Replies: 6 comments 12 replies
-
Do we like using ISO 8601 strings for dates, or would we prefer timestamps? Blocktimes? If timestamps, in seconds, milliseconds, or something else? |
Beta Was this translation helpful? Give feedback.
-
Do we care to include |
Beta Was this translation helpful? Give feedback.
-
How about renaming type |
Beta Was this translation helpful? Give feedback.
-
Colleagues, shall we give a hint to potential adopters of the standard how to use My current understanding, but please correct me if I am wrong:
|
Beta Was this translation helpful? Give feedback.
-
Hello, new here. Very interested in what you're doing here for NFTs. I would like to emit reserves about This works very well when we are working with elements that are not evolving too much over time. However for certain type of items, like game items, it can happen that the metadata change several times per minutes, or that some metadata that are not essential to the NFT but still nice to have as Metadata are added to the Metadata file describing it. Or it can happen that some updates from a version to another of the game could force platforms to update Metadata to hundreds of thousands of items at once, which could not possibly be expected to be replicated at once on the blockchain. That's why having to force the I think keeping a hash somewhere is a good idea, but this might be more feasible if it was added to the external file itself as a property containing something like For this instead of having the hash in the contract, the contract would reference a signer address When a platform updates those external Metadata, if it doesn't change URL, instead of having to do a tx they can simply:
Anyone can later verify the content:
instead of having just |
Beta Was this translation helpful? Give feedback.
-
BackgroundAs requested by some wallet and NFT users, they want to make the NFT images shown in the Wallet Collectibles being linked to the original page where the NFT is purchased or received. For example, if anyone click on the NFT image which is purchased on Mintbase, the original link of the NFT should be opened, such as: https://www.mintbase.io/zh/thing/Zt0z2ZKZ7FA3FqrIpDdFnwy6Cx-oIs9_pHv53n7RSik:afrofuturemafia.mintbase1.near See more details about this enhancement to wallet here: near/near-wallet#1896
|
Beta Was this translation helpful? Give feedback.
-
This discussion split from the more general discussion in #171. While that was intended to tackle the entire upcoming NFT standard, this discussion aims to only clarify the metadata aspect. Below seems to be the current best-guess at what a v1.0.0 standard might look like, based on current discussion in #171:
Summary
An interface for a non-fungible token's metadata. The goal is to keep the metadata future-proof as well as lightweight. This will be important to dApps needing additional information about an NFT's properties, and broadly compatible with other token standards such that the NEAR Rainbow Bridge can move tokens between chains.
Motivation
The primary value of non-fungible tokens comes from their metadata. While the core standard provides the minimum interface that can be considered a non-fungible token, most artists, developers, and dApps will want to associate more data with each NFT, and will want a predictable way to interact with any NFT's metadata.
NEAR's unique storage staking approach makes it feasible to store more data on-chain than other blockchains. This standard leverages this strength for common metadata attributes, and provides a standard way to link to additional offchain data to support rapid community experimentation.
This standard also provides a
spec
version. This makes it easy for consumers of NFTs, such as marketplaces, to know if they support all the features of a given token.Prior art:
Interface
Metadata applies at both the contract level (
ContractMetadata
) and the token level (TokenMetadata
). The relevant metadata for each:Then a new function is needed on the NFT contract:
And a new attribute must be added to each
Token
struct returned:type Token = { id: string, owner_id: string, + metadata: TokenMetadata, }
An implementing contract MUST include the following fields on-chain
spec
: a string. Should beft-1.0.0
to indicate that a Fungible Token contract adheres to the current versions of this Metadata and the Fungible Token Core specs. This will allow consumers of the Fungible Token to know if they support the features of a given contract.name
: the human-readable name of the set of tokens.symbol
: the abbreviation, like MOCHI or MV3base_uri
: Centralized gateway known to have reliable access to decentralized storage assets referenced byreference
ormedia
URLs. Can be used by other frontends for initial retrieval of assets, even if these frontends then replicate the data to their own decentralized nodes, which they are encouraged to do.An implementing contract MAY include the following fields on-chain
For
ContractMetadata
:icon
: a small image associated with this token. Encouraged to be a data URL, to help consumers display it quickly while protecting user data. Recommendation: use optimized SVG, which can result in high-resolution images with only 100s of bytes of storage cost. (Note that these storage costs are incurred to the token owner/deployer, but that querying these icons is a very cheap & cacheable read operation for all consumers of the contract and the RPC nodes that serve the data.) Recommendation: create icons that will work well with both light-mode and dark-mode websites by either using middle-tone color schemes, or by embeddingmedia
queries in the SVG.reference
: a link to a valid JSON file containing various keys offering supplementary details on the token. Example: "/ipfs/QmdmQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7RgQm", "https://example.com/token.json", etc. If the information given in this document conflicts with the on-chain attributes, the values inreference
shall be considered the source of truth.reference_hash
: the base64-encoded sha256 hash of the JSON file contained in thereference
field. This is to guard against off-chain tampering.For
TokenMetadata
:name
: The name of this specific token.description
: A longer description of the token.media
: URL to associated media. Preferably to decentralized, content-addressed storage.media_hash
: the base64-encoded sha256 hash of content referenced by themedia
field. This is to guard against off-chain tampering.copies
: The number of tokens with this set of metadata ormedia
known to exist at time of minting.issued_at
: ISO 8601 datetime when token was issued or mintedexpires_at
: ISO 8601 datetime when token expiresstarts_at
: ISO 8601 datetime when token starts being validupdated_at
: ISO 8601 datetime when token was last updatedextra
: anything extra the NFT wants to store on-chain. Can be stringified JSON.reference
: URL to an off-chain JSON file with more info.reference_hash
: Base64-encoded sha256 hash of JSON from reference field. Required ifreference
is included.No incurred cost for core NFT behavior
Contracts should be implemented in a way to avoid extra gas fees for serialization & deserialization of metadata for calls to
nft_*
methods other thannft_metadata
ornft_token
. Seenear-contract-standards
implementation usingLazyOption
as a reference example.Drawbacks
icon
being a data URL rather than a link to an HTTP endpoint that could contain privacy-violating code cannot be done on deploy or update of contract metadata, and must be done on the consumer/app side when displaying token data.reference
contains a privacy-violatingicon
URL, consumers & apps of this data should not naïvely display thereference
version, but should prefer the safe version. This is technically a violation of the "reference
setting wins" policy described above.Future possibilities
reference
object should contain.Beta Was this translation helpful? Give feedback.
All reactions