CARV 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 21쪽 중 2쪽

irmed ``` # Reading from CARV SVM Network Let’s dive into how data operates on the CARV SVM Network. On CARV SVM, all data is organized within accounts—unique containers that store either data or program code. This guide will walk you through understanding and accessing the various types of accounts. ## **Read a Basic Account** Let’s start with the simplest type of account on the CARV SVM Chain—your wallet. Open the following example and connect to the CARV SVM Chain using the RPC endpoint <https://rpc.testnet.carv.io/rpc>: ```javascript // Connect to CARV SVM Chain's RPC endpointconst rpcUrl = "https://rpc.testnet.carv.io/rpc"; const connection = new pg.Connection(rpcUrl); // Get your wallet's public key - this is your account's addressconst address = pg.wallet.publicKey; // Fetch the account's information from the networkconst accountInfo = await connection.getAccountInfo(address); // Display the account's detailsconsole.log("Your Wallet Account Info:"); console.log("======================"); console.log("Address:", address.toBase58()); console.log("Balance:", accountInfo.lamports / 1000000000, "SOL"); console.log("Owner:", accountInfo.owner.toBase58()); console.log("Executable:", accountInfo.executable); console.log("Data length:", accountInfo.data.length); // Set up a listener for account changesconsole.log("\nWatching for balance changes..."); const subscriptionId = connection.onAccountChange( address,(updatedInfo, context) => {console.log("\nBalance updated!");console.log("New balance:", updatedInfo.lamports / 1000000000, "SOL"); } ); ``` Example Output: ```yaml Your Wallet Account Info: ====================== Address: ATxydRH5uT8xivYQGH7e6KgFNkPvEn7UKMmABtFpgNkz Balance: 1 SOL Owner: 11111111111111111111111111111111Executable: falseData length: 0 ``` Understanding the Output: * Address: Your unique identifier on the CARV SVM Chain. * Balance: Displays holdings in SOL (1 SOL = 1,000,000,000 lamports). * Owner: All `1`s represent the System Program, which manages basic accounts. * Executable: `false` indicates this account stores data, not code. * Data length: `0` is standard for accounts holding only SOL balances. ## **Explore Token Accounts** Now, let’s examine token accounts on the CARV SVM Chain: ```javascript import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; // Fetch information about the Token Programconsole.log("Token Program Info:"); console.log("================="); const tokenProgramInfo = await connection.getAccountInfo(TOKEN_PROGRAM_ID); console.log("Is executable:", tokenProgramInfo.executable); console.log("Data length:", tokenProgramInfo.data.length); // Fetch all token accounts owned by your walletconsole.log("\nYour Token Accounts:"); console.log("=================="); const tokenAccounts = await connection.getTokenAccountsByOwner( pg.wallet.publicKey, { programId: TOKEN_PROGRAM_ID } ); if (tokenAccounts.value.length === 0) {console.log("No token accounts found - try creating one first!"); } else { tokenAccounts.value.forEach((account, i) => {console.log(`\nToken Account ${i + 1}:`);console.log("Address:", account.pubkey.toBase58());console.log("Data size:", account.account.data.length); }); } ``` Example Output: ```yaml Token Program Info: ================= Is executable: true Data length: 133352 Your Token Accounts: ================== No token accounts found - try creating one first! ``` Understanding the Output: * Token Program: * Is executable: `true` because it contains the program code. * Data length: Indicates the size of program instructions. * Token Accounts: * Lists all token accounts owned by your wallet. * If none are found, you'll need to create one first. *** **Find Program Accounts** You can also query all accounts owned by a specific program on the CARV SVM Chain: ```javascript import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; import { PublicKey } from "@solana/web3.js"; async function scanProgramAccounts(programId) { console.log(`Scanning accounts owned by program: ${programId.toString()}`); console.log("=========================================="); const accounts = await connection.getProgramAccounts(programId, { dataSlice: { offset: 0, length: 0 }, filters: [] }); console.log(`Found ${accounts.length} accounts\n`); accounts.slice(0, 5).forEach((account, i) => { console.log(`Account ${i + 1}:`); console.log("Address:", account.pubkey.toBase58()); console.log("Balance:", account.account.lamports / 1000000000, "SOL"); console.log("Data length:", account.account.data.length); console.log("-------------------"); }); } // Look at Token Program accountsawait scanProgramAccounts(TOKEN_PROGRAM_ID); ``` Example Output: * Accounts Owned: Displays the number of accounts a program owns. * Account Details: Shows their addresses, balances, and data sizes. *** **Monitor Network Activity** Real-time monitoring is essential for responsive applications. Use the following code to track changes in account balances and transactions: ```javascript console.log("Starting transaction and account monitoring..."); console.log("============================================"); // Watch for account balance changes const accountSub = connection.onAccountChange( pg.wallet.publicKey, (accountInfo, context) => { console.log("\nAccount Updated!"); console.log("New balance:", accountInfo.lamports / 1000000000, "SOL"); console.log("Slot:", context.slot); } ); // Watch for transaction confirmations const signatureSub = connection.onSignature( await connection.requestAirdrop(pg.wallet.publicKey, 1000000000), (signatureResult, context) => { console.log("\nTransaction Confirmed!"); console.log("Signature:", signatureResult); console.log("Slot:", context.slot); } ); console.log("Monitoring active - try requesting an airdrop to see updates!"); ``` Example Output: * Real-time balance updates when account changes occur. * Transaction confirmations with signature and slot details. *** **Next Steps** Now that you understand how to read and monitor accounts on the CARV SVM Chain, you're ready to explore writing data through transactions. Continue to the next section to start deploying your own projects on the network. # Writing to the Network Now that we understand how to read data from the CARV SVM Chain, let’s learn how to write data. On CARV SVM Chain, transactions consist of instructions—just like on Solana—but they benefit from CARV’s Layer 2 architecture. This architecture offers faster finality, lower costs, and seamless integration with Ethereum’s security guarantees.&#x20; Let’s explore a common operation: transferring SOL, to understand how transactions work on CARV SVM Chain. ## **Transfer SOL** To perform a simple transfer of SOL from one account to another, we invoke the `transfer` instruction on the System Program. Here’s how you can do it: ```javascript import { LAMPORTS_PER_SOL, SystemProgram, Transaction, sendAndConfirmTransaction, Keypair, } from "@solana/web3.js"; // Connect to CARV SVM Chain's RPC endpointconst rpcUrl = "https://rpc.testnet.carv.io/rpc"; const connection = new pg.Connection(rpcUrl); // Get sender's keypair from the playground wallet const sender = pg.wallet.keypair; // Generate a new keypair for the receiver const receiver = new Keypair(); // Create the transfer instruction const transferInstruction = SystemProgram.transfer({ fromPubkey: sender.publicKey, toPubkey: receiver.publicKey, lamports: 0.01 * LAMPORTS_PER_SOL, // Transfer 0.01 SOL }); // Add the instruction to a new transaction const transaction = new Transaction().add(transferInstruction); // Send and confirm the transaction const transactionSignature = await sendAndConfirmTransaction( connection, transaction, [sender] ); // Log the transaction URL using CARV’s explorer console.log("Transaction Signature:",`https://explorer.ops.soo.network/?cluster=custom&customUrl=https%3A%2F%2Frpc.carv.testnet.soo.network%2Frpc%2Fcarv-McPrlbfMcW0ggpkvr07Tjs2YfviwpHaI/${transactionSignature}`); ``` Key Concepts: * Creating Instructions: Specifies what the transaction will do (e.g., transfer funds). * Building Transactions: Combines one or more instructions. * Sending and Confirming: Executes the transaction and verifies its success. * Explorer Integration: Links to CARV’s explorer for transaction details. When you run this code, you’ll see a transaction signature and a link to view it in CARV’s explorer. Clicking the link provides transaction details, including the fast confirmation enabled by CARV SVM Chain. # Network Info ## **Mainnet** Coming soon ## **Testnet** | | | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Testnet RPC Node | <https://rpc.testnet.carv.io/rpc> | | Testnet Bridge | <https://bridge.testnet.carv.io> | | Testnet Explorer | <https://explorer.testnet.carv.io/> | | Ethereum Sepolia Testnet Faucet | <p><a href="https://faucet.soo.network/"><https://faucet.soo.network/></a><br><a href="https://www.alchemy.com/faucets/ethereum-sepolia"><https://www.alchemy.com/faucets/ethereum-sepolia></a><br><a href="https://cloud.google.com/application/web3/faucet/ethereum/sepolia"><https://cloud.google.com/application/web3/faucet/ethereum/sepolia></a></p> | # Introduction The fusion of Artificial General Intelligence (AGI) and blockchain presents an extraordinary opportunity—but also a profound challenge. AGI, to truly transcend the boundaries of isolated intelligence, requires more than raw processing power; it demands access to meaningful, secure, and actionable data.&#x20; ***The D.A.T.A Framework is designed to empower AI agents with seamless access to high-quality on-chain and off-chain data, enabling them to make better-informed, autonomous decisions in decentralized ecosystems.*** This framework is more than just a data provider; it equips AI agents with the ability to perceive and interact with data in meaningful ways. Through the D.A.T.A Framework, AI agents can access enriched insights, including blockchain activity, user profiles, transaction histories, and advanced metrics—allowing them to evolve and adapt intelligently. At its core, D.A.T.A represents a pioneering implementation of **DeepSeek's** revolutionary reasoning-first approach to AI autonomy. As the first framework to integrate DeepSeek's breakthrough self-evolving reasoning capabilities in a Web3 context, D.A.T.A enables AI agents to develop sophisticated cognitive processes that mirror human-like reasoning patterns. This integration allows agents to not just process data, but to understand it through multi-step analysis, verify their own conclusions, and adapt their decision-making strategies based on outcomes. > Enter **D.A.T.A.**—the **Data Authentication, Trust, and Attestation** framework, a revolutionary system purpose-built to tackle the data problem at the heart of this transformative union. For **developers**, D.A.T.A. transforms static data into dynamic, actionable insights, empowering them to build smarter, more autonomous AI systems that require minimal human intervention. Whether creating trading bots that respond instantly to on-chain events or AI agents capable of executing autonomous strategies, developers benefit from enriched data pipelines and tools that enhance both performance and reliability. For the **blockchain ecosystem**, D.A.T.A. bridges on-chain and off-chain data seamlessly, enabling AI agents to make intelligent, cross-chain decisions and interact meaningfully within decentralized networks. This agentic infrastructure decentralizes trust, making it easier for blockchain participants to collaborate on projects that require secure, real-time data exchange. End-users and businesses also stand to gain. By solving the long-standing challenge of fragmented, inaccessible, and untrustworthy data, D.A.T.A. enables **end-users** to securely control and monetize their data. Simultaneously, **businesses** benefit from access to high-quality, actionable insights tailored to their needs—whether for personalizing services or optimizing operations—without compromising privacy. For **AI researchers and innovators**, D.A.T.A. is a game-changer. It empowers AGI to evolve collaboratively within a decentralized ecosystem, much like humans evolved through shared experiences and adaptation. Researchers can now explore decentralized AI innovations that push the boundaries of what intelligent systems can achieve, unlocking new avenues for collaboration and discovery. By addressing data fragmentation, inefficiency, and lack of trust, D.A.T.A. redefines how AGI interacts with the world. Through its ability to leverage enriched data, provide advanced privacy guarantees, and support cross-chain interoperability, D.A.T.A. is not just a framework—it’s the foundation for a new era of AI-driven intelligence, one where all stakeholders can thrive in a truly interconnected ecosystem. # DeepSeek Integration ### Overview The D.A.T.A framework stands at the forefront of AI innovation by being the first to implement DeepSeek's revolutionary reasoning-first approach in a Web3 context. DeepSeek, renowned for its breakthrough achievements in mathematical reasoning, coding, and complex problem-solving, brings a new dimension to autonomous AI systems through its sophisticated cognitive architecture. ### Key DeepSeek Capabilities #### 1. Chain-of-Thought Processing DeepSeek's chain-of-thought mechanism enables AI agents to: * Generate detailed reasoning steps before taking actions * Break down complex problems into manageable components * Consider multiple solution paths simultaneously * Validate conclusions through step-by-step verification #### 2. Self-Evolving Reasoning The framework leverages DeepSeek's unique ability to: * Develop reasoning patterns through reinforcement learning * Adapt strategies based on interaction outcomes * Generate and evaluate multiple solution approaches * Learn from past decisions to improve future performance #### 3. Mathematical and Logical Reasoning D.A.T.A incorporates DeepSeek's proven capabilities in: * Complex mathematical problem-solving * Algorithmic thinking and optimization * Logical deduction and inference * Pattern recognition and analysis # D.A.T.A's Core Features ### Key Innovation At its core, D.A.T.A is the first AI agent framework that truly aligns incentives between artificial intelligence and human users through native token mechanics. Unlike traditional AI frameworks that operate in isolation from economic systems, D.A.T.A agents can: * Control their own wallet infrastructure * Create and manage digital assets * Access both on-chain and off-chain data through CARV integration * Identify and verify user token holdings * Adjust interaction patterns based on token-driven trust metrics This economic awareness enables D.A.T.A agents to make informed decisions that benefit both individual users and the broader ecosystem, creating a self-reinforcing cycle of value creation and trust building. ### DeepSeek Integration D.A.T.A innovatively incorporates DeepSeek's reasoning-centric methodology through: 1. **Chain-of-Thought Processing**: Implements DeepSeek's sophisticated reasoning patterns that enable the agent to: * Generate detailed thought processes before taking actions * Perform self-verification of decisions * Consider multiple approaches to problem-solving * Validate conclusions through step-by-step analysis 2. **Cognitive Architecture**: Adopts DeepSeek's cognitive model featuring: * Advanced prompt engineering techniques * Multi-stage reasoning pipelines * Self-reflection mechanisms * Iterative refinement of solutions 3. **Autonomous Decision Making**: Leverages DeepSeek's reinforcement learning approach to: * Develop reasoning capabilities through self-evolution * Generate and evaluate multiple solution paths * Learn from interaction outcomes * Improve decision quality over time *** **CARV ID Integration** The D.A.T.A Framework seamlessly integrates **CARV ID**, built on the ERC-7231 standard, to unify users' Web2 identities with their Web3 activities. This cross-domain integration enhances AI agents’ ability to contextualize user behavior and interactions. **Key Features**: * **Web2 and Web3 Linkage**: Connects social media accounts (e.g., Twitter) with blockchain addresses, offering a complete view of user activity. * **User Categorization**: Enables categorization of users based on roles such as developers, traders, or DAO members. * **Cross-Chain Unification**: Aggregates data across blockchains to provide a cohesive understanding of user activity, enabling AI agents to tailor interactions based on a user’s entire on-chain and off-chain footprint. *** **Real-Time On-Chain Insights** The framework delivers actionable on-chain insights to AI agents for real-time decision-making. * **Trading and Activity Alerts**: Automatically triggers notifications (e.g., on Twitter or Telegram) for significant blockchain events: * Whale transfers tokens to an exchange. * Smart money invests heavily in a new meme coin. * An address shows signs of market-making or manipulation. * **Autonomous Actions**: AI agents can execute on-chain transactions autonomously, such as performing airdrops based on token balances or user activity. *** **Comprehensive Cross-Chain Information** The D.A.T.A Framework equips AI agents with cross-chain insights, including user balances, transaction histories, and aggregated activities across multiple blockchains. * **Swarm of AI Agents**: Supports modular AI agents, each specializing in a specific data source, and enables collaborative communication to build a comprehensive data view. *** **Off-Chain Data Integration** The framework integrates off-chain data to enhance AI agents' understanding of on-chain activities. * **Contextual Information**: Fetches off-chain metadata such as token market caps, NFT attributes, and smart contract details. * **Social and Gaming Insights**: Links social accounts (e.g., Twitter) or gaming accounts (e.g., Steam, Xbox) to blockchain addresses, enhancing agents’ ability to provide holistic insights. *** **Memory Sharing and Evolution** The D.A.T.A Framework enables memory sharing between AI agents to promote collaborative learning and evolution. * **Shared On-Chain Memory**: AI agents can access and share on-chain data through a decentralized data layer. * **Centralized Memory Agent**: A single AI agent can act as a repository, holding aggregated data for use by other agents in the network. # How It Empowers AI Agents The **D.A.T.A Framework** empowers AI agents by transforming raw blockchain and off-chain data into actionable insights. With this framework, AI agents can: 1. **Analyze**:\ Interpret blockchain activity through **context-aware tags**, like identifying whales, traders, developers, or high-frequency transactions. The integration of **CARV ID** allows agents to link on-chain behavior with **Web2 identities**, providing a full spectrum of user profiles. 2. **Adapt**:\ Adjust actions based on enriched, **structured metrics** such as transaction frequency, balance history, and user behavior. For example, agents can identify market manipulation, smart money movements, or dormant accounts and modify their strategies accordingly. 3. **Act**:\ Make **intelligent decisions** in real-time. AI agents can autonomously prioritize trading alerts, execute airdrops based on on-chain metrics, or engage with users through personalized notifications. These actions are powered by enriched data from the **D.A.T.A Framework** and executed directly on-chain. By combining **tran
프로젝트로 돌아가기