Parallel Universe
  • Learn
    • Introduction to PUT
    • Getting started with PUT
  • Architecture
    • What is a PUT Cluster?
    • Clusters
      • PUT Clusters
      • RPC Endpoints
      • Benchmark a Cluster
      • Performance Metrics
    • Consensus
      • Synchronization
      • Leader Rotation
      • Fork Generation
      • Managing Forks
      • Turbine Block Propagation
      • Commitment Status
      • Secure Vote Signing
      • Stake Delegation and Rewards
    • Validators
      • Overview
      • TPU
      • TVU
      • Blockstore
      • Gossip Service
      • The Runtime
  • CLI
    • Command-line Guide
    • Install the PUT Tool Suite
    • Command-line Wallets
      • Command Line Wallets
      • Paper Wallet
      • File System Wallet
      • Support / Troubleshooting
    • Using PUT CLI
    • Connecting to a Cluster
    • Send and Receive Tokens
    • Staking
    • Deploy a Program
    • Offline Transaction Signing
    • Durable Transaction Nonces
    • CLI Usage Reference
  • Developers
    • Get Started
      • Hello World
      • Local development
      • Rust program
    • Core Concepts
      • Accounts
      • Transactions
        • Overview
        • Versioned Transactions
        • Address Lookup Tables
      • Programs
      • Rent
      • Calling between programs
      • Runtime
    • Clients
      • JSON RPC API -1
      • JSON RPC API -2
      • JSON RPC API -3
      • Web3 JavaScript API
      • Web3 API Reference
      • Rust API
    • Writing Programs
      • Overview
      • Developing with Rust
      • Deploying
      • Debugging
      • Program Examples
      • FAQ
    • Native Programs
      • Overview
      • Sysvar Cluster Data
    • Local Development
      • PUT Test Validator
    • Backward Compatibility Policy
  • Validators
    • Running a Validator
    • Getting Started
      • Validator Requirements
    • Voting Setup
      • Starting a Validator
      • Vote Account Management
      • Staking
      • Monitoring a Validator
      • Publishing Validator Info
      • Failover Setup
      • Troubleshooting
    • Geyser
      • Geyser Plugins
  • Staking
    • Staking on PUT
    • Stake Account Structure
  • Integrations
    • Add PUT to Your Exchange
    • Retrying Transactions
  • Library
    • Introduction
    • Token Program
    • Associated Token Account Program
    • Memo Program
    • Name Service
    • Feature Proposal Program
    • NFT Program
      • Overview
      • Interface
      • Usage Guidelines
        • Create a new NFT-Mint
        • Cast NFT
        • Transfer an NFT
        • Change account status
        • Permission settings
        • Query Interface
        • Continuous casting
        • Change the Mint attribute
      • Operation Overview
        • Create a new NFT-Mint
        • Transfer NFT
        • Destroy
        • Freeze NFT accounts
        • Update
    • PUT multi-sign program
      • Overview
      • Interface
      • Usage Guidelines
        • Create a multi-signature account
        • Create a proposal account
        • Vote proposal
        • Verify Proposal
        • Add-singer
        • Remove-signer
      • Operation Overview
        • Create a multi-signature account
        • Create a proposal account
        • Vote
        • Verify
        • Add-singer
        • Remove-signer
  • PUT Privacy Policy
Powered by GitBook
On this page
  1. Library
  2. NFT Program
  3. Usage Guidelines

Change account status

In order to cope with the theft of the user's private key, we provide a freeze function for NFT accounts.

Mint accounts can initiate a freeze operation on the NFT account, but the frozen NFT account can not perform transfer, close and other operations.

In addition, users can also use burn instruction to destroy their own NFT, but the destruction is irreversible!

Freeze the NFT account.

$ ppl-nft freeze --address 62Tt6NNUxQbBYx6x5P1s42t7
KWQdDamn9ATb6Ls5HYVv

freezing a nft 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
freeze nft: 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
Signature: 4QMDpudrM916x5rt28XPvVwtGhANtcNarcVJ3WvpjzSHVnkezCGuRX8Q8remYcTaFyNP6iJBUDS3ZVTkCgrZkrRM

Afterwards, check the NFT account information again:

./ppl-nft nft-info 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
Mint : 2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7XQg9aug6uKs
Owner: DySd8hi7Z4jrV3ixAk5dT1kPJQzKMiUyyCF38DiJypLY
State: Frozen
Token id: 1
Token url: http://my.asset.uri.path
Close authority: None

The status of the NFT account has changed to Frozen, then the account transfer operation will not be allowed:

$ ppl-nft transfer --from ./id.json --nft 62Tt6NNUxQbBYx6x5P1s42
t7KWQdDamn9ATb6Ls5HYVv --recipient 97pqCNMq4NUBVa6DSabNi
RPQAbtM8ixEDvXYWQCPLxBi
transfer the nft 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv from DySd8hi7Z4jrV3ixAk5dT1kPJQzKMiUyyCF38DiJypLY to 97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
program_id An2DRyUtGBKYioLhHJEQ3nPcGgzzRJQ8vgdhyjdtC14H
[2022-07-13T05:03:05.615165632Z DEBUG put_client::nonblocking
::rpc_client]   1: Program An2DRyUtGBKYioLhHJEQ3nPcGgzzRJQ8vgdhyjdtC14H invoke [1]
[2022-07-13T05:03:05.615180822Z DEBUG put_client::nonblocking::
rpc_client]   2: Program log: Instruction: Transfer
[2022-07-13T05:03:05.615194402Z DEBUG put_client::nonblocking::
rpc_client]   3: Program log: Error: Account is frozen
[2022-07-13T05:03:05.615208652Z DEBUG put_client::nonblocking::
rpc_client]   4: Program An2DRyUtGBKYioLhHJEQ3nPcGgzzRJQ8vgdhyjdtC14H consumed 2916 of 1400000 compute units
[2022-07-13T05:03:05.615223822Z DEBUG put_client::nonblocking::rpc_client]   5: Program An2DRyUtGBKYioLhHJEQ3nPcGgzzRJQ8vgdhyjdtC14H
 failed: custom program error: 0x11
[2022-07-13T05:03:05.615238842Z DEBUG put_client::nonblocking::
rpc_client] Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x11 [5 log messages]

The final transaction execution is failed and an error is reported.

The third error message indicates that Account is Frozen, corresponding to error 0x11, so it is confirmed that the freeze operation has successfully frozen the NFT account. In response to the freeze operation, you can use the thaw instruction to thaw the program.

$ ppl-nft thaw --address 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn
9ATb6Ls5HYVv
thawing a nft 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
thaw nft:  62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
Signature: 5Y2AuwhznFW5HCTz6oc4ReiSFjNC9pbyco5jSgaUjS6EXWSH7ogT676C1ddX4r9qtKpR6kHBnf6WUzPRHP9Nj1tL

After thawing, the account status will be restored to normal and the transfer operation will be successfully supported:

$ ppl-nft transfer --from ./id.json --nft 62Tt6NNUxQbBYx6x5P1
s42t7KWQdDamn9ATb6Ls5HYVv 
--recipient 97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
transfer the nft 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv from DySd8hi7Z4jrV3ixAk5dT1kPJQzKMiUyyCF38DiJypLY to 97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
program_id An2DRyUtGBKYioLhHJEQ3nPcGgzzRJQ8vgdhyjdtC14H

sender:  DySd8hi7Z4jrV3ixAk5dT1kPJQzKMiUyyCF38DiJypLY
recipient:  97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
nft:  62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv

Signature: GDGHMxS7KLWn2ikqKJHBBZaUXRye6duKFDTg52v7cbpBbdPdVMUuSk2hjdHZBoaz6oaL3aCRFeJvhShmFJNY3se

The Burn operation is executed in the NFT account.

You need to be cautious when using this instruction, because this irreversible operation will destroy the NFT you own:

$ ppl-nft burn --address 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn
9ATb6Ls5HYVv --auth-keypair /root/.config/put/id2.json
burning a nft 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
burn nft:  62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
Signature: 57NRhFzSi55aCRSV14YYR8iHAdNwYezu2FidHsFnGNqXqT4erRfEmapbQ3G4SWTLnjUzqBvE7WtVChqkizpj7MRS

Re-check NFT information after account destruction.

$ ppl-nft nft-info 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv
Error: ClientError { request: None, kind: RpcError(ForUser("AccountNotFound: pubkey=62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv")) }

You can see that the lookup failed and reported the error: AccountNotFound, which indicates that the NFT account has been destroyed.

Note:

The freeze instruction requires the freeze authority permission, and the burn instruction requires the close authority permission, which can be viewed by the mint-info instruction and nft-info instruction respectively.

If the corresponding permission is set to None, it will default to the account owner address.

PreviousTransfer an NFTNextPermission settings

Last updated 2 years ago