You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-fungible tokens or NFTs are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other.
24
-
It should be possible to uniquely identify, own and transfer a non-fungible token. This SIP aims to provide a flexible and easy-to-implement standard that can be used by developers on the Stacks blockchain when creating their own NFTs. This standard only specifies a basic set of requirements, non-fungible tokens can have more features than what's specified in this standard.
23
+
Non-fungible tokens or NFTs are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other.
24
+
It should be possible to uniquely identify, own and transfer a non-fungible token. This SIP aims to provide a flexible and easy-to-implement standard that can be used by developers on the Stacks blockchain when creating their own NFTs. This standard only specifies a basic set of requirements, non-fungible tokens can have more features than what's specified in this standard.
25
+
25
26
# License and Copyright
26
27
27
28
This SIP is made available under the terms of the Creative Commons CC0 1.0 Universal license, available at https://creativecommons.org/publicdomain/zero/1.0/
@@ -51,23 +52,23 @@ This function must never return an error response. It can be defined as read-onl
Takes an NFT identifier and returns a response containing a valid URI which resolves to the NFT's metadata. The URI string must be wrapped in an `optional`. If the corresponding NFT doesn't exist or the contract doesn't maintain metadata, the response must be `(ok none)`. If a valid URI exists for the NFT, the response must be `(ok (some "<URI>"))`. The length of the returned URI is limited to 256 characters. The specification of the metadata should be covered in a separate SIP.
57
58
58
59
This function must never return an error response. It can be defined as read-only, i.e. `define-read-only`.
Takes an NFT identifier and returns a response containing the principal owning the NFT with the given identifier. The principal must be wrapped in an optional. If the corresponding NFT doesn't exist, the response must be `(ok none)`. The owner can be a contract principal.
65
+
Takes an NFT identifier and returns a response containing the principal owning the NFT with the given identifier. The principal must be wrapped in an optional. If the corresponding NFT doesn't exist, the response must be `(ok none)`. The owner can be a contract principal.
65
66
66
67
If a call to function `get-owner` returns some principal `A`, then it must return the same value until the `transfer` function is called with principal `A` as the sender.
67
68
68
69
For any call to `get-owner` with an ID greater than the last token ID returned by the `get-last-token-id` function, the call must return a response `(ok none)`.
69
70
70
-
This function must never return an error response. It can be defined as read-only, i.e. `define-read-only`.
71
+
This function must never return an error response. It can be defined as read-only, i.e. `define-read-only`.
71
72
72
73
### Transfer
73
74
@@ -82,6 +83,7 @@ After a successful call to `transfer`, the function `get-owner` must return the
82
83
For any call to `transfer` with an ID greater than the last token ID returned by the `get-last-token-id` function, the call must return an error response.
83
84
84
85
It is recommended to use error codes from standardized list of codes and implement the function for converting the error codes to messages function that are defined in a separate SIP.
86
+
85
87
## Trait
86
88
87
89
```
@@ -90,7 +92,7 @@ It is recommended to use error codes from standardized list of codes and impleme
@@ -115,7 +117,9 @@ The native asset functions include:
115
117
-`nft-transfer?`
116
118
117
119
The following requirements for using native asset functions are defined:
120
+
118
121
### Transfer
122
+
119
123
If the `transfer` function is called from a client without a [post-condition](https://docs.blockstack.org/understand-stacks/transactions#post-conditions) in deny mode or without any NFT condition about a changed owner, then the function call must fail with `abort_by_post_condition`.
120
124
121
125
# Using NFTs in applications
@@ -135,6 +139,7 @@ For example, when applications call the `transfer` function, they should _always
135
139
NFTs are an established asset class on blockchains. Read for example [here](https://www.ledger.com/academy/what-are-nft).
136
140
137
141
## EIP 721
142
+
138
143
Ethereum has [EIP 721](https://eips.ethereum.org/EIPS/eip-721) that defined non-fungible tokens on the Ethereum blockchain. Notable differences are that the transfer function in EIP 721 uses a different ordering of the arguments ending with the token id. The transfer function in this SIP uses the token ID as the first argument which is in line with the other native functions in Clarity. Furthermore, this SIP only defines a function for getting the URI pointing to the metadata of an NFT. The specifications for schema and other properties of the token metadata should be defined in a separate SIP.
139
144
140
145
# Backwards Compatibility
@@ -150,5 +155,12 @@ A trait that follows this specification is available on mainnet as [`SP2PABAF9FT
0 commit comments