### Example Description Array Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/common/Token-Project-Details_v1.md Example of an array of strings for the 'Description' field. ```string ["10,000 SpaceBudz are out there.","Where will your SpaceBudz take you?"] ``` -------------------------------- ### Enable CIP-95 Extension Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0095/README.md Example of how to enable the CIP-95 extension when connecting to a Cardano wallet. ```typescript cardano.{"wallet-name"}.enable({ extensions: [{ cip : 95 }]}) ``` -------------------------------- ### CIP-8 Signing Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0136/test-vector.md Example demonstrating how to perform signing using Cardano Serialization Library, relevant for CIP-8. ```javascript import { Address, StakeKey, Transaction, TxBuilder, Value } from "@emurgo/cardano-serialization-lib"; // ... (rest of the code from the example) // Example usage: // const signedTx = signTx(tx, privateKey); // console.log(signedTx); ``` -------------------------------- ### Observer Script Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0112/README.md An example of an observer script using a key hash for observation. ```json { "type": "observer", "keyHash": "OUR_OBSERVATION_SCRIPT_HASH" } ``` -------------------------------- ### Project Artist Name Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/common/Token-Project-Details_v1.md Example of a string value for the project or artist name field. ```string "Alessandro Konrad" ``` -------------------------------- ### Example Collection Name Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/common/Token-Project-Details_v1.md Example of a string value for the 'Collection Name' field. ```string "SpaceBudz" ``` -------------------------------- ### CIP-26 Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/0026/README.md A comprehensive example demonstrating the structure of CIP-26, including token identifiers and URI arrays. ```cbor { 26: { 0: 1, 1: [ { 0: [ h'd894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0', h'7370616365636f696e73' ], 1: "spacecoins", 2: [ "the OG Cardano community token", "-", "whatever you do, your did it!", "", "Learn more at https://spacecoins.io!" ], 3: "SPACE", 4: 0, 5: ["https://","spacecoins.io"], 6: [ "ipfs://", "bafkreib3e5u4am2btduu5s76rdznmqgmmrd4l6xf2vpi4vzldxe25fqapy" ], 7: [ [ "ipfs://", "bafkreibva6x6dwxqksmnozg44vpixja6jlhm2w7ueydkyk4lpxbowdbqly" ], "3507afe1daf05498d764dce55e8ba41e4acecd5bf42606ac2b8b7dc2eb0c305e" ], 8: [ h'd894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0', h'7370616365636f696e74' ] } ] } } ``` -------------------------------- ### Fungible Token Website Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/0026/README.md Example of a URI array representing the website for a fungible token. ```string ["https://","www.spacecoins.io"] ``` -------------------------------- ### Metadata Example: Legacy CIP-15 with Witness Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0036/test-vector.md Example of metadata including a witness, using the legacy CIP-15 format. ```javascript { "61284": { "1": "0x0036ef3e1f0d3f5989e2d155ea54bdb2a72c4c456ccb959af4c94868f473f5a0", "2": "0xe3cd2404c84de65f96918f18d5b445bcb933a7cda18eeded7945dd191e432369", "3": "0xe072b617657881e30ad17c46e4010c9cb3ebb2440653a34d32219c83e9", "4": 1234 }, "61285": { "1": "0xa9ec8735804c6c4c5c4a02e9589c65508ec7060063b2d7dbeba82d1cbfa1b8be6b457f95d4ead5e8b454b989624fa44e0b89a64d089fdc0a6a1268fef4876d0f" } } ``` -------------------------------- ### Complete Project Metadata Example (CBOR) Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/CIPs/common/Token-Project-Details_v1.md A comprehensive example demonstrating the structure of complete project metadata, including project name, description, URIs, and social media handles. ```cbor { 0: "Cool NFT Project", 1: [ "This is a description of my project", "longer than 64 characters so broken up into a string array" ], 2: [ "https://", "static.coolnftproject.io", "/images/icon.png" ], 3: [ "https://", "static.coolnftproject.io", "/images/banner1.jpg" ], 4: 0, 5: [ [ "twitter", [ "https://", "twitter.com/spacebudzNFT" ] ], [ "discord", [ "https://", "discord.gg/spacebudz" ] ] ], 6: "Virtua Metaverse" } ``` -------------------------------- ### Example Usage of getNetworkMagic() Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0142/README.md Demonstrates how a dApp can enable CIP-142 and use the `getNetworkMagic()` function to get the network identifier. ```APIDOC ## Example Usage ### Description This example shows how to enable the CIP-142 extension and call the `getNetworkMagic()` function to log the connected network's magic number. ### Code ```typescript async function getNetworkMagicNumber() { if (window.cardano && window.cardano.lace) { try { const api = await window.cardano.lace.enable({ extensions: [{ cip: 142 }] }); const magic = await api.cip142.getNetworkMagic(); console.log(`Connected to network with magic number: ${magic}`); return magic; } catch (error) { console.error("Error enabling wallet or getting network magic:", error); // Handle errors appropriately, e.g., display a message to the user return null; } } else { console.error("Lace wallet not detected or not enabled."); // Prompt user to install or enable Lace wallet return null; } } // Call the function to get the network magic number getNetworkMagicNumber(); ``` ``` -------------------------------- ### Get Datum by Hash Request Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md This is an example of a data hash used to query for a specific datum. The hash is a string representing the SHA-256 hash of the datum. ```string "58c9a67f503ff9d29c332ccda2d4eaf77a9288d43b01d967a0b61726c81cfe80" ``` -------------------------------- ### Get Transactions by Block Hash Request Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md This is an example of a block hash used to query for transactions within a specific block. Ensure the hash is correctly formatted. ```string "3f18df12b07c2f4c2393c43d24189d9d40e005cf66060e1473948d061c6b03ee" ``` -------------------------------- ### Get Native Script by Hash Request Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md This is an example of a script hash used to query for a specific Native script. The hash is a string representing the SHA-256 hash of the script. ```string "f02a5b9b9c750f691ed46f591b8170c3fd26f9d184ec8dd35bdba3c7" ``` -------------------------------- ### Example Repository Structure Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0001/README.md This illustrates the standard directory and file structure for a CIP. Each CIP is stored in a folder named after its number, with a README.md file and optional supporting files. ```bash CIP-0010 ├── README.md ├── registry.json └── registry.schema.json ``` -------------------------------- ### Get Plutus Script by Hash Request Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md This is an example of a script hash used to query for a specific Plutus script. The hash is a string representing the SHA-256 hash of the script. ```string "7ab2cf4ea16b2d5b8a71fd6c220e11fdb5f3484f043ca7d65fb385b3" ``` -------------------------------- ### Create a New CIP Repository Source: https://context7.com/cardano-foundation/cips/llms.txt Use these bash commands to initialize a new Cardano Improvement Proposal by copying the template and creating a new branch for your proposal. ```bash # 1. Create CIP from template mkdir CIP-my-proposal cp .github/CIP-TEMPLATE.md CIP-my-proposal/README.md ``` -------------------------------- ### Markdown Ordered List Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0120/README.md Illustrates the creation of an ordered list using numbers followed by a period and space. Each item must be separated by an empty line, and items should be in numerical order starting from one. ```markdown 1. This is the first item in my ordered list 2. this is the second item in my list 3. the third item ``` -------------------------------- ### Read Bit Examples Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0122/README.md Shows how to use the readBit function to extract a specific bit from a BuiltinByteString. Note that indexing fails for out-of-bounds or negative indices, and indexing starts from the least significant bit of the last byte. ```haskell readBit [] 0 => error ``` ```haskell readBit [] 345 => error ``` ```haskell readBit [] (-1) => error ``` ```haskell readBit [0xFF] (-1) => error ``` ```haskell readBit [0xF4] 0 => False ``` ```haskell readBit [0xF4] 1 => False ``` ```haskell readBit [0xF4] 2 => True ``` ```haskell readBit [0xF4] 3 => False ``` ```haskell readBit [0xF4] 4 => True ``` ```haskell readBit [0xF4] 5 => True ``` ```haskell readBit [0xF4] 6 => True ``` ```haskell readBit [0xF4] 7 => True ``` ```haskell readBit [0xF4] 8 => error ``` ```haskell readBit [0xFF, 0xF4] 16 => error ``` ```haskell readBit [0xF4, 0xFF] 10 => False ``` -------------------------------- ### Cardano URI Format Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0158/README.md Illustrates the standard URI format for launching applications via the `browse` authority, including versioning and the percent-encoded target URI. ```uri web+cardano://browse/?uri= ``` -------------------------------- ### Cardano URI Scheme Examples Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0107/README.md Examples demonstrating the new URI formats for blocks and transactions, including references by hash, height, and metadata. ```text web+cardano://block?hash=c6a8976125193dfae11551c5e80a217403d953c08ebbd69bba904d990854011f ``` ```text web+cardano://block?height=12345678890 ``` ```text web+cardano://transaction/7704a68404facf7126fa356f1b09f0e4c552aeef454cd0daba4208f3a64372e9 ``` ```text web+cardano://transaction/7704a68404facf7126fa356f1b09f0e4c552aeef454cd0daba4208f3a64372e9#1 ``` ```text web+cardano://transaction/7704a68404facf7126fa356f1b09f0e4c552aeef454cd0daba4208f3a64372e9/metadata ``` ```text web+cardano://transaction/d3616b772c91f118346e74863d1722810a4858e4d7cc7663dc2eed345d7bca72/metadata/674 ``` ```text web+cardano://transaction/self/metadata/1694 ``` -------------------------------- ### Get Transactions by Block Number Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md Retrieves all transactions contained within a specific block, identified by its block number. This is useful for analyzing the transactions that occurred within a particular block. The request example shows how to specify the block number. ```json "0" ``` -------------------------------- ### Build Cardano Specification with Nix Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0140/README.md Use this command to build the specification using Nix. Ensure Nix and flakes are installed and enabled. ```bash nix build --no-link ``` -------------------------------- ### Feature Set Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0088/README.md Example of a Feature Set, which is an array of unsigned integers representing applied CIP standards. This example includes CIPs 25 and 27. ```plaintext [25, 27] ``` -------------------------------- ### Example Attestation Message Calculation Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0026/README.md A concrete example of calculating the attestation message for the 'contact' property in the example metadata object. Public keys and signatures must be base16-encoded. ```javascript hash( hash(0x75613534303864306462306439343266643830333734) + // text "a5408d0db0d942fd80374" hash(0x67636F6E74616374) + // text "contact" hash(0x6A436964204B72616D6572) + // text "Cid Kramer" hash(0x00) // uint 0 ) // cd731afcc904c521e0c6b3cc0b560b8157ee29c3e41cd15f8dc8984edf600029 ``` -------------------------------- ### Cardano API Response Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md Example JSON response for a Cardano API query. ```json { "tag": "pubkey", "pubkey": "ca42e84ecfc9efd10bc10d42e22b22d2289c161cbdde6376415b5871" } ``` -------------------------------- ### Multisig Wallet Derivation Path Examples Source: https://github.com/cardano-foundation/cips/blob/master/CIP-1854/README.md Illustrative examples of HD derivation paths for multisig wallets, adhering to the specified structure and coin types. ```text m/1854’/1815’/0’/0/0 ``` ```text m/1854’/1815’/0’/2/14 ``` ```text m/1854’/1815’/0’/2/42 ``` ```text m/1854’/1815’/0’/0/1337 ``` -------------------------------- ### Example Tabular Metadata Update for NFTs Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0086/README.md An example demonstrating how to apply updates to multiple metadata fields for several NFT assets using the tabular format. ```json { "86": { "tabular_metadata_update": { "": { "field_paths": [ "age", "stats.acceleration", "stats.agility", "stats.endurance", "stats.speed", "stats.stamina" ], "token_names": [ "EquinePioneerHorse00000", "EquinePioneerHorse00012", "EquinePioneerHorse00315", "EquinePioneerHorse01040", "EquinePioneerHorse09175" ], "values": [ [3,34,16,18,51,33], [2,24,48,12,32,18], [3,33,34,41,14,31], [4,19,22,21,21,50], [1,24,11,36,22,14] ] } } } } ``` -------------------------------- ### Multisignature Payment Script Example Source: https://github.com/cardano-foundation/cips/blob/master/CIP-1854/README.md This example demonstrates a simple multisignature script requiring signatures from both Alice and Bob. Wallets should initialize to present identical addresses associated with specific derivation paths for each cosigner. ```plaintext ALL-OF (SIGNATURE alice) (SIGNATURE bob) ``` -------------------------------- ### UTxO Response by Asset Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0139/endpoints.md Example response for retrieving UTxOs by asset. Shows UTxO input and output details. ```json { "utxos": [ { "input": { "transaction_id": "eca40340fa6e65d964915ba4bc8bd811a0493d263ffe95875291114cbb2d0686", "index": 4201022945 }, "output": { "address": "stake1vpu5vlrf4xkxv2qpwngf6cjhtw542ayty80v8dyr49rf5egfu2p0u", "amount": { "coin": "0" } } }, { "input": { "transaction_id": "eca40340fa6e65d964915ba4bc8bd811a0493d263ffe95875291114cbb2d0686", "index": 1609920239 }, "output": { "address": "37btjrVyb4KDXBNC4haBVPCrro8AQPHwvCMp3RFhhSVWwfFmZ6wwzSK6JK1hY6wHNmtrpTf1kdbva8TCneM2YsiXT7mrzT21EacHnPpz5YyUdj64na", "amount": { "coin": "0" } } } ] } ``` -------------------------------- ### Token Claim URI Examples Source: https://github.com/cardano-foundation/cips/blob/master/CIP-0099/README.md These examples demonstrate the structure of token claim URIs for distributing assets. Ensure all arguments are URL-encoded. ```html Claim $HOSKY ``` ```html Claim $HOSKY ``` ```html Claim NFTxLV Commermorative NFT! ```