NFT0 Developer Guide
This document will guide you through the process of minting NFTs that adhere to Chia's NFT0 standard, using the command-line interface (CLI), on Windows, macOS and Linux. If you are not comfortable with CLIs, Chia's Electron wallet will support the NFT1 standard, which is coming... Soon®!
Note about Python RuntimeError
on Windows
If you are running on Windows, you might occasionally see a Python Runtime Error. This is a known issue in Python and can be safely ignored. For example:
chia stop -d all
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001A719716160>
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
self._check_closed()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
daemon: {'ack': True, 'command': 'exit', 'data': {'success': True}, 'destination': 'client', 'origin': 'daemon', 'request_id': '0de5449121b6873ce18661b2adc4213d7dc795c2943ff7f4be9502058e8eaba0'}
Install and configure Chia
This section will show you how to download and install Chia from the main_dids
branch, configure your installation to run on the testnet, sync your node, and obtain some TXCH. If you have already done all of these things, you can skip to the next section, Create an NFT wallet (CLI).
tip
Your firewall might give warnings when installing Chia. This is normal. Allow the installations to continue.
We'll be running on Chia's testnet. If you don't have a synced testnet node, you can safely download a copy of the database. Do not attempt this on mainnet. Click here to begin the download. Save the file to your Downloads folder.
note
The file you will download is around 15 GB, compressed. Uncompressed, it will be around 30 GB. Make sure you have at least this much free space, and ideally 50 GB.
You may continue with the next steps while the download is in progress.
If Chia is already installed on your system, make sure it is stopped:
chia stop -d all
Ensure there are no
chia
related processes running. If you are unsure, you may want to uninstall Chia before continuing.Chia's NFT and DID development is currently happening in the main_dids branch of the
chia-blockchain
repository. You'll need to download this branch.note
If you don't already have the
git
CLI tool installed, follow these instructions to install itCreate a new directory and download the
main_dids
branch of thechia-blockchain
repository into it:mkdir main_dids
cd main_dids
git clone -b main_dids --recurse-submodules https://github.com/Chia-Network/chia-blockchain.gitInstall Chia:
- Windows
- Linux/macOS
cd chia-blockchain
.\Install.ps1
.\venv\Scripts\Activate.ps1
chia initcd chia-blockchain
sh install.sh
. ./activate
chia inittip
If you receive the message
WARNING: UNPROTECTED SSL FILE!
then run:chia init --fix-ssl-permissions
Check the version of the Chia software:
chia version
For example, as of writing the current version is:
1.3.5.dev215
IMPORTANT: Run the following command to set up Chia to use the testnet:
chia configure --testnet true
We recommend that you use
INFO
level logging instead of the defaultWARNING
level. To do this, run:chia configure --set-log-level INFO
We recommend that you use a public/private key pair for testnet that is separate from your mainnet keys. If you don't have a separate set of testnet keys, generate them:
chia keys generate
This will give an output such as the following:
Generating private key
Added private key with public key fingerprint 3049838316
(...)tip
It is good security practice to use this set of keys for testnet development only. In case of key compromise, your TXCH and NFTs will be sandboxed from your XCH.
If you generated new testnet keys in the last step, we recommend that you write down your seed phrase for later recovery. Run the following:
chia keys show --show-mnemonic-seed
You'll be shown your public and private keys. The last line of the output will be a list of 24 secret words. This is your seed phrase. Carefully copy the words on paper and store them in a secure location. Order is important.
Showing all public and private keys
Fingerprint: 3049838316
(...)
Mnemonic seed (24 secret words):
youth stomach social aware clay pottery benefit asthma mail cry rubber panda wife around provide atom cute sand staff exotic pink east gloom minuteimportant
Your seed phrase is all that is required to recover your wallet. If you lose your seed phrase, recovery will not be possible. If a bad actor gains access to your seed phrase, they'll be able to steal your Chia assets, including XCH, CATs and NFTs.
info
If you ever need to display your address, run
chia keys show
. This command will only output your public keys and address; your private keys and seed phrase will not be shown.Start your wallet by running:
chia start wallet
Wait for your wallet to sync. You can view the status of your wallet with the following command:
chia wallet show
Be sure to select the correct key/fingerprint, which you obtained from the
chia keys show
command:Wallet keys:
1) 285637561
2) * 3049838316 (Not Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 3049838316):
Wallet height: 938814
Sync status: Syncing...Syncing should only require a few minutes, unless your wallet has a large number of previous transactions. Eventually, the
chia wallet show
command will show that your wallet has been synced:Wallet height: 938990
Sync status: Synced
Balances, fingerprint: 3049838316
Chia Wallet:
-Total Balance: 14.5 txch (14500000000000 mojo)
-Pending Total Balance: 14.5 txch (14500000000000 mojo)
-Spendable: 14.5 txch (14500000000000 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1In order to continue, you'll need to have some TXCH in your wallet. If your total balance is 0, you can obtain 1 TXCH from our faucet. Copy the value of "First wallet address:" from the output of the
chia keys show
command. It will be a long string beginning with "txch".Open our testnet faucet page. Paste your address and click "Submit".
You'll receive this message:
Accepted. Your request is in the queue and will be processed in the order it was received.
At some point you'll receive 1 TXCH. Depending on how busy the faucet and the testnet are, this could take several minutes. However, you don't need to wait for your coins to arrive before continuing.Create the folder where your database will reside:
mkdir ~/.chia/mainnet/db
You must wait for your database file to finish downloading before continuing. After the download has completed, use an archive manager such as 7-Zip to extract the file. You should now have a file in your Downloads folder called
blockchain_v2_testnet10.sqlite
.Move the database to the folder you just created:
mv ~/Downloads/blockchain_v2_testnet10.sqlite ~/.chia/mainnet/db
Start the full node, which will begin syncing to the database file:
(venv) $ chia start node
chia_full_node: startedCheck the sync status:
chia show -s
Eventually, it will say
Full Node Synced
:Network: testnet10 Port: 58444 RPC Port: 8555
Node ID: 82a73b06b3a5f9493a3ac4e3d903026b39c85b748158ba41c623d531947f2a2a
Genesis Challenge: ae83525ba8d1dd3f09b277de18ca3e43fc0af20d20c4b3e92ef2a48bd291ccb2
Current Blockchain Status: Full Node Synced
Once you have a synced full node and some TXCH, you may proceed to the next section. If your requested TXCH has not yet arrived, post your address on the #dev channel on Keybase. Someone might be able to send some to you.
Note about Chia wallets
In Chia, each public/private key pair can hold multiple wallets of various types.
A "fingerprint" is a 4-byte hash of a public key. The computer running the examples we'll use in the next sections had two public/private key pairs, and thus two fingerprints, labeled 1)
and 2)
.
Note that simultaneous syncing of multiple fingerprints is not possible. Whether you're using the CLI or the GUI (in general, not just for NFTs) you have to select one of the fingerprints to sync, while the other will be temporarily ignored and not synced.
Within each of the fingerprints, you can store multiple wallets of various types. The default wallet is a Chia Wallet
, aka a STANDARD_WALLET
. This label is part of a enum with a value of 0
. The other wallet types are as follows:
STANDARD_WALLET = 0
RATE_LIMITED = 1
ATOMIC_SWAP = 2
AUTHORIZED_PAYEE = 3
MULTI_SIG = 4
CUSTODY = 5
CAT = 6
RECOVERABLE = 7
DISTRIBUTED_ID = 8
POOLING_WALLET = 9
NFT = 10
A few notes about this enum:
- The only types that are supported as of NFT0 are STANDARD_WALLET, CAT, and NFT.
- Each fingerprint/Wallet Key can only hold one
STANDARD_WALLET
and oneNFT
(for now), but it can hold multipleCAT
s. - In addition to a type, each wallet also has a
Wallet ID
. This is simply an integer that increments for each new wallet.
For example, the following setup would be possible to run on a single computer:
- Wallet Key 1 (not synced)
- Chia Wallet (Type = STANDARD_WALLET, Wallet ID = 1)
- Marmot (Type = CAT, Wallet ID = 2)
- Wallet Key 2 (synced)
- Chia Wallet (Type = STANDARD_WALLET, Wallet ID = 1)
- NFT Wallet (Type = NFT, Wallet ID = 2)
- Marmot (Type = CAT, Wallet ID = 3)
- Spacebucks (Type = CAT, Wallet ID = 4)
Create an NFT wallet (CLI)
tip
You can create an NFT wallet via a CLI command or an RPC. This section will show you the CLI command. If you prefer to use an RPC, skip to the next section.
- Run
chia wallet nft create
to create a new NFT wallet. Be sure to select your wallet fingerprint that is synced and contains some TXCH:
(venv) $ chia wallet nft create
Wallet keys:
1) 285637561
2) * 2447771420 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 2447771420):
Successfully created an NFT wallet with id 2 on key 2447771420
- Run
chia wallet show
to view the status. Take note of your new wallet'sWallet ID
(2
in this example).
(venv) $ chia wallet show
Wallet keys:
1) 285637561
2) * 3049838316 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 3049838316):
Wallet height: 958280
Sync status: Synced
Balances, fingerprint: 3049838316
Chia Wallet:
-Total Balance: 14.5 txch (14500000000000 mojo)
-Pending Total Balance: 14.5 txch (14500000000000 mojo)
-Spendable: 14.5 txch (14500000000000 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1
NFT Wallet:
-Total Balance: 0.0
-Pending Total Balance: 0.0
-Spendable: 0.0
-Type: NFT
-Asset ID: {"my_nft_coins": [{"coin": {"parent_coin_info": "0x4ad596f88e5b6
-Wallet ID: 2
info
NFT0 does not include DIDs, so each NFT wallet can only be anchored to a public/private key pair. Additionally, each public/private key pair can only contain a single NFT wallet, which will act as the "inbox" for all NFTs associated with that key pair. It is therefore only possible to have one NFT Wallet
for each Wallet key
.
The NFT1 standard will include DIDs. When that standard is released, each NFT wallet will be able to anchor to either a DID or a public/private key pair. This will allow for the creation of multiple NFT Wallets
inside the same Wallet key
.
If you have successfully created an NFT wallet from the CLI command shown above, feel free to skip the next section, which will show you how to create an NFT wallet using an RPC. Instead, head to the following section, Obtain an image and its hash.
Create an NFT wallet (RPC)
important
This section will use Linux/MacOS rpc syntax. When running rpc commands on Windows, you will need to escape all quotes with backslashes.
For example, here is a typical rpc command on Linux and MacOS:
chia rpc wallet create_new_wallet '{"wallet_type": "nft_wallet"}'
To run the same command on Windows, you will need to escape the quotes, so it looks like this:
chia rpc wallet create_new_wallet '{\"wallet_type\": \"nft_wallet\"}'
info
If you already created an NFT wallet using the CLI command from the previous section, you can skip to the next section, Obtain an image and its hash.
- Run
chia rpc wallet create_new_wallet '{"wallet_type": "nft_wallet"}'
to create a new NFT wallet:
(venv) $ chia rpc wallet create_new_wallet '{"wallet_type": "nft_wallet"}'
{
"success": true,
"type": 10,
"wallet_id": 2
}
Note that a wallet with a type
of 10
is an NFT wallet.
- Run
chia wallet show
to view the status. The NFT wallet has aWallet ID
of2
:
(venv) $ chia wallet show
Wallet keys:
1) 285637561
2) * 3049838316 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 3049838316):
Wallet height: 958360
Sync status: Synced
Balances, fingerprint: 3049838316
Chia Wallet:
-Total Balance: 14.5 txch (14500000000000 mojo)
-Pending Total Balance: 14.5 txch (14500000000000 mojo)
-Spendable: 14.5 txch (14500000000000 mojo)
-Type: STANDARD_WALLET
-Wallet ID: 1
NFT Wallet:
-Total Balance: 0.0
-Pending Total Balance: 0.0
-Spendable: 0.0
-Type: NFT
-Asset ID: {"my_nft_coins": [{"coin": {"parent_coin_info": "0x4ad596f88e5b6
-Wallet ID: 2
Obtain an image and its hash
First, find an image to mint as an NFT. For this example, we'll use an image that is licensed in the public domain: https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg
Calculate the image's hash. Here are three (of many) options:
i. Curl with sha256sum. If you're on Windows, you'll need to run this command from git bash
$ curl https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg | sha256sum
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3252k 100 3252k 0 0 19.8M 0 --:--:-- --:--:-- --:--:-- 19.9M
14836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb0 *-ii. Curl with shasum. If you're on Windows, you'll need to run this command from git bash
$ curl https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg | shasum -a 256
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3252k 100 3252k 0 0 23.1M 0 --:--:-- --:--:-- --:--:-- 23.3M
14836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb0 *-iii. Save the image locally. Visit https://emn178.github.io/online-tools/sha256_checksum.html. Upload the image and click the Hash button.
In all three cases, the hash for this sample image is
14836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb0
.
Mint an NFT (RPC)
- Mint your NFT using the following values:
wallet_id
: The ID of your NFT walleturis
: A comma-separated list of URIs where this image may be found. We'll only use one URI for this example. For NFT1, the image at this uri will be displayed in Chia's GUI wallet. Be sure to add two backslashes (\\
) to escape any special characters in the URI, such as?
and=
hash
: The hash you just calculated. For now, the minting tool and wallet will not verify that this hash is correct. Be sure to double-check this, ideally using multiple methods to calculate the hash. Hash verification will be included in NFT1artist_percentage
: For NFT1, this will be the royalty that will go to the original artist each time the NFT is sold. The percentage is multiplied by 100 -- for example, to set a 15% royalty, set this value to 1500. However, this feature is disabled in NFT0artist_address
: Enter the wallet address of the original artist. For this example on testnet, we'll use a local address
The command will end up looking like this:
chia rpc wallet nft_mint_nft '{"wallet_id": 2, "uris": ["https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"], "hash": "14836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb0", "artist_percentage": 1500, "artist_address": "txch1m4fshsg2cas5lmzh8x6n50mhcs2fehc3tucundczp0kk2z7t3cxsgj65pu"}'
If successful, you will receive a JSON output, including the coin additions and removals involved in minting the NFT, as well as the spend bundle that was used. At the end of the output, you should see "success": true,
.
(venv) $ chia rpc wallet nft_mint_nft '{"wallet_id": 2, "uris": ["https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"], "hash": "14836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb0", "artist_percentage": 1500, "artist_address": "txch1m4fshsg2cas5lmzh8x6n50mhcs2fehc3tucundczp0kk2z7t3cxsgj65pu"}'
{
"nft_list": [
{
"data_hash": "14836B86A48E1B2B5E857213AF97534704475B4C155D34B2CB83ED4B7CBA2BB0",
"data_uris": [
"https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"
],
"did_owner": "",
"edition_count": 1,
"edition_number": 1,
"launcher_id": "C2F3F7D54D254381FD33FBE2B6C031E5BE3BA1267215A2FA182E064ED6015FEF",
"license_hash": "",
"license_uris": [],
"metadata_hash": "",
"metadata_uris": [],
"nft_coin_id": "4296D4E49E2056DB5AEB62DF849851E61326DAEA4337825BE15410E7F4C07E32",
"royalty": 0,
"version": "NFT0"
}
],
"success": true,
"wallet_id": 2
}
- Wait a few minutes for your NFT to be confirmed on the blockchain. To view your NFT, run the
nft_get_nfts
RPC, passing in your NFT wallet's ID. Eventually, the NFT will show up:
(venv) $ chia rpc wallet nft_get_nfts '{"wallet_id": 2}'
{
"nft_list": [
{
"data_hash": "14836B86A48E1B2B5E857213AF97534704475B4C155D34B2CB83ED4B7CBA2BB0",
"data_uris": [
"https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"
],
"did_owner": "",
"edition_count": 1,
"edition_number": 1,
"launcher_id": "C2F3F7D54D254381FD33FBE2B6C031E5BE3BA1267215A2FA182E064ED6015FEF",
"license_hash": "",
"license_uris": [],
"metadata_hash": "",
"metadata_uris": [],
"nft_coin_id": "4296D4E49E2056DB5AEB62DF849851E61326DAEA4337825BE15410E7F4C07E32",
"royalty": 0,
"version": "NFT0"
}
],
"success": true,
"wallet_id": 2
}
Transfer an NFT (RPC)
This section will show you how to transfer an NFT from one TXCH wallet to another.
important
Before you can run this example, you'll need a second NFT wallet. One way to accomplish this would be to follow this guide on another computer. If you want to use the same computer, you'll need to generate another set of keys and create another NFT wallet. This can be accomplished by doing the following:
- Run
chia keys generate
to generate a new key - Run
chia keys show
and copy theFirst wallet address:
of the new key - Run
chia wallet show
and sync the new wallet key - Run
chia wallet nft create
to create a new NFT wallet with the new key - Run
chia wallet show
and sync the wallet key that contains the NFT
Before continuing, be sure that you have a synced wallet that contains an NFT to transfer, as well as another wallet that will receive the NFT.
- Run the
nft_transfer_nft
RPC using the following values:
wallet_id
: TheWallet ID
of the NFT to transfertarget_address
: The address of the NFT wallet to transfer tonft_coin_id
: The ID of the NFT coin, obtained from thenft_get_nfts
RPC
If successful, the target address, coin id, and spend bundle will all be displayed. For example:
(venv) $ chia rpc wallet nft_transfer_nft '{"wallet_id": 2, "target_address": "txch167lgv3v86m6vzyr9s44w2xwsnuxcdvsw2lvsf7ru03cq6p7xyngs7mvju7", "nft_coin_id": "4296D4E49E2056DB5AEB62DF849851E61326DAEA4337825BE15410E7F4C07E32"}'
{
"spend_bundle": {
"aggregated_signature": "0x91dc6a78a2ca1a0992c3b4c0f4cb93c2a8f04c58b9b82afe2b383975b1fb346e9f039f1dd50792383513c6645c8dfa9e061a52468ddefba25deb706c3c9e2bda8ac1431238d926c6eb3c23ee89f882e670b6a285717934af368d2e1db31def60",
"coin_solutions": [
{
"coin": {
"amount": 1,
"parent_coin_info": "0xeb46562a95a335f77b4d0d97458580674a10b210c849c1d01c06ec29d0bde8cc",
"puzzle_hash": "0xb28550e1d3cec070aa79ff582d5327d5fed881c7b66acc2977e84e5a49109fe1"
},
"puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ffff18ff2fff3c80ffff01ff04ffff04ff10ffff04ff2fff808080ffff04ffff02ff3effff04ff02ffff04ff05ffff04ffff0bff27ffff02ffff03ff77ffff01ff02ff36ffff04ff02ffff04ff09ffff04ff57ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ffff011d80ff0180ffff02ffff03ff77ffff0181b7ffff015780ff018080ffff04ff77ff808080808080ffff02ff26ffff04ff02ffff04ff05ffff04ffff02ff0bff5f80ffff01ff8080808080808080ffff01ff088080ff0180ffff04ffff01ffffff49ff4702ff33ff0401ffff01ff02ff02ffff03ff05ffff01ff02ff3affff04ff02ffff04ff0dffff04ffff0bff2affff0bff3cff2c80ffff0bff2affff0bff2affff0bff3cff1280ff0980ffff0bff2aff0bffff0bff3cff8080808080ff8080808080ffff010b80ff0180ffffff02ffff03ff0bffff01ff02ffff03ffff02ffff03ffff09ff23ff1480ffff01ff02ffff03ffff18ff81b3ff3c80ffff01ff0101ff8080ff0180ff8080ff0180ffff01ff02ffff03ffff20ff1780ffff01ff02ffff03ffff09ff81b3ffff01818f80ffff01ff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff3cff808080808080ffff01ff04ffff04ff23ffff04ffff02ff36ffff04ff02ffff04ff09ffff04ff53ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ff738080ffff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff3cff8080808080808080ff0180ffff01ff088080ff0180ffff01ff04ff13ffff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff17ff8080808080808080ff0180ffff01ff02ffff03ff17ff80ffff01ff088080ff018080ff0180ff0bff2affff0bff3cff3880ffff0bff2affff0bff2affff0bff3cff1280ff0580ffff0bff2affff02ff3affff04ff02ffff04ff07ffff04ffff0bff3cff3c80ff8080808080ffff0bff3cff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bff3cff058080ff0180ff02ffff03ffff21ff17ffff09ff0bff158080ffff01ff04ff28ffff04ff0bff808080ffff01ff088080ff0180ff018080ffff04ffff01ffa0f1e8350cec62f8204aaf867cc3c12cae369f619258206616108c6cfd7be760b3ffa0c2f3f7d54d254381fd33fbe2b6c031e5be3ba1267215a2fa182e064ed6015fefa0eff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9ffff04ffff01ff02ffff01ff02ffff01ff04ffff04ff10ffff04ff81bfff808080ffff02ff3effff04ff02ffff04ff05ffff04ffff02ff3affff04ff02ffff04ff17ffff04ff0bffff04ffff02ff2fff5f80ff808080808080ffff04ff81bfffff01ff8080808080808080ffff04ffff01ffffff49ff0233ffff0401ff0102ffffffff02ffff03ff05ffff01ff02ff22ffff04ff02ffff04ff0dffff04ffff0bff3cffff0bff34ff2480ffff0bff3cffff0bff3cffff0bff34ff2c80ff0980ffff0bff3cff0bffff0bff34ff8080808080ff8080808080ffff010b80ff0180ff02ffff03ff17ffff01ff02ffff03ffff09ff47ffff0181e880ffff01ff02ffff03ffff09ffff02ff2effff04ff02ffff04ff81a7ff80808080ff0580ffff01ff02ff81a7ffff04ff0bffff04ff05ffff04ff820167ff8080808080ffff01ff088080ff0180ffff01ff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff37ff80808080808080ff0180ffff01ff04ffff04ff0bffff04ff05ff808080ffff01ff80808080ff0180ffff02ffff03ff05ffff01ff04ff09ffff02ff2affff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff02ff26ffff04ff02ffff04ffff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff17ff808080808080ffff04ff17ff8080808080ffffff04ff09ffff04ffff02ff2affff04ff02ffff04ff15ffff04ff0bff8080808080ff808080ff0bff3cffff0bff34ff2880ffff0bff3cffff0bff3cffff0bff34ff2c80ff0580ffff0bff3cffff02ff22ffff04ff02ffff04ff07ffff04ffff0bff34ff3480ff8080808080ffff0bff34ff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff02ffff03ff2bffff01ff02ffff03ffff09ff818bff3880ffff01ff02ffff03ffff18ff8202cbff3480ffff01ff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff4bff80808080808080ffff01ff04ff4bffff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff808080808080808080ff0180ffff01ff02ffff03ffff15ff818bff8080ffff01ff04ff4bffff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff8080808080808080ffff01ff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff8080808080808080ff018080ff0180ffff01ff02ffff03ff2fffff01ff04ffff04ff38ffff04ffff02ff36ffff04ff02ffff04ff05ffff04ff81afffff04ffff0bff34ff5380ffff04ffff02ff2effff04ff02ffff04ff23ff80808080ffff04ffff0bff34ff0580ff8080808080808080ffff04ff17ff8201ef808080ff8080ffff01ff088080ff018080ff0180ff018080ffff04ffff01a0dd8135d546e291df295b376aa89fc409c8c50d7f655d1ff4e845637901bc2f8fffff04ffff01ffff75ffc04468747470733a2f2f696d616765732e706578656c732e636f6d2f70686f746f732f31313035333037322f706578656c732d70686f746f2d31313035333037322e6a70656780ffff68a014836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb080ffff04ffff01a081970d352e6a39a241eaf8ca510a0e669e40d778ba612621c60a50ef6cf29c7bffff04ffff01ff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0a9e78ce31daf07c9bb35339201d7ba3c2dc79df506e9214565ebab8d6e1c9d32313f1522e7fdc95a4f04d9fa38675b8fff018080ff018080808080ff01808080",
"solution": "0xffffa0c2f3f7d54d254381fd33fbe2b6c031e5be3ba1267215a2fa182e064ed6015fefffa0f38367ca5d4dd82f5ec7f76777ac0647d4b7b1a3f97fdb683530317a04deab2fff0180ff01ffffff80ffff01ffff33ffa0d7be864587d6f4c11065856ae519d09f0d86b20e57d904f87c7c700d07c624d1ff01ffffa0d7be864587d6f4c11065856ae519d09f0d86b20e57d904f87c7c700d07c624d1808080ff8080ff01ff808080"
}
]
},
"success": true,
"wallet_id": 2
}
- Sync the wallet you just transferred the NFT to (whether it's on the same machine or a different one). After syncing is complete, run the
nft_get_nfts
rpc again to view the NFT in its new location:
(venv) $ chia rpc wallet nft_get_nfts '{"wallet_id": 2}'
{
"nft_list": [
{
"data_hash": "14836B86A48E1B2B5E857213AF97534704475B4C155D34B2CB83ED4B7CBA2BB0",
"data_uris": [
"https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"
],
"did_owner": "",
"edition_count": 1,
"edition_number": 1,
"launcher_id": "C2F3F7D54D254381FD33FBE2B6C031E5BE3BA1267215A2FA182E064ED6015FEF",
"license_hash": "",
"license_uris": [],
"metadata_hash": "",
"metadata_uris": [],
"nft_coin_id": "B5178AB54CD922889B4E97B2DDC0DD43FD85BE26F69DD3D697084C80AE4E9625",
"royalty": 0,
"version": "NFT0"
}
],
"success": true,
"wallet_id": 2
}
Add a URI to an NFT (RPC)
This section will show you how to add a new data URI to your NFT. Remember, NFTs contain a list of URIs. The current owner may add URIs as needed, but they may not be removed. This helps to obtain digital permanence while decreasing the likelihood of fraud from changing URIs.
- Run the
nft_add_uri
RPC using the following values:
wallet_id
: TheWallet ID
of the NFT to which to add a URInft_coin_id
: The ID of the NFT coin, obtained from thenft_get_nfts
RPCuri
: The new URI to add
(venv) $ chia rpc wallet nft_add_uri '{"wallet_id": 2, "nft_coin_id": "B5178AB54CD922889B4E97B2DDC0DD43FD85BE26F69DD3D697084C80AE4E9625", "uri": "https://newuri.net"}'
{
"spend_bundle": {
"aggregated_signature": "0xa5c7e75ad3c6d51ccaf6f9a77c11974b348ebdaa7dd172fc8203cecd1f21e8477f70917d112d6d89d12ef28a6813f56e1887c4200a10844cc55f8546f275902e140cb7f87e4fe321c32385fc8e0fb08617bc851c6b5418bf85a369129a8394ab",
"coin_solutions": [
{
"coin": {
"amount": 1,
"parent_coin_info": "0x4296d4e49e2056db5aeb62df849851e61326daea4337825be15410e7f4c07e32",
"puzzle_hash": "0xe9f6301cbb24aad305e56754c044bcc924ce04a28173381429d96920f4323bb1"
},
"puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ffff18ff2fff3c80ffff01ff04ffff04ff10ffff04ff2fff808080ffff04ffff02ff3effff04ff02ffff04ff05ffff04ffff0bff27ffff02ffff03ff77ffff01ff02ff36ffff04ff02ffff04ff09ffff04ff57ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ffff011d80ff0180ffff02ffff03ff77ffff0181b7ffff015780ff018080ffff04ff77ff808080808080ffff02ff26ffff04ff02ffff04ff05ffff04ffff02ff0bff5f80ffff01ff8080808080808080ffff01ff088080ff0180ffff04ffff01ffffff49ff4702ff33ff0401ffff01ff02ff02ffff03ff05ffff01ff02ff3affff04ff02ffff04ff0dffff04ffff0bff2affff0bff3cff2c80ffff0bff2affff0bff2affff0bff3cff1280ff0980ffff0bff2aff0bffff0bff3cff8080808080ff8080808080ffff010b80ff0180ffffff02ffff03ff0bffff01ff02ffff03ffff02ffff03ffff09ff23ff1480ffff01ff02ffff03ffff18ff81b3ff3c80ffff01ff0101ff8080ff0180ff8080ff0180ffff01ff02ffff03ffff20ff1780ffff01ff02ffff03ffff09ff81b3ffff01818f80ffff01ff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff3cff808080808080ffff01ff04ffff04ff23ffff04ffff02ff36ffff04ff02ffff04ff09ffff04ff53ffff04ffff02ff2effff04ff02ffff04ff05ff80808080ff808080808080ff738080ffff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff3cff8080808080808080ff0180ffff01ff088080ff0180ffff01ff04ff13ffff02ff26ffff04ff02ffff04ff05ffff04ff1bffff04ff17ff8080808080808080ff0180ffff01ff02ffff03ff17ff80ffff01ff088080ff018080ff0180ff0bff2affff0bff3cff3880ffff0bff2affff0bff2affff0bff3cff1280ff0580ffff0bff2affff02ff3affff04ff02ffff04ff07ffff04ffff0bff3cff3c80ff8080808080ffff0bff3cff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bff3cff058080ff0180ff02ffff03ffff21ff17ffff09ff0bff158080ffff01ff04ff28ffff04ff0bff808080ffff01ff088080ff0180ff018080ffff04ffff01ffa0f1e8350cec62f8204aaf867cc3c12cae369f619258206616108c6cfd7be760b3ffa0c2f3f7d54d254381fd33fbe2b6c031e5be3ba1267215a2fa182e064ed6015fefa0eff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9ffff04ffff01ff02ffff01ff02ffff01ff04ffff04ff10ffff04ff81bfff808080ffff02ff3effff04ff02ffff04ff05ffff04ffff02ff3affff04ff02ffff04ff17ffff04ff0bffff04ffff02ff2fff5f80ff808080808080ffff04ff81bfffff01ff8080808080808080ffff04ffff01ffffff49ff0233ffff0401ff0102ffffffff02ffff03ff05ffff01ff02ff22ffff04ff02ffff04ff0dffff04ffff0bff3cffff0bff34ff2480ffff0bff3cffff0bff3cffff0bff34ff2c80ff0980ffff0bff3cff0bffff0bff34ff8080808080ff8080808080ffff010b80ff0180ff02ffff03ff17ffff01ff02ffff03ffff09ff47ffff0181e880ffff01ff02ffff03ffff09ffff02ff2effff04ff02ffff04ff81a7ff80808080ff0580ffff01ff02ff81a7ffff04ff0bffff04ff05ffff04ff820167ff8080808080ffff01ff088080ff0180ffff01ff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff37ff80808080808080ff0180ffff01ff04ffff04ff0bffff04ff05ff808080ffff01ff80808080ff0180ffff02ffff03ff05ffff01ff04ff09ffff02ff2affff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff02ff26ffff04ff02ffff04ffff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff17ff808080808080ffff04ff17ff8080808080ffffff04ff09ffff04ffff02ff2affff04ff02ffff04ff15ffff04ff0bff8080808080ff808080ff0bff3cffff0bff34ff2880ffff0bff3cffff0bff3cffff0bff34ff2c80ff0580ffff0bff3cffff02ff22ffff04ff02ffff04ff07ffff04ffff0bff34ff3480ff8080808080ffff0bff34ff8080808080ffff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff2effff04ff02ffff04ff09ff80808080ffff02ff2effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff02ffff03ff2bffff01ff02ffff03ffff09ff818bff3880ffff01ff02ffff03ffff18ff8202cbff3480ffff01ff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff4bff80808080808080ffff01ff04ff4bffff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff808080808080808080ff0180ffff01ff02ffff03ffff15ff818bff8080ffff01ff04ff4bffff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff8080808080808080ffff01ff02ff3effff04ff02ffff04ff05ffff04ffff04ffff04ff23ffff04ff53ff808080ffff04ff6bff808080ffff04ff17ffff04ff2fff8080808080808080ff018080ff0180ffff01ff02ffff03ff2fffff01ff04ffff04ff38ffff04ffff02ff36ffff04ff02ffff04ff05ffff04ff81afffff04ffff0bff34ff5380ffff04ffff02ff2effff04ff02ffff04ff23ff80808080ffff04ffff0bff34ff0580ff8080808080808080ffff04ff17ff8201ef808080ff8080ffff01ff088080ff018080ff0180ff018080ffff04ffff01a0dd8135d546e291df295b376aa89fc409c8c50d7f655d1ff4e845637901bc2f8fffff04ffff01ffff75ffc04468747470733a2f2f696d616765732e706578656c732e636f6d2f70686f746f732f31313035333037322f706578656c732d70686f746f2d31313035333037322e6a70656780ffff68a014836b86a48e1b2b5e857213af97534704475b4c155d34b2cb83ed4b7cba2bb080ffff04ffff01a081970d352e6a39a241eaf8ca510a0e669e40d778ba612621c60a50ef6cf29c7bffff04ffff01ff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0ad2e4e7de145259166b19be05cbcea393c66cc436a631154a20a30e12dce380f00a0bc86c19490c409640bb76546b273ff018080ff018080808080ff01808080",
"solution": "0xffffa0eb46562a95a335f77b4d0d97458580674a10b210c849c1d01c06ec29d0bde8ccffa08e18568a642e3406dabf891aee9b4c1ace3e65daf15502a6b9ca7e1fa5f41a3fff0180ff01ffffff80ffff01ffff33ffa0d7be864587d6f4c11065856ae519d09f0d86b20e57d904f87c7c700d07c624d1ff01ffffa0d7be864587d6f4c11065856ae519d09f0d86b20e57d904f87c7c700d07c624d18080ffff81e8ffff02ffff01ff04ffff04ffff02ffff03ff17ffff01ff02ff02ffff04ff02ffff04ff05ffff04ff17ff8080808080ffff010580ff0180ffff04ff0bff808080ffff01ff808080ffff04ffff01ff02ffff03ff05ffff01ff02ffff03ffff09ff11ffff017580ffff01ff04ffff04ffff0175ffff04ff0bff198080ff0d80ffff01ff04ff09ffff02ff02ffff04ff02ffff04ff0dffff04ff0bff80808080808080ff0180ff8080ff0180ff018080ff9268747470733a2f2f6e65777572692e6e65748080ff8080ff01ff808080"
}
]
},
"success": true,
"wallet_id": 2
}
- Wait a few minutes for the change to be confirmed on the blockchain. Eventually, you'll see the new URI when you run the
nft_get_nfts
RPC:
(venv) $ chia rpc wallet nft_get_nfts '{"wallet_id": 2}'
{
"nft_list": [
{
"data_hash": "14836B86A48E1B2B5E857213AF97534704475B4C155D34B2CB83ED4B7CBA2BB0",
"data_uris": [
"https://newuri.net",
"https://images.pexels.com/photos/11053072/pexels-photo-11053072.jpeg"
],
"did_owner": "",
"edition_count": 1,
"edition_number": 1,
"launcher_id": "C2F3F7D54D254381FD33FBE2B6C031E5BE3BA1267215A2FA182E064ED6015FEF",
"license_hash": "",
"license_uris": [],
"metadata_hash": "",
"metadata_uris": [],
"nft_coin_id": "D7FEC386B6F4A886ED406CAB09A541F85D3313206DA73FACF92B5A45158E3EEF",
"royalty": 0,
"version": "NFT0"
}
],
"success": true,
"wallet_id": 2
}