### Build Aleo NFT Program Source: https://github.com/demox-labs/aleo-nft/blob/main/README.md This command compiles the Aleo NFT program. Ensure you are in the './nft' directory before execution. No external dependencies are required beyond the Aleo SDK. ```bash cd ./nft aleo build ``` -------------------------------- ### Build Aleo Programs (V1 and V2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Compiles the Aleo NFT programs for both V1 and V2 using the Aleo CLI. Each version has its own directory and independent build configuration. ```bash # Build v1 (rank-based tree system) cd nft aleo build # Build v2 (simplified with public/private conversion) cd nft_v2 aleo build ``` -------------------------------- ### Initialize Aleo NFT Data Source: https://context7.com/demox-labs/aleo-nft/llms.txt Loads Arweave transaction IDs into global state mappings to enable NFT minting. This function is restricted to the collection owner and increments the available supply for a specific NFT image. It creates an NFT data struct, hashes it using bhp256, and updates a counter. ```bash cd nft aleo run initialize 3u128 7u128 aleo run initialize 13u128 1u128 ``` -------------------------------- ### Transfer NFT (V1) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Transfers an NFT to a new owner using the V1 implementation. This command executes the 'transfer' program, taking the current owner's details and the new owner's address as input. The output is a new NFT record with the updated owner, preserving other fields. ```bash cd nft aleo run transfer '{ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, gates: 0u64.private, rank: 6u8.private, remaining: 2u8.private, data1: 3u128.private, data2: 7u128.private, _nonce: 1700985124319758542136781077875397883667997810952789373247295650239946998473group.public }' aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt ``` -------------------------------- ### Initialize Aleo NFT Global State Source: https://github.com/demox-labs/aleo-nft/blob/main/README.md Initializes the global state for the Aleo NFT collection by loading Arweave transaction IDs. This step is crucial for limiting the total supply of NFTs. Inputs are Arweave transaction IDs represented as unsigned 128-bit integers. ```bash aleo run initialize 3u128 7u128 aleo run initialize 13u128 1u128 ``` -------------------------------- ### Mint NFT (v1 and v2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Enables NFT minting. In v1, existing NFT holders mint new NFTs, consuming a 'remaining' count and decreasing the rank for the child NFT. In v2, anyone can mint directly without a parent NFT. The v1 mint function takes a parent NFT record and outputs updated parent and new child NFT records. The v2 mint function directly mints to a specified address. ```bash # V1: Mint from existing NFT to new owner cd nft aleo run mint '{ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, gates: 0u64.private, rank: 6u8.private, remaining: 3u8.private, data1: 3u128.private, data2: 7u128.private, _nonce: 2546588301349859963165576196445211638510724205660741519656114746669343010757group.public }' aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt 13u128 1u128 # V2: Direct mint to any address cd nft_v2 aleo run mint aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt 13u128 1u128 ``` -------------------------------- ### Premint Root NFT (v1) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Mints root-level NFTs for the collection's tree structure. Only the collection owner can perform this action, creating NFTs with maximum rank (6) and full minting capacity (3 remaining mints). The function validates ownership, creates a private NFT record, decrements the total supply for the given data hash, and returns the NFT. ```bash cd nft aleo run premint aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn 3u128 7u128 ``` -------------------------------- ### Mint New NFT Source: https://github.com/demox-labs/aleo-nft/blob/main/README.md Mints a new NFT to a specified owner, provided the minter possesses an NFT and has remaining minting rights. This function takes the minter's NFT record and the new owner's Aleo address as input, along with two unsigned 128-bit integers for Arweave transaction IDs. ```bash aleo run mint '{ \ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, \ gates: 0u64.private, \ rank: 6u8.private, \ remaining: 3u8.private, \ data1: 3u128.private, \ data2: 7u128.private, \ _nonce: 2546588301349859963165576196445211638510724205660741519656114746669343010757group.public \ }' aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt 13u128 1u128 ``` -------------------------------- ### Premint Root NFT Source: https://github.com/demox-labs/aleo-nft/blob/main/README.md Allows a specific address to mint the root NFT of the collection's minting tree, bypassing the need for an existing NFT. This function requires the recipient's Aleo address and two unsigned 128-bit integers representing Arweave transaction IDs. ```bash aleo run premint aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn 3u128 7u128 ``` -------------------------------- ### Transfer NFT Private (V2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Performs a private NFT transfer using the V2 implementation. This command executes the 'transfer_private' program, allowing for the inclusion of a 'symbol' field. It validates that the caller is the current owner before execution. ```bash cd nft_v2 aleo run transfer_private '{ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, gates: 0u64.private, symbol: 86795840032555669230657698889553936384u128.private, data1: 3u128.private, data2: 7u128.private, _nonce: }' aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt ``` -------------------------------- ### Convert Public NFT to Private (V2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Converts public NFT ownership back into a private record in V2. This operation decrements the owner's public data mappings and creates a new private NFT. Note: The current implementation requires manual assertion checks for security. ```bash cd nft_v2 aleo run convert_public_to_private 3u128 7u128 ``` -------------------------------- ### NFT Supply Control Source: https://context7.com/demox-labs/aleo-nft/llms.txt Details how NFT supply is controlled in V1 and V2 of the Aleo NFT project. V1 has a fixed maximum supply calculated from 'remaining' and 'rank', while V2's supply is managed through 'initialize' function calls. ```bash # Supply control # V1: Max supply = remaining^rank = 3^6 = 729 NFTs # V2: Max supply controlled by initialize function calls ``` -------------------------------- ### Convert Private NFT to Public (V2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Converts a private NFT record to public ownership in V2. This process consumes the private record and updates on-chain mappings for public visibility. It includes validation to ensure the caller is the NFT owner. ```bash cd nft_v2 aleo run convert_private_to_public '{ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, gates: 0u64.private, symbol: 86795840032555669230657698889553936384u128.private, data1: 3u128.private, data2: 7u128.private, _nonce: }' ``` -------------------------------- ### Transfer NFT Source: https://github.com/demox-labs/aleo-nft/blob/main/README.md Transfers an existing NFT to a new owner. This function requires the sender's NFT record as input, along with the recipient's Aleo address. The sender's NFT will have its 'remaining' count decremented. ```bash aleo run transfer '{ \ owner: aleo1y9mnptjc23wxtnr6gnjac0efu4fq859dsjk8mmryj3rg0feq0qzs8awmhn.private, \ gates: 0u64.private, \ rank: 6u8.private, \ remaining: 2u8.private, \ data1: 3u128.private, \ data2: 7u128.private, \ _nonce: 1700985124319758542136781077875397883667997810952789373247295650239946998473group.public \ }' aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt ``` -------------------------------- ### Transfer Public NFT (V2) Source: https://context7.com/demox-labs/aleo-nft/llms.txt Transfers public NFT ownership between addresses in V2 by updating on-chain mappings. This atomically decrements the sender's data values and increments the recipient's data values. Security assertions are recommended for full safety. ```bash cd nft_v2 aleo run transfer_public aleo17xy970uqxfjekll5zw6mtqz90pmsewe3u3a2lf4feng0uqxfjekll5zw6mtqz90pmsewe3u3a2lf4tg8mc0wpt3sqq3psxyt 3u128 7u128 ``` -------------------------------- ### Transfer NFT Ownership Source: https://context7.com/demox-labs/aleo-nft/llms.txt Transfers NFT ownership to a new address while preserving all NFT attributes, including rank, remaining mints, and Arweave data references. This functionality is available for both private and public ownership scenarios. ```bash # This function is described but no code example is provided in the source text. ``` -------------------------------- ### NFT Data Structure Encoding Source: https://context7.com/demox-labs/aleo-nft/llms.txt Illustrates the encoding of Arweave transaction IDs and symbols within Aleo NFT records. Arweave transaction IDs are split into two u128 values, representing a SHA-256 signature. The symbol field in V2 stores ASCII-encoded collection identifiers. ```bash # Arweave Transaction ID encoding # Full SHA-256 signature (256 bits) split into: # - data1: First 128 bits (u128) # - data2: Second 128 bits (u128) # Example: data1=3, data2=7 represents partial Arweave TX ID # Symbol encoding (v2) # "ALEO" symbol = 86795840032555669230657698889553936384u128 # ASCII characters encoded in 16 bytes (128 bits) # Format: Each character occupies 8 bits, padded with zeros ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.