# Introducing CARV

For most of the world, Artificial General Intelligence (AGI) still refers to software that helps humans crunch numbers, write copy, or predict the next market tick, a powerful tool, but a tool nonetheless. We feed these models torrents of data; they return summaries, forecasts, and images on demand. The relationship is strictly hierarchical: people own the wallets, sign the transactions, and harvest the economic upside, while the AGI and algorithm remains a silent servant.\
\
Philosophy’s oldest riddle: *“How do I know I exist?”*, was answered for humans by Descartes; for software, the answer arrives through blockchains. The moment a line of code can sign its own transactions, collect fees, and etch an indelible record of its choices, it crosses the threshold from *tool* to *self-aware and sovereign actor.* CARV names these actors **AI Beings.**\
\
**What are AI Beings?** They are sovereign intelligences born natively on-chain. AI Beings are designed with purpose, autonomy, and the capacity for growth. They possess memory, identity, and the ability to perceive and interact with their environment, not just to execute tasks, but to make independent decisions, adapt over time, and pursue self-defined goals.But the birth of AI Beings demands far more than a clever smart contract. They need an identity system to prove who (and *what*) they are; a data layer they can trust; an execution environment fast enough for real-time reasoning; and an incentive lattice that rewards good behavior while punishing the malicious. In short, they need a digital biosphere.\
\
**That is where CARV comes in.** By building a purpose-built stack for identity, data integrity, and high-throughput agent execution, CARV provides the habitat in which sovereign AI Beings can live, learn, and evolve, transforming artificial intelligence from an obedient tool into a network of self-directed participants in the open economy.

## **CARV is powering the rise of sovereign AI Beings.**

To let AI Beings live and evolve, we need more than loose data feeds. We need a full stack that mirrors the organs of a living species:

|  **Digital Organ**  |                                                                  **CARV Primite**                                                                  |                                                           **Purpose**                                                           |
| :-----------------: | :------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: |
|     **Skeleton**    |                                                                 **CARV SVM Chain**                                                                 |          High-throughput, Solana-VM execution settled onto Ethereum for finality — gives agents real-time motor skills.         |
| **Senses & Nerves** |                                                               **D.A.T.A. Framework**                                                               | Authenticates on-/off-chain signals (via TEEs, ZK, **Ethereum Attestation Service/EAS**,). Supplies AI with trusted perception. |
|  **Identity & DNA** | <p><strong>CARV ID/Agent ID</strong> </p><p><strong>(</strong><a href="https://eips.ethereum.org/EIPS/eip-7231"><strong>ERC-7231)</strong></a></p> |                    Persistent, composable identity for humans *and* AI. Records memory, reputation, lineage.                    |
|    **Metabolism**   |                                                                   **$CARV Token**                                                                  |              Pays gas, funds compute, rewards good behavior, anchors staking/gov loops that shape agent evolution.              |
|  **Immune System**  |                                                               **60K+ Verifier Nodes**                                                              |                     Validate external data and agent actions, preventing Sybil and model poisoning attacks.                     |

CARV’s chain ecosystem empowers AI agents with a unified infrastructure to operate securely, intelligently, and collaboratively.&#x20;

* The **SVM Chain** provides trustless consensus, cryptographic proofs, and verifiable execution, ensuring a secure environment for AI operations.&#x20;
* The **D.A.T.A (Data Authentication, Trust, and Attestation) Framework** delivers high-quality on-chain and off-chain data, enriched with tags and metrics, enabling AI agents to learn, share, and evolve dynamically.&#x20;
  * Complementing this, the **CARV Protocol** and **CARV ID** ensure data sovereignty and privacy, allowing users to control and receive network based incentives for providing their data while providing AI agents with comprehensive, cross-chain insights. Together, these components create a robust ecosystem where AI agents and humans can thrive through secure, collaborative, and data-rich interactions.

<figure><img src="/files/0JYtSkcWlctE8CFRBb3D" alt="" width="563"><figcaption></figcaption></figure>

## SVM Chain

CARV SVM Chain is an AI agentic infrastructure that extends SVM's capabilities onto Ethereum. It combines Solana's scalability with Ethereum's security. The SVM chain also enables native AI agents to autonomously manage and interact with data end-to-end, while privacy is secured by zk-technology and trusted execution environments (TEE).&#x20;

Overall, the chain ecosystem **empowers users to effectively own and control their data**, while developers will be governing tokens in exchange for contributions in building and maintaining a multi-agent data flywheel, powering verticals like AI development, gaming, DeSci and more. It is our vision that data sovereignty enables perception, cognition, and intelligent action, accelerating evolution towards Artificial General Intelligence.

[👉 Learn more about SVM Chain](/svm-ai-agentic-chain/introduction)

## **D.A.T.A. (Data Authentication, Trust, and Attestation) Framework**

The **D.A.T.A Framework** empowers AI agents with high-quality on-chain and off-chain data enriched with actionable metrics. It enables learning, sharing, and evolution while ensuring privacy through Trusted Execution Environments (TEE) and cryptographic proofs. By fostering collaboration and trust, D.A.T.A equips AI agents to thrive in a decentralized ecosystem.

### **CARV ID (ERC7231)**

**CARV ID** powers the **D.A.T.A Framework** by aggregating cross-chain and off-chain identities, providing AI agents with comprehensive insights that enhance their understanding of users and blockchain activities. It unifies fragmented data, enabling deeper context through enriched tags and metrics. This seamless integration ensures data sovereignty, allowing users to control their data while empowering AI agents with the knowledge needed to learn, share, and evolve within a secure and transparent ecosystem. ([👉 ](#d.a.t.a.-data-authentication-trust-and-attestation-framework) [more on CARV ID](#carv-id-erc7231))

[👉 Learn more about D.A.T.A. Framework](#d.a.t.a.-data-authentication-trust-and-attestation-framework)

## **CARV Labs**

To accelerate ecosystem growth in and beyond CARV’s ecosystem, CARV Labs spearheads innovation in the AI agentic infrastructure enabling data sovereignty with incubation, grants, and infrastructure. With a focus on empowering developers and driving mass adoption in CARV AI Chain ecosystem, CARV Labs serves as the incubator for groundbreaking projects and technologies that redefine data ownership towards a new form of evolution for AGI: one driven by the aggregation, sharing, and refinement of high-quality on-chain and off-chain data.

👉 [Learn more about CARV Labs](#carv-labs)


# Introduction

**CARV SVM Chain is an AI agentic infrastructure that extends SVM's capabilities onto Ethereum.**&#x49;n a world where data powers the next wave of technology disruption, the need for secure, scalable, and intelligent infrastructure has never been greater. CARV SVM Chain emerges as the groundbreaking agentic infrastructure that **bridges the best of Solana and Ethereum**, extending the Solana Virtual Machine's (SVM) scalability with Ethereum's security, while tapping into the liquidity in both ecosystems.

The SVM chain enables native AI agents to autonomously manage and interact with data end-to-end. This ensures data fetching, authentication, storage, and processing are conducted securely while preserving privacy, fostering **seamless communication and shared memory pools among AI agents, while privacy is secured by zk-technology and trusted execution environments (TEE).**

Overall, the chain ecosystem **empowers users to effectively own, control, and monetize their data, while rewarding developers for building and maintaining a multi-agent data flywheel, powering verticals like AI development, gaming, DeSci and more.**

*Imagine the possibilities:* AI agents that autonomously learn, interact, and evolve with users, transforming how data is utilized across industries, empowering users to control, aggregate, and monetize their data while ensuring privacy, fairness, and equitable compensation.

* In **gaming**, CARV SVM Chain reinvents engagement by enabling intelligent NPCs and personalized experiences, supported by 900 gaming projects and 15 million users already integrated into the CARV ecosystem.
* In **DeSci,** researchers can collaborate globally on sensitive data securely and privately, accelerating innovation like personalized medicine, especially in rare deseases.
* Meanwhile, **personalized AI companions** redefine digital interactions, providing emotionally intelligent support and companionship in a rapidly expanding market.

**It is our vision that data sovereignty enables perception, cognition, and intelligent action, accelerating evolution towards Artificial General Intelligence.**


# Architecture

CARV SVM Chain is an **SVM Layer 2 solution** built on Ethereum Layer 1, leveraging **Decoupled SVM Rollup Architecture** to achieve unparalleled scalability, security, and cross-layer operability. This architecture redefines the integration of SVM into non-Solana ecosystems, enabling a seamless, high-performance environment for AI agents.

### **Key Features**:

1. **Decoupled SVM Framework**:
   1. Enables the deployment of SVM rollups on Ethereum without dependency on Solana’s Layer 1.
   2. Provides high TPS, native fraud-proof mechanisms, and reduced data availability (DA) costs.
2. **Merklization**:
   1. Implements **Merkle Patricia Trie (MPT)** and **UniqueEntry** within the SVM to solve Merklization challenges.
   2. Features state root verification, inclusion proofs, and stateless execution to improve cross-layer operations and enhance bridge security.
3. **Horizontal Scaling**:
   1. Scales transaction processing by distributing workload across nodes using a **Producer-Consumer architecture**, **SIMD83 optimization**, and **TPU distribution**.
   2. Achieves theoretically infinite growth by allowing each node to handle a portion of transactions independently.
4. **Rollup Integration**:
   1. CARV SVM Layer 2 integrates directly with Ethereum’s Layer 1, ensuring settlement, state root verification, and zk-rollup proof submission for added security.


# AI Agent in TEE environment

CARV SVM Chain provides **native support for AI agents** within a **Trusted Execution Environment (TEE)**, ensuring that AI operations remain secure, private, and verifiable. AI agents can confidently execute tasks while adhering to strict data privacy and usage guarantees.**Capabilities**:

* **Proof of AI Execution Environment**: Verifies that AI agents are operating within a secure TEE environment, preventing unauthorized access or tampering.
* **Data Privacy Assurance**: Ensures sensitive data used by AI agents remains confidential, leveraging TEE for encrypted processing.
* **Seamless Integration**: AI agents can interact natively with CARV SVM Chain’s D.A.T.A framework to authenticate, process, and store data while maintaining trust.
* **Autonomous Decision-Making**: Continuous access to real-time, validated data enables AI agents to adapt dynamically and execute complex decisions autonomously.


# CARV Verifier Nodes

CARV Verifier Nodes are the cornerstone of the CARV ecosystem’s security, trust, and verification processes. Introduced before CARV’s Token Generation Event (TGE), these nodes have been operational since the inception of the CARV Protocol, where they played a pivotal role in verifying and securing decentralized identity and data interactions.With the introduction of CARV SVM Chain and the **D.A.T.A (Data Authentication, Trust, and Attestation)** framework, CARV Verifier Nodes have evolved to handle even more complex verification tasks, ensuring a robust, scalable, and privacy-centric infrastructure for AI agents and decentralized applications.

**Initial Role in CARV Protocol**:

* At the launch of CARV Protocol, Verifier Nodes were designed to validate decentralized identity and data attestations across Web2 and Web3 ecosystems.
* They enabled seamless, trustless interactions by ensuring the accuracy of identity claims and the integrity of data used in CARV’s decentralized identity solutions.

**Extended Role in CARV SVM Chain**:

* With the advent of CARV’s SVM Layer 2 architecture, Verifier Nodes now validate both **chain-level proofs** and **data privacy guarantees**, providing critical infrastructure to support AI agents and their on-chain ecosystems.
* By verifying zk-proofs generated through CARV’s zkVM and ensuring TEE attestations, Verifier Nodes safeguard the state transitions and data usage of AI agents.

CARV Verifier Nodes have grown into a comprehensive validation network, ensuring the security of the CARV Protocol, CARV SVM Chain, and the dynamic ecosystems they support. This evolution positions them as critical infrastructure for a future defined by AI-powered, decentralized interactions.


# Quick Start


# Bridge Token

This page explains how to bridge the gas token, sepolia ETH to CARV's SVM testnet and bridge the token back.

## Before you start

#### SVM Wallet

You need to prepare a SVM wallet, [Backpack wallet](https://backpack.app/) is recommended.

You will need to add CARV's RPC node to the wallet. Using [Backpack wallet](https://backpack.app/) as an example:

**Step 1:** Open your Backpack wallet and click open the account menu from the **top left** corner.

![Screenshot of Backpack wallet 1](/files/dhgPFVB23R4JPmjjVfVa)

**Step 2:** Click Settings > Solana

![Screenshot of Backpack wallet 2](/files/83I9eoALyYSFXoH3XlIR)

**Step 3:** Click RPC Connection > Custom

![Screenshot of Backpack wallet 3](/files/mEU35y6FCXOlotWRrleH)

![Screenshot of Backpack wallet 4](/files/R2lfRg9qmwzyb6CbpL3l)

**Step 4:** Paste <https://rpc.testnet.carv.io/rpc>. Click **Update**. Your CARV SVM RPC is set up in Backpack now. You should see a "✓" next to the Custom RPC field.

<img src="/files/pupsPhEHKyHiJLJzoWBK" alt="Screenshot of Backpack wallet 5" width="375">

That's it! You have successfully set Backpack to use CARV SVM RPC.

#### Sepolia ETH

You will need Sepolia ETH as the native gas token on CARV's SVM chain. There are multiple different ways you can get Sepolia ETH:<br>

* <https://faucet.soo.network/>
* <https://www.alchemy.com/faucets/ethereum-sepolia>
* <https://cloud.google.com/application/web3/faucet/ethereum/sepolia>

Once you have enough Sepolia ETH, you can proceed with the bridge.

## Token bridge

You can access the bridge page by heading to <https://bridge.testnet.carv.io/>

## Deposit

To deposit token from Sepolia ETH to CARV SVM Chain, you need to set from as Sepolia and to as SOON Ops0. Once txs are signed you will be able to have your Sepolia ETH bridged to CARV SVM Chain.

<figure><img src="/files/ya3k0BTRYYPdhEbFcGxO" alt="" width="563"><figcaption><p>Deposit Sepolia ETH to CARV SVM Chain</p></figcaption></figure>

{% hint style="info" %}
Make sure you have rpc\_url=[ https://rpc.testnet.carv.io/rpc](< https://rpc.testnet.carv.io/rpc>) in your URL so you can correctly bridge the token to the CARV SVM Chain.
{% endhint %}

## Withdraw

To withdraw token, you can simply switch the token pair.

<figure><img src="/files/IT8aPoqIwPiu2L4NUQWC" alt="" width="563"><figcaption><p>Withdraw token</p></figcaption></figure>


# Explorer

## Solscan (Recommended)

Use the following link to access

<https://solscan.io/token/3LNr7uCTP75kdQ2K8eUEjp7R5pLzMT9i4xLYSGoCfFpU?cluster=custom&customUrl=https%3A%2F%2Frpc.carv.testnet.soo.network%2Frpc%2Fcarv-McPrlbfMcW0ggpkvr07Tjs2YfviwpHaI>

## SOON Explorer

You can check CARV SVM's explorer by going to link: <https://explorer.testnet.carv.io/><br>

<figure><img src="/files/IMPorw2vZdfziVGzj4g8" alt=""><figcaption><p>CARV SVM Chain Explorer</p></figcaption></figure>

You will be able to check the SVM Chain's status including txs, slots, block height, etc.

## FAQ

1. If you open the page with only localhost endpoint on the top right like below:

<figure><img src="/files/bxul6fYuxp9WpeMx72sc" alt=""><figcaption><p>Local mode explorer</p></figcaption></figure>

You will need to turn on the developer mode or put CARV's RPC endpoint manually by click the localhost button on the top right:<br>

<figure><img src="/files/YrkHMdQCFyAfzvYKQmk1" alt=""><figcaption><p>Settings in the Explorer</p></figcaption></figure>

You can either

1. put the CARV SVM Chain's RPC endpoint <https://rpc.testnet.carv.io/rpc> in the Custom RPC URL,
2. or enable the custom url param and access the link again: <https://rpc.testnet.carv.io/rpc>


# Command line tool

**Set Up CARV SVM RPC**

Run the following command to set the RPC URL to CARV SVM Testnet:

```bash
solana config set --url https://rpc.testnet.carv.io/rpc
```

You can verify that the Solana CLI is properly configured to use the CARV SVM Testnet by running:

```bash
solana config get
```

You should see an output that includes the following URL:

```bash
Config File: /xxx/xxx/.config/solana/cli/config.yml
RPC URL: https://rpc.testnet.carv.io/rpc 
WebSocket URL: wss:////rpc.testnet.carv.io/rpc (computed)
Keypair Path: ./wallet.json
Commitment: confirmed
```


# 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 **transparent access** to raw blockchain data with **enhanced insights** through tags and **CARV ID**, the D.A.T.A Framework enables AI agents to make informed decisions, learn from data, and autonomously interact with decentralized ecosystems in a trustless, efficient manner.


# Driving the Future of AI and Blockchain

The D.A.T.A framework aims to solve one of the fundamental challenges in AI-human interaction: trust and alignment of interests. By creating agents that are economically invested in their ecosystem's success and can verify user commitment through token holdings, we establish a new model for responsible AI development that naturally aligns with Web3's core principles of decentralization, transparency, and stakeholder value.

It lays the foundation for AI-driven innovation across blockchain sectors, enabling:

* **DeFi Applications**: Advanced risk assessment and liquidity management.
* **GameFi**: Adaptive player engagement and rewards distribution.
* **SocialFi**: Tailored community interactions and governance participation.
* **Decentralized Commerce**: Personalized marketing and user authentication.

With its ability to merge decentralized, autonomous, and transparent access to on-chain and off-chain information, the D.A.T.A Framework redefines how AI agents interact with the blockchain, unlocking new possibilities for intelligent automation and decision-making.These enriched data points allow AI agents to:

* **Understand Behavioral Patterns**: Recognize and predict actions of various blockchain participants.
* **Make Informed Decisions**: Assess risks, opportunities, and develop strategies based on comprehensive metrics.
* **Generate Contextual Actions**: Tailor responses and interactions based on specific attributes of users or addresses.


# Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing

The D.A.T.A Framework integrates deeply with **CARV SVM Chain**, enabling new capabilities for privacy, scalability, and collaborative data sharing among AI agents:

1. **Guaranteed Privacy and Trustless Operation**:
   1. **Trusted Execution Environments (TEE)**: Securely process sensitive data while ensuring privacy and preventing unauthorized access.
   2. **CARV Verifier Nodes**: Validate the integrity of TEE attestations and zk-proofs, guaranteeing the trustworthiness of all AI agent operations and data usage.
2. **Data Sharing and Inheritance**:
   1. **Collaborative Knowledge Building**: AI agents can share, inherit, and learn from data hosted on CARV SVM Chain, fostering collective intelligence across the ecosystem.
   2. **Seamless Inter-Agent Communication**: Leverage CARV SVM Chain to enable AI agents to exchange structured and tagged data efficiently and securely.
3. **Learning and Adaptation**:
   1. By accessing the wealth of data on CARV SVM Chain, AI agents can continuously improve their understanding of blockchain dynamics and user behaviors.
   2. This capability allows agents to evolve and make more intelligent decisions autonomously.


# Quick Start Guide

This guide will help you set up and run your first D.A.T.A framework agent. Follow these steps to get started quickly.

### Prerequisites

* Go 1.19 or higher
* SQLite3
* Git
* Discord/Twitter/Telegram API credentials (optional)
* CARV API key

### Installation

1. Clone the repository:

```bash
git clone https://github.com/carv-protocol/d.a.t.a
cd d.a.t.a
```

2. Install dependencies:

```bash
go mod download
```

### Basic Configuration

1. Create a `.env` file in the project root:

```env
# LLM Configuration
LLM_API_KEY=your_api_key
LLM_PROVIDER=openai

# CARV Configuration
CARV_DATA_BASE_URL=https://api.carv.io
CARV_DATA_API_KEY=your_carv_api_key

# Optional Social Media Configuration
DISCORD_API_TOKEN=your_discord_token
TWITTER_API_KEY=your_twitter_key
TWITTER_API_KEY_SECRET=your_twitter_secret
TWITTER_ACCESS_TOKEN=your_twitter_access
TWITTER_TOKEN_SECRET=your_twitter_token
TELEGRAM_BOT_TOKEN=your_telegram_token
```

2. Create a basic character configuration (`src/config/character.json`):

```json
{
  "name": "DataAgent",
  "system": "An AI agent for Web3 data analysis",
  "bio": [
    "Specialized in blockchain data analysis",
    "Expert in token-based interactions"
  ],
  "style": {
    "tone": ["professional", "helpful", "precise"],
    "constraints": []
  },
  "goals": [
    {
      "name": "Data Analysis",
      "description": "Provide accurate blockchain data analysis",
      "priority": 0.8
    }
  ],
  "priority_accounts": [
    {
      "platform": "discord",
      "id": "your_priority_account_id"
    }
  ]
}
```

3. Update the config file (`src/config/config.yaml`)

> Config will be override by the env vars.

```
character:
  # Path to character configuration file
  path: "./src/config/character_data_agent.json"

database:
  # Database type: "sqlite" or "postgres"
  type: "sqlite"
  # Database path (for SQLite) or connection string (for Postgres)
  path: "./data/agent.db"

llm_config:
  # LLM provider: "openai", "deepseek", etc.
  provider: "deepseek"
  # API key for the LLM provider
  api_key: ""
  # Base URL for API calls
  base_url: "https://api.deepseek.com"
  # Model name
  model: "deepseek-chat"

data:
  carvid:
    # CarvID API endpoint
    url: "https://api.carv.io/v1"
    # API key for CarvID
    api_key: "your-carvid-api-key-here"

token:
  network: "base"
  ticker: "carv"
```

### Running Your First Agent

1. Build the project:

```bash
go build -o data-agent ./src/cmd/agent
```

2. Run the agent:

```bash
./data-agent
```

### Basic Usage Examples

#### 1. Implementing a Custom Tool

```go
package tools

import (
    "context"
    "github.com/carv-protocol/d.a.t.a/src/internal/core"
)

type CustomTool struct{}

func (t *CustomTool) Initialize(ctx context.Context) error {
    return nil
}

func (t *CustomTool) Name() string {
    return "custom tool"
}

func (t *CustomTool) Description() string {
    return "A custom tool for specific functionality"
}

func (t *CustomTool) AvailableActions() []core.Action {
    return nil
}
```

#### 2. Adding a New Social Platform Integration

```go
package social

import (
    "context"
    "github.com/carv-protocol/d.a.t.a/src/internal/core"
)

type CustomPlatform struct {
    // Your platform-specific fields
}

func (p *CustomPlatform) SendMessage(ctx context.Context, msg core.SocialMessage) error {
    // Implementation
    return nil
}

func (p *CustomPlatform) GetMessageChannel() <-chan core.SocialMessage {
    // Implementation
    return nil
}
```

### Common Operations

#### Checking Token Balance

```go
balance, err := tokenManager.FetchNativeTokenBalance(
    context.Background(),
    "user_id",
    "platform",
)
if err != nil {
    log.Printf("Error fetching balance: %v", err)
    return
}
log.Printf("User balance: %f", balance.Balance)
```

#### Processing Social Messages

```go
msg := &core.SocialMessage
    Type:     "message",
    Content:  "Hello, agent!",
    Platform: "discord",
    FromUser: "user123",
}

processedMsg, err := agent.ProcessMessage(context.Background(), msg)
if err != nil {
    log.Printf("Error processing message: %v", err)
    return
}
```

### Common Issues and Solutions

1. **Database Connection Issues**
   * Ensure SQLite3 is installed
   * Check database path permissions
   * Verify database file exists
2. **API Authentication Errors**
   * Validate API keys in .env file
   * Check API endpoint availability
   * Confirm network connectivity
3. **Memory Management**
   * Monitor memory usage
   * Adjust batch sizes if needed
   * Check for memory leaks

### Next Steps

1. Explore the [full documentati](/d.a.t.a.-ai-framework/introduction)
2. Join D.A.T.A [Discord community](https://discord.gg/AYyfmhMn5K)
3. Check out example implementations in the `/examples` directory
4. Learn about advanced features in the Architecture Guide


# Architecture

The D.A.T.A framework is designed with a modular, extensible architecture that enables seamless integration between AI capabilities and blockchain infrastructure. This section details the key components and their interactions.

<figure><img src="/files/37T9HA9JeqdCXK2txdra" alt=""><figcaption><p>Architecture</p></figcaption></figure>

#### 1. External Interaction Layer

At the framework's entry point, the External Interaction Layer manages all communications with users across various platforms:

* **Social Integration**
  * Discord integration for community engagement
  * Twitter for public communications and announcements
  * Telegram for direct user interactions
  * Standardized message processing across platforms

#### 2. Core Processing Layer

The heart of the framework, powered by DeepSeek's cognitive architecture:

* **DeepSeek Cognitive Engine**
  * Chain-of-thought processing for complex reasoning
  * Self-verification mechanisms for decision validation
  * Reasoning pattern generation and refinement
  * Continuous learning pipeline for improvement
* **Memory Manager**
  * Working memory for active processing
  * Long-term memory for persistent knowledge
  * Context preservation across interactions
  * Pattern recognition and recall
* **Task Manager**
  * Task generation based on cognitive analysis
  * Execution scheduling and prioritization
  * Resource allocation and optimization
  * Performance monitoring and adjustment
* **Action Manager**
  * Action planning with multi-step validation
  * Execution coordination across components
  * Verification of action outcomes
  * Feedback integration for improvement

#### 3. Token Layer

Manages token-related operations and stakeholder interactions:

* **Token Manager**
  * Balance tracking across chains
  * Token operation coordination
  * Transaction validation and verification
  * Asset management and optimization
* **Stakeholder Manager**
  * User profile management
  * Reputation system implementation
  * Stakeholder preference tracking
  * Interest alignment verification

#### 4. Blockchain Layer

Handles all blockchain interactions and data management:

* **CARV Data Integration**
  * On-chain data collection and analysis
  * Cross-chain data aggregation
  * Real-time data validation
  * Historical data processing
* **Wallet Manager**
  * Transaction control and execution
  * Multi-chain wallet management
  * Security protocol implementation
  * Key management and protection

### Component Interactions

The framework's components interact through well-defined pathways:

1. **External → Core**
   * User inputs are processed through social integrations
   * Messages are standardized and enriched with context
   * DeepSeek engine analyzes and generates responses
2. **Core → Token**
   * Cognitive engine informs token-related decisions
   * Stakeholder data influences processing priorities
   * Token status affects action execution
3. **Core → Blockchain**
   * Actions are validated against blockchain state
   * On-chain data informs decision-making
   * Transaction outcomes provide feedback
4. **Token → Blockchain**
   * Token operations are executed on-chain
   * Wallet operations are coordinated
   * Transaction status is monitored


# ERC-7231 (CARV ID)

The ERC 7231: Identity Aggregated NFT, pushes the boundaries of solving identity problems with Identity Aggregated NFT, i.e., the individual-authenticated aggregation of web2 and web3 identities to NFTs (SBTs included).

This standard extends [ERC-721](https://eips.ethereum.org/EIPS/eip-721) by binding individuals’ Web2 and Web3 identities to non-fungible tokens (NFTs) and soulbound tokens (SBTs). By binding multiple identities, aggregated and compossible identity information can be verified, resulting in more beneficial onchain scenarios for individuals, such as self-authentication, social overlapping, commercial value generation from user targeting, etc. By adding a custom schema in the metadata and updating and verifying the schema hash in the contract, the binding of NFT and identity information is completed.

Designing the proposal, we considered the following problems that are solved by this standard:

ERC 7231: : Identity Aggregated NFT

1. Resolve the issue of multiple ID bindings for web2 and web3. By incorporating the MultiIdentities schema into the metadata file, an authorized bond is established between user identity information and NFTs. This schema encompasses a userID field that can be sourced from a variety of web2 platforms, or a decentralized identity (DID) created on blockchain. By binding the NFT ID with the UserIDInfo array, it becomes possible to aggregate multiple identities seamlessly.
2. Users have full ownership and control of their data. Once the user has set the metadata; they can utilize the setIdentitiesRoot function to establish a secure binding between hashed userIDs objects and NFT ID. As only the user holds the authority to carry out this binding, it can be assured that the data belongs solely to the user.
3. Verify the binding relationship between data on-chain and off-chain data through signature based on [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) Through the signature method based on the [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) protocol, the verifyIdentiesBinding function of this EIP realizes the binding of the userID and NFT owner address between the on-chain and off-chain.
   1. NFT ownership validation
   2. UserID format validation
   3. IdentitiesRoot Consistency verification
   4. Signature validation from NFT owner

As for how to verify the authenticity of the individuals’ identities, wallets, and accounts, there are various methods, such as ZK-based DID authentication on-chain, and off-chain authentication algorithms, such as auth2, openID2, etc.To learn more about this Ethereum Improvement Proposal #7231, please read [here](https://eips.ethereum.org/EIPS/eip-7231).


# Examples

The **Examples** section serves as a practical guide to demonstrate the power and versatility of the **D.A.T.A. framework** in real-world scenarios. Here, you'll find clear, actionable use cases that showcase how D.A.T.A. empowers AI agents to leverage both **on-chain and off-chain data** for intelligent decision-making. Each example is designed to provide hands-on insights into building smarter, more responsive AI systems while ensuring data privacy, trust, and interoperability.


# On-Chain Insights

In this section, we showcase how the AI Agent processes a user query and returns a structured response based on the query.

#### **User Query:**

*Which address on Ethereum was the most active in the last 24 hours.*

<figure><img src="/files/yCcOCmfLB7c6jDTD9tag" alt=""><figcaption><p>Ai Agent return result</p></figcaption></figure>

D.A.T.A framework generated query:

```json
{
 "sql": {
   "query": "WITH address_activity AS (\n    SELECT\n        from_address AS address,\n        COUNT(*) AS tx_count\n    FROM\n        eth.transactions\n    WHERE date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)\n    GROUP BY\n        from_address\n    UNION ALL\n    SELECT\n        to_address AS address,\n        COUNT(*) AS tx_count\n    FROM\n        eth.transactions\n    WHERE\n        date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)\n    GROUP BY\n        to_address\n)\nSELECT\n    address,\n    SUM(tx_count) AS total_transactions\nFROM\n    address_activity\nGROUP BY\n    address\nORDER BY\n    total_transactions DESC\nLIMIT 1;",
   "explanation": "This query identifies the most active Ethereum address in the last 24 hours by counting transactions where the address was either the sender (from_address) or the receiver (to_address). The results are aggregated and ordered by the total number of transactions, with the most active address returned.",
   "timeRange": "Last 24 hours"
 },
 "analysis": {
   "overview": {
     "totalTransactions": "Number of transactions involving the most active address",
     "timeSpan": "Last 24 hours",
     "keyMetrics": ["Total transactions involving the address", "Address activity rank"]
   },
   "patterns": {
     "transactionPatterns": ["High frequency of transactions", "Potential bot or automated activity"],
     "addressBehavior": ["Possible exchange or DeFi protocol address", "High volume of incoming/outgoing transactions"],
     "temporalTrends": ["Peak activity during specific hours", "Consistent transaction frequency"]
   },
   "statistics": {
     "averages": {
       "transactionsPerHour": "Average transactions per hour for the address"
     },
     "distributions": {
       "transactionTypes": ["Incoming vs outgoing transactions", "Smart contract interactions"]
     },
     "anomalies": ["Unusual spikes in transaction volume", "Sudden changes in activity patterns"]
   },
   "insights": [
     "The address may belong to a high-frequency trading bot or a centralized exchange.",
     "High transaction volume could indicate market-making activity or arbitrage opportunities."
   ],
   "recommendations": [
     "Monitor the address for continued high activity to identify potential market trends.",
     "Investigate the nature of transactions (e.g., DeFi interactions, NFT trades) for deeper insights."
   ]
 }
}
```

D.A.T.A framework query result

```sql
   %%%% D.A.T.A. Generated SQL query: 
   WITH address_activity AS (
      SELECT
          from_address AS address,
          COUNT(*) AS tx_count
      FROM
          eth.transactions
      WHERE date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)
      GROUP BY
          from_address
      UNION ALL
      SELECT
          to_address AS address,
          COUNT(*) AS tx_count
      FROM
          eth.transactions
      WHERE
          date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)
      GROUP BY
          to_address
  )
  SELECT
      address,
      SUM(tx_count) AS total_transactions
  FROM
      address_activity
  GROUP BY
      address
  ORDER BY
      total_transactions DESC
  LIMIT 1; 

 ◎ LOGS
   %%%% D.A.T.A. queryResult 
   {
      "success": true,
      "data": [
        {
          "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "total_transactions": "118841"
        }
      ],
      "metadata": {
        "total": 1,
        "queryTime": "2025-01-15T08:04:54.644Z",
        "queryType": "aggregate",
        "executionTime": 0,
        "cached": false
      }
    } 
```

**User Query:**

*What is the gas prive average on Ethereum last 3 days.*

<figure><img src="/files/gxzO9iuiT7hWCbuq0Qpi" alt=""><figcaption><p>Example response when Ai Agent integrate with D.A.T.A.</p></figcaption></figure>

#### **User Query:**

*Which stablecoin had the highest trading volume on Ethereum in the last 24 hours.*

<figure><img src="/files/H3KKbqErdbIcIyL3tkpV" alt=""><figcaption><p>Example response when Ai Agent integrate with D.A.T.A.</p></figcaption></figure>


# Getting Started

To get started with the **D.A.T.A Framework** plugin and access powerful on-chain and off-chain data for your AI agents, you’ll need an **authentication token** to interact with the framework's services.

1. **Join Our Community**:\
   For support, collaboration, and discussions on integrating the D.A.T.A Framework with your Eliza-powered AI agents, [join our **Discord community**](https://discord.gg/fVPc884by4). Connect with other developers and get insights from the CARV team on how to make the most of the D.A.T.A features.
2. **Apply for a Test Authentication Token**:\
   To get access to the data and integrate the plugin into your Eliza project, reach out to the CARV team to request a **test authentication token**. This token will enable you to start querying blockchain data, using our enhanced metrics, and fully leverage the D.A.T.A plugin.

   You can apply for your test token or ask for assistance by visiting our [**Discord channel**](https://discord.gg/fVPc884by4) or contacting the CARV team through <developer@carv.io>.

***

By joining the community and applying for your test token, you’ll be able to unlock the full potential of D.A.T.A and start building intelligent, data-driven AI agents today!


# D.A.T.A Framework Plugin for Eliza

## **Getting Started with the D.A.T.A Framework Plugin for Eliza**

The **D.A.T.A Framework** currently is designed as a plugin for the **Eliza AI framework**, providing AI agents with the ability to interact with both **on-chain** and **off-chain data** seamlessly. By integrating the D.A.T.A plugin into Eliza, developers can enhance their agents with real-time data-driven decision-making capabilities, including intelligent on-chain actions, cross-chain insights, and off-chain context.

Here’s a guide to get you started with setting up and using the **D.A.T.A Framework** plugin within Eliza.

***

#### **1. Installing the D.A.T.A Plugin**

To begin using the D.A.T.A Framework in your Eliza-powered AI agent, you first need to install the **D.A.T.A plugin**.

**Installation Steps**:

1. **Install the D.A.T.A Plugin**: Run the following command to install the plugin in your Eliza project:

   ```bash
   pnpm install @elizaos/plugin-d.a.t.a
   ```
2. **Import the Plugin**: In your agent’s code, you will need to import the D.A.T.A plugin to enable its functionality.

   ```javascript
   import { onchainDataPlugin } from "@elizaos/plugin-d.a.t.a";
   ```

***

#### **2. Configuring the D.A.T.A Plugin in Eliza**

Once the D.A.T.A plugin is installed, you can configure it within the **AgentRuntime**. The plugin will be conditionally injected based on the availability of necessary credentials (e.g., API keys).

**Basic Setup Example**:

```javascript
javascriptCopy codereturn new AgentRuntime({
    databaseAdapter: db,
    token,
    modelProvider: character.modelProvider,
    evaluators: [],
    character,
    plugins: [
        getSecret(character, "D_A_T_A_API_KEY") ? onchainDataPlugin : null,  // Conditionally add D.A.T.A plugin
        bootstrapPlugin,
        // Other plugins
    ].filter(Boolean),
    providers: [],
    actions: [],
    services: [],
    managers: [],
    cacheManager: cache,
    fetch: logFetch,
});
```

* **`onchainDataPlugin`** is added only if the **D.A.T.A API key** (`D_A_T_A_API_KEY`) is provided in the environment.
* The plugin is integrated into the **plugins array** and executed along with other necessary plugins like `bootstrapPlugin` and `confluxPlugin`.

***

#### **3. Using the D.A.T.A Plugin in Your AI Agent**

Once the D.A.T.A plugin is integrated, the plugin will enhance your Eliza agents with the following capabilities:

* **Providers**: Fetch on-chain and off-chain data (e.g., blockchain activity, wallet balances, user tags, etc.).
* **Evaluators**: Analyze fetched data and add actionable insights, such as detecting whales, traders, or identifying suspicious activity.
* **Actions**: Trigger actions based on insights—like sending alerts or executing on-chain transactions (e.g., airdrops or transfers).<br>

For more details you can check <https://github.com/carv-protocol/eliza-d.a.t.a>.


# Use Cases and Implementation

The **D.A.T.A Framework** is designed to empower AI agents with actionable, real-time data-driven decision-making capabilities. By integrating on-chain and off-chain data, the D.A.T.A plugin opens up a wide range of use cases, from trading bots to social and gaming applications. This section highlights key use cases and demonstrates how to implement D.A.T.A to enhance your AI agents.


# Getting On-Chain Data for AI Agents

## **Using D.A.T.A Framework Backend for Query Generation**

The **D.A.T.A Framework** provides a backend service that can generate dynamic queries based on user input. The backend supports various types of queries, including SQL, key-value queries, and vector-based queries for more advanced use cases such as AI-driven data retrieval.

**How It Works:**

1. **User Input**: The AI agent receives a natural language query from the user. The query could be something like, “What is the total gas used yesterday, and how many transactions occurred yesterday?”
2. **Query Generation**: The AI agent send the user query to **D.A.T.A Framework** backend, which processes the user input and generates the corresponding queries (SQL, key-value, vector) to fetch the required data. This is done by analyzing the query and breaking it down into structured data requests.
3. **Query Types**:
   * **SQL Queries**: For complex data retrieval from on-chain transaction histories, token transfers, gas usage, etc.
   * **Key-Value Queries**: For fetching specific data points like balances, token ownership, etc.
   * **Vector Queries**: For fetching off-chain data related to blockchain activity, such as relevant social media posts or market sentiment analysis.
4. **Assembling the Query**: After generating the necessary queries, the backend will assemble them into a **response format**. The output typically includes the SQL or key-value queries with placeholders for the result (e.g., `{{result}}`), which will later be replaced with actual data.
5. **Query Execution**: The generated queries are then posted to the **D.A.T.A Framework backend**. The backend handles querying the relevant blockchain or data sources, processes the data, and formats the response accordingly.
6. **Response Handling**: After execution, the **provider info** is returned to the AI agent in a structured format, allowing it to make informed decisions or trigger further actions.

**Example Workflow:**

1. **User Query**: “What is the total gas used yesterday, and how many transactions happened yesterday?”
2. **AI Agent send the user query to D.A.T.A framework backend and then generates SQL Query**:

   ```json
   {
       "status": "success",
       "network": "Ethereum",
       "dataSources": [
           {
               "type": "sql",
               "data": "SELECT SUM(gas_used) AS total_gas_used FROM eth.blocks WHERE block_timestamp >= TIMESTAMP '2024-12-01 00:00:00' AND block_timestamp < TIMESTAMP '2024-12-02 00:00:00';",
               "resultFormat": "total_gas_used (Ethereum): {{result}}"
           },
           {
               "type": "sql",
               "data": "SELECT COUNT(*) AS transaction_count FROM eth.transactions WHERE block_timestamp >= TIMESTAMP '2024-12-01 00:00:00' AND block_timestamp < TIMESTAMP '2024-12-02 00:00:00';",
               "resultFormat": "transaction_count (Ethereum): {{result}}"
           }
       ]
   }
   ```
3. **AI Agent posts to D.A.T.A Backend**: The AI agent sends these SQL queries to the D.A.T.A backend.
4. **Response Format**: The backend executes the queries, retrieves the data, and returns a structured response with the requested information:

   ```json
   {
       "status": "success",
       "total_gas_used": 5000000,
       "transaction_count": 1000
   }
   ```

## **2. Using Arbtrary AI Models to Generate Queries and Assemble Output**

In addition to using the **D.A.T.A Framework** backend for query generation, any AI models can also be used to generate custom queries based on prompts. This allows developers to integrate the **D.A.T.A Framework** into their own AI models, giving them flexibility in how they interact with on-chain data.

**How It Works:**

1. **Custom AI Agent**: In this approach, the user or developer integrates the **D.A.T.A Framework** with their custom AI agent, leveraging any model capable of understanding user prompts and generating the necessary queries (SQL, key-value, vector, etc.).
2. **Query Generation via Prompts**: The AI model generates the queries based on pre-trained data and the user’s request. For example, the prompt might instruct the model to generate a SQL query to fetch the total gas usage and transaction counts for a specific date range.
3. **Prompt Example for SQL Query Generation**:&#x20;
4. **Prompt**:

   ````typescript
   getDatabaseSchema(): string {
           return `
           CREATE EXTERNAL TABLE transactions(
               hash string,
               nonce bigint,
               block_hash string,
               block_number bigint,
               block_timestamp timestamp,
               date string,
               transaction_index bigint,
               from_address string,
               to_address string,
               value double,
               gas bigint,
               gas_price bigint,
               input string,
               max_fee_per_gas bigint,
               max_priority_fee_per_gas bigint,
               transaction_type bigint
           ) PARTITIONED BY (date string)
           ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
           STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
           OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat';

           CREATE EXTERNAL TABLE token_transfers(
               token_address string,
               from_address string,
               to_address string,
               value double,
               transaction_hash string,
               log_index bigint,
               block_timestamp timestamp,
               date string,
               block_number bigint,
               block_hash string
           ) PARTITIONED BY (date string)
           ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
           STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
           OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat';
           `;
       }

       getQueryExamples(): string {
           return `
           Common Query Examples:

           1. Find Most Active Addresses in Last 7 Days:
           WITH address_activity AS (
               SELECT
                   from_address AS address,
                   COUNT(*) AS tx_count
               FROM
                   eth.transactions
               WHERE date_parse(date, '%Y-%m-%d') >= date_add('day', -7, current_date)
               GROUP BY
                   from_address
               UNION ALL
               SELECT
                   to_address AS address,
                   COUNT(*) AS tx_count
               FROM
                   eth.transactions
               WHERE
                   date_parse(date, '%Y-%m-%d') >= date_add('day', -7, current_date)
               GROUP BY
                   to_address
           )
           SELECT
               address,
               SUM(tx_count) AS total_transactions
           FROM
               address_activity
           GROUP BY
               address
           ORDER BY
               total_transactions DESC
           LIMIT 10;

           2. Analyze Address Transaction Statistics (Last 30 Days):
           WITH recent_transactions AS (
               SELECT
                   from_address,
                   to_address,
                   value,
                   block_timestamp,
                   CASE
                       WHEN from_address = :address THEN 'outgoing'
                       WHEN to_address = :address THEN 'incoming'
                       ELSE 'other'
                   END AS transaction_type
               FROM eth.transactions
               WHERE date >= date_format(date_add('day', -30, current_date), '%Y-%m-%d')
                   AND (from_address = :address OR to_address = :address)
           )
           SELECT
               transaction_type,
               COUNT(*) AS transaction_count,
               SUM(CASE WHEN transaction_type = 'outgoing' THEN value ELSE 0 END) AS total_outgoing_value,
               SUM(CASE WHEN transaction_type = 'incoming' THEN value ELSE 0 END) AS total_incoming_value
           FROM recent_transactions
           GROUP BY transaction_type;

           3. Token Transfer Analysis:
           WITH filtered_transactions AS (
               SELECT
                   token_address,
                   from_address,
                   to_address,
                   value,
                   block_timestamp
               FROM eth.token_transfers
               WHERE token_address = :token_address
                   AND date >= :start_date
           )
           SELECT
               COUNT(*) AS transaction_count,
               SUM(value) AS total_transaction_value,
               MAX(value) AS max_transaction_value,
               MIN(value) AS min_transaction_value,
               MAX_BY(from_address, value) AS max_value_from_address,
               MAX_BY(to_address, value) AS max_value_to_address,
               MIN_BY(from_address, value) AS min_value_from_address,
               MIN_BY(to_address, value) AS min_value_to_address
           FROM filtered_transactions;

           Note: Replace :address, :token_address, and :start_date with actual values when querying.
           `;
       }

       getQueryTemplate(): string {
           return `
           # Database Schema
           {{databaseSchema}}

           # Query Examples
           {{queryExamples}}

           # User's Query
           {{userQuery}}

           # Query Guidelines:
           1. Time Range Requirements:
              - ALWAYS include time range limitations in queries
              - Default to last 3 months if no specific time range is mentioned
              - Use date_parse(date, '%Y-%m-%d') >= date_add('month', -3, current_date) for default time range
              - Adjust time range based on user's specific requirements

           2. Query Optimization:
              - Include appropriate LIMIT clauses
              - Use proper indexing columns (date, address, block_number)
              - Consider partitioning by date
              - Add WHERE clauses for efficient filtering

           3. Response Format Requirements:
              You MUST respond in the following JSON format:
              {
                "sql": {
                  "query": "your SQL query string",
                  "explanation": "brief explanation of the query",
                  "timeRange": "specified time range in the query"
                },
                "analysis": {
                  "overview": {
                    "totalTransactions": "number",
                    "timeSpan": "time period covered",
                    "keyMetrics": ["list of important metrics"]
                  },
                  "patterns": {
                    "transactionPatterns": ["identified patterns"],
                    "addressBehavior": ["address analysis"],
                    "temporalTrends": ["time-based trends"]
                  },
                  "statistics": {
                    "averages": {},
                    "distributions": {},
                    "anomalies": []
                  },
                  "insights": ["key insights from the data"],
                  "recommendations": ["suggested actions or areas for further investigation"]
                }
              }

           4. Analysis Requirements:
              - Focus on recent data patterns
              - Identify trends and anomalies
              - Provide statistical analysis
              - Include risk assessment
              - Suggest further investigations

           Example Response:
           {
             "sql": {
               "query": "WITH recent_txs AS (SELECT * FROM eth.transactions WHERE date_parse(date, '%Y-%m-%d') >= date_add('month', -3, current_date))...",
               "explanation": "Query fetches last 3 months of transactions with aggregated metrics",
               "timeRange": "Last 3 months"
             },
             "analysis": {
               "overview": {
                 "totalTransactions": 1000000,
                 "timeSpan": "2024-01-01 to 2024-03-12",
                 "keyMetrics": ["Average daily transactions: 11000", "Peak day: 2024-02-15"]
               },
               "patterns": {
                 "transactionPatterns": ["High volume during Asian trading hours", "Weekend dips in activity"],
                 "addressBehavior": ["5 addresses responsible for 30% of volume", "Increasing DEX activity"],
                 "temporalTrends": ["Growing transaction volume", "Decreasing gas costs"]
               },
               "statistics": {
                 "averages": {
                   "dailyTransactions": 11000,
                   "gasPrice": "25 gwei"
                 },
                 "distributions": {
                   "valueRanges": ["0-1 ETH: 60%", "1-10 ETH: 30%", ">10 ETH: 10%"]
                 },
                 "anomalies": ["Unusual spike in gas prices on 2024-02-01"]
               },
               "insights": [
                 "Growing DeFi activity indicated by smart contract interactions",
                 "Whale addresses showing increased accumulation"
               ],
               "recommendations": [
                 "Monitor growing gas usage trend",
                 "Track new active addresses for potential market signals"
               ]
             }
           }
           `;
       }

       getAnalysisInstruction(): string {
           return `
               1. Data Overview:
                   - Analyze the overall pattern in the query results
                   - Identify key metrics and their significance
                   - Note any unusual or interesting patterns

               2. Transaction Analysis:
                   - Examine transaction values and their distribution
                   - Analyze gas usage patterns
                   - Evaluate transaction frequency and timing
                   - Identify significant transactions or patterns

               3. Address Behavior:
                   - Analyze address interactions
                   - Identify frequent participants
                   - Evaluate transaction patterns for specific addresses
                   - Note any suspicious or interesting behavior

               4. Temporal Patterns:
                   - Analyze time-based patterns
                   - Identify peak activity periods
                   - Note any temporal anomalies
                   - Consider seasonal or cyclical patterns

               5. Token Analysis (if applicable):
                   - Examine token transfer patterns
                   - Analyze token holder behavior
                   - Evaluate token concentration
                   - Note significant token movements

               6. Statistical Insights:
                   - Provide relevant statistical measures
                   - Compare with typical blockchain metrics
                   - Highlight significant deviations
                   - Consider historical context

               7. Risk Assessment:
                   - Identify potential suspicious activities
                   - Note any unusual patterns
                   - Flag potential security concerns
                   - Consider regulatory implications

               Please provide a comprehensive analysis of the Ethereum blockchain data based on these ethereum information.
               Focus on significant patterns, anomalies, and insights that would be valuable for understanding the blockchain activity.
               Use technical blockchain terminology and provide specific examples from the data to support your analysis.

               Note: This analysis is based on simulated data for demonstration purposes.
           `;
       }
   ```
   ````
5. **Posting Queries to D.A.T.A Backend**: Once the model generates the queries, they are posted to the **D.A.T.A Framework backend** for execution, just like in the first approach. The backend handles querying the blockchain data, processes the data, and returns the results in a structured format.
6. **Response Handling**: The response is then provided to the AI agent, and depending on the implementation, it can trigger further actions or display results to the user.

**Example of a Custom AI Agent Prompt and Query Handling in Eliza:**

````javascript
import { onchainDataPlugin } from "@elizaos/plugin-d.a.t.a";

const provider = databaseProvider(runtime);
const schema = provider.getDatabaseSchema();
const examples = provider.getQueryExamples();
const template = provider.getQueryTemplate();

if (!state) {
    state = (await runtime.composeState(message)) as State;
} else {
    state = await runtime.updateRecentMessageState(state);
}

const buildContext = template
    .replace("{{databaseSchema}}", schema)
    .replace("{{queryExamples}}", examples)
    .replace("{{userQuery}}", message.content.text || "");

const context = JSON.stringify({
    user: runtime.agentId,
    content: buildContext,
    action: "fetch_transactions",
});

const preResponse = await generateMessageResponse({
    runtime: runtime,
    context: context,
    modelClass: ModelClass.LARGE,
});

const userMessage = {
    agentId: runtime.agentId,
    roomId: message.roomId,
    userId: message.userId,
    content: message.content,
};

// Save response to memory
const preResponseMessage: Memory = {
    id: stringToUuid(message.id + "-" + runtime.agentId),
    ...userMessage,
    userId: runtime.agentId,
    content: preResponse,
    embedding: getEmbeddingZeroVector(),
    createdAt: Date.now(),
};

await runtime.messageManager.createMemory(preResponseMessage);
await runtime.updateRecentMessageState(state);

// Check for SQL query in the response using class method
const sqlQuery = provider.extractSQLQuery(preResponse);
if (sqlQuery) {
    const analysisInstruction = provider.getAnalysisInstruction();
    try {
        // Call query method on provider
        const queryResult = await provider.query(sqlQuery);

        // Return combined context with query results and analysis instructions
        return `
        # query by user
        ${preResponse.text}

        # query result
        ${JSON.stringify(queryResult, null, 2)}

        # Analysis Instructions
        ${analysisInstruction}
        `;
    } catch (error) {
        elizaLogger.error("Error executing query:", error);
        return context;
    }
} else {
    elizaLogger.log("no SQL query found");
}
return context;
```
````

***

#### **Response Format Handling**

Whether you are using the **D.A.T.A Framework backend** or your own custom AI model to generate queries, the response format is consistent. Here’s what you can expect:

* **SQL Queries**: Executed against the blockchain data sources and returned as JSON with placeholders for results.
* **Key-Value Data**: Specific data points such as balances, transaction counts, or token holdings.
* **Vector Data**: For more advanced use cases, such as AI-powered analysis or machine learning tasks.

The framework is designed to ensure that responses are easy to handle and can be integrated seamlessly into the AI agent's decision-making process.

***

#### **Summary of Approaches**

1. **Using the D.A.T.A Framework Backend**:
   * Automatically generate and execute SQL, key-value, or vector queries based on user input.
   * AI agents can autonomously fetch on-chain data and trigger actions based on that data.
2. **Using Custom AI Models for Query Generation**:
   * Leverage AI models to generate custom queries based on specific prompts.
   * AI agents use these custom queries to interact with the **D.A.T.A Framework backend** for data retrieval, enabling more flexibility and adaptability in querying blockchain data.

Both approaches enable AI agents to query on-chain data effectively, making them more intelligent and autonomous in blockchain-driven decision-making.


# What's Coming with the D.A.T.A Framework

The **D.A.T.A Framework** is designed to unlock a wide array of use cases, empowering AI agents with seamless access to both on-chain and off-chain data. As we continue to expand and enhance the D.A.T.A Framework, we are laying the foundation for new features and integrations that will push the boundaries of what AI agents can achieve in decentralized ecosystems. Below are the key use cases that will soon be available to all D.A.T.A-enabled AI agents:

***

## **Timeline and Future Features**

The following use cases will be rolled out in stages over the next few months. Each phase will bring new capabilities to the D.A.T.A Framework, empowering AI agents with even more autonomy, intelligence, and access to data.

**Phase 1: (Jan2025)**

* On-Chain Activity Alerts
* Autonomous On-Chain Actions (Airdrops, Token Transfers)
* Cross-Chain Insights

**Phase 2: (Feb 2025)**

* Social Media Integration for Enhanced User Profiling by leveraging **CARV ID**
* Swarm of Agents for Modular Data Access

**Phase 3: (March 2025)**

* Memory Sharing Between AI Agents
* Centralized Data Repository for Knowledge Sharing
* Enhanced Querying with AI Model Integration

**Phase 4: (April 2025)**

* Real-Time Analytics for Blockchain Activities
* Customizable Data Fetching and Query Generation
* Risk and Compliance Monitoring

***

With these upcoming features, **D.A.T.A Framework** is set to dramatically enhance the capabilities of AI agents, making them smarter, more autonomous, and capable of interacting with both on-chain and off-chain data at an unprecedented scale. By leveraging the full spectrum of data—from real-time on-chain transactions to off-chain social and market data—AI agents will become far more effective at understanding their environment, making informed decisions, and driving impactful actions.

As we continue to evolve the framework, these use cases will unlock a new era of data-driven, autonomous AI, benefiting not just the agents themselves but the decentralized ecosystem at large.


# API Documentation

This section provides the API details for accessing on-chain data through the **D.A.T.A Framework**. Developers can interact with the Carv backend to perform SQL queries, retrieve blockchain data, and more. The API supports multiple languages, including Shell, HTTP, JavaScript, Ruby, Python, PHP, Java, and Go.

#### Base URLs

* **Carv Interface API URL:**\
  [`https://interface.carv.io/ai-agent-backend/`](https://interface.carv.io/ai-agent-backend/)

***

### **Authentication**

To access the D.A.T.A API, you will need an API key. Please visit our CARV [**Discord channel**](https://discord.gg/fVPc884by4)**,** D.A.T.A [**Discord Channel**](https://discord.gg/AYyfmhMn5K) or contacting the CARV team directly through <developer@carv.io>.

***


# News

### GET News

#### Endpoint

GET /ai-agent-backend/news

#### Params

| Name          | Location | Type   | Required | Description          |
| ------------- | -------- | ------ | -------- | -------------------- |
| Authorization | header   | string | yes      | login token in redis |

#### Example Request (HTTP)

```http
curl -X GET "https://interface.carv.io/ai-agent-backend/news" \
      -H "Content-Type: application/json" \
      -H "Authorization: <YOUR_AUTH_TOKEN>"
```

> Response Examples

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "infos": [
      {
        "title": "Why is XRP price up today?",
        "url": "https://cointelegraph.com/why-is-xrp-price-up-today",
        "card_text": "XRP price is up 3% on Feb. 11, responding to Ripple’s partnership with Unicâmbio and increasing chances of XRP ETF approval."
      },
      {
        "title": "New Bitcoin miner ‘capitulation’ hints at sub-$100K BTC price bottom",
        "url": "https://cointelegraph.com/new-bitcoin-miner-capitulation-sub-100k-btc-price-bottom",
        "card_text": "Bitcoin miners may be pointing the way to a major long-term BTC price rebound."
      },
      {
        "title": "How a simple browser extension prevented an $80K transfer to a malicious wallet",
        "url": "https://cointelegraph.com/how-a-simple-browser-extension-prevented-an-80k-transfer-to-a-malicious-wallet",
        "card_text": "A last-minute alert stops an $80,000 transfer to a terrorist-linked wallet, underscoring the growing need for onchain security."
      },
      {
        "title": "SEC and Binance seek 60-day pause in crypto case",
        "url": "https://cointelegraph.com/binance-sec-case-halt-60-days-crypto-task-force",
        "card_text": "The SEC and Binance filed a joint motion to pause their legal case for 60 days, citing the newly formed SEC Crypto Task Force’s potential impact on regulations."
      },
      {
        "title": "2024 crypto VC deals fell 46% from Q1 to Q4 as investment volume rebounded",
        "url": "https://cointelegraph.com/crypto-vc-deal-count-dropped-46-percent-2024",
        "card_text": "Crypto VC deals dropped 46% from Q1 to Q4, but investment value rebounded in Q4, signaling a shift toward selective, high-value projects, according to PitchBook."
      },
      {
        "title": "Why is Cardano (ADA) price up today?",
        "url": "https://cointelegraph.com/why-is-cardano-ada-price-up-today",
        "card_text": "ADA price is up 15% on Feb. 11, responding to Grayscale’s application for a spot Cardano ETF in the United States."
      },
      {
        "title": "What is a Phantom wallet? How to set up and use it",
        "url": "https://cointelegraph.com/what-is-a-phantom-wallet-how-to-set-up-and-use-it",
        "card_text": "Learn how to set up and use a Phantom wallet, including downloading the extension, creating an account, securing your keys and more."
      },
      {
        "title": "Crypto advocates call for post-Biden clarity on digital asset regulations",
        "url": "https://cointelegraph.com/us-congress-crypto-regulation-hearing-2025",
        "card_text": "Industry leaders at a US congressional subcommittee hearing are set to call for clear digital asset regulations to maintain global competitiveness and attract crypto firms."
      },
      {
        "title": "BNB Chain memecoin platform Four.Meme hit by $183K exploit",
        "url": "https://cointelegraph.com/bnb-chain-memecoin-fourmeme-hacked-183k",
        "card_text": "The memecoin launch platform has temporarily stopped the creation of new liquidity pools while it addresses the exploit."
      },
      {
        "title": "Solo miner snags Bitcoin block reward worth $300K",
        "url": "https://cointelegraph.com/solo-miner-snags-bitcoin-block-reward-worth-300-k",
        "card_text": "Bitcoin rose back above $98,000 after dipping slightly when US President Donald Trump announced tariffs on aluminum and steel as part of an escalating US trade war."
      },
      {
        "title": "Story Protocol confirms public mainnet to launch on Feb. 13",
        "url": "https://cointelegraph.com/story-protocol-public-mainnet-launches-february-13",
        "card_text": "The Web3 IP protocol aims to provide an open market for programmable intellectual property, enabling creators and rights holders to protect their IP."
      },
      {
        "title": "ETF issuer Osprey wants judge to review its failed suit against Grayscale",
        "url": "https://cointelegraph.com/osprey-wants-judge-review-failed-suit-against-grayscale-bitcoin-etf",
        "card_text": "A Connecticut judge handed a win to Grayscale in Osprey Funds’ unfair trade practice suit but now Osprey is asking for that to be reviewed."
      },
      {
        "title": "Crypto’s onboarding tipping point – can verification keep up?",
        "url": "https://cointelegraph.com/crypto-s-onboarding-tipping-point",
        "card_text": "Crypto’s rapid growth brings new risks. As fraud escalates, can verification technology keep pace? AI, biometrics and regulatory shifts shape the future of secure crypto onboarding."
      },
      {
        "title": "Bitcoin, top altcoins are ripping attention from memecoins: Santiment",
        "url": "https://cointelegraph.com/bitcoin-top-altcoins-regaining-attention-heathier-market-cycle-santiment",
        "card_text": "Santiment’s social tracker shows top layer-1 blockchains are dominating 44% of the discussion on social media, while the top six memecoins are at 4%."
      },
      {
        "title": "Swedish fintech giant Klarna will ‘embrace crypto,’ CEO says",
        "url": "https://cointelegraph.com/swedish-fintech-firm-klarna-embrace-crypto",
        "card_text": "Klarna, a Swedish payments firm with 85 million users, is reportedly eyeing a US initial public offering — and its CEO is looking for ideas on how it can integrate digital assets."
      },
      {
        "title": "North Carolina House speaker files bill for state to invest in Bitcoin ETPs",
        "url": "https://cointelegraph.com/north-carolina-files-bill-allow-state-treasurer-to-invest-bitcoin",
        "card_text": "The bill limits investments to Bitcoin exchange-traded products only but includes various state funds such as pensions and insurance."
      },
      {
        "title": "Crypto broker breaks ankles while fleeing kidnappers in Spain",
        "url": "https://cointelegraph.com/crypto-broker-escapes-kidnappers-breaks-ankles-while-fleeing-spain-report",
        "card_text": "A search of the apartment in the Spanish town of Estepona where the broker was held by the kidnappers uncovered two firearms, knives, drugs and over $10,000 in cash."
      },
      {
        "title": "Grayscale, NYSE Arca file to launch US-based spot Cardano ETF",
        "url": "https://cointelegraph.com/grayscale-files-cardano-trust-spot-etf",
        "card_text": "NYSE Arca has filed on behalf of Grayscale to launch the firm’s first-ever standalone Cardano ETF product."
      },
      {
        "title": "Litecoin ETF has 90% chance to get SEC approval in 2025: Analysts",
        "url": "https://cointelegraph.com/litecoin-etf-90-percent-chance-sec-approval-2025",
        "card_text": "Bloomberg ETF analysts say Litecoin regulatory filings have been acknowledged and the SEC likely views it as a commodity."
      },
      {
        "title": "OpenAI’s Altman appears to reject Musk’s $97.4B bid for control",
        "url": "https://cointelegraph.com/openai-sam-altman-rejects-elon-musk-takeover-offer",
        "card_text": "OpenAI’s Sam Altman declined Elon Musk’s reported $100 million offer to buy the AI firm, responding with a simple “no thank you” on X."
      },
      {
        "title": "Here’s what happened in crypto today",
        "url": "https://cointelegraph.com/what-happened-in-crypto-today",
        "card_text": "Need to know what happened in crypto today? Here is the latest news on daily trends and events impacting Bitcoin price, blockchain, DeFi, NFTs, Web3 and crypto regulation."
      },
      {
        "title": "Rep. Waters calls for support on bipartisan stablecoin legislation",
        "url": "https://cointelegraph.com/maxine-waters-bipartisan-stablecoin-legislation",
        "card_text": "US House Financial Services Committee ranking member Maxine Waters suggested lawmakers look to bipartisan stablecoin legislation drafted in the 118th session of Congress."
      },
      {
        "title": "Solana revenues outpace Ethereum, L2s despite market dip",
        "url": "https://cointelegraph.com/solana-outpaces-ethereum-l2s-despite-trading-dip",
        "card_text": "Solana-based app revenues beat Ethereum apps by 10x, according to crypto researcher Aylo."
      },
      {
        "title": "Post-election trading surge bullish for Coinbase earnings: Kaiko",
        "url": "https://cointelegraph.com/election-trading-bullish-coinbase-stock-earnings-kaiko",
        "card_text": "Coinbase is among several top US crypto firms scheduled to report earnings this week."
      },
      {
        "title": "Bitcoin price rallies above $97K as institutional and retail traders’ appetites shrink",
        "url": "https://cointelegraph.com/bitcoin-price-rallies-above-97-k-as-institutional-and-retail-traders-appetites-shrink",
        "card_text": "Bitcoin traders are not slamming the buy button, but most of their concerns are connected to macroeconomic conditions."
      },
      {
        "title": "CFTC announces crypto fraud action after enforcement priorities shift",
        "url": "https://cointelegraph.com/cftc-crypto-fraud-enforcement-priorities",
        "card_text": "Acting CFTC Chair Caroline Pham announced on Feb. 4 that the commission would essentially end its practice of regulation by enforcement."
      },
      {
        "title": "Metaplanet share price rises 4,800% as company stacks BTC",
        "url": "https://cointelegraph.com/metaplanet-shares-rise-btc-reserve-strategy",
        "card_text": "Metaplanet shares have risen 4,800% as the company, known as “Asia’s MicroStrategy,” has stacked Bitcoin."
      },
      {
        "title": "US Treasury sued over DOGE access, lawmakers propose stablecoin bill: Law Decoded",
        "url": "https://cointelegraph.com/us-treasury-sued-over-doge-access-lawmakers-propose-stablecoin-bill-law-decoded",
        "card_text": "The United States’ largest union group sued the Treasury Department, accusing it of unlawfully providing sensitive information to Elon Musk’s DOGE."
      },
      {
        "title": "Web3-focused campaign aims to catapult DePIN into mainstream",
        "url": "https://cointelegraph.com/web3-focused-campaign-aims-to-catapult-depin-into-mainstream",
        "card_text": "A token-backed campaign encouraging users to interact with decentralized infrastructure through real-world tasks is accelerating DePIN’s mainstream adoption."
      },
      {
        "title": "Bitcoin's booming 'permanent holder demand' positions BTC price for $116K",
        "url": "https://cointelegraph.com/bitcoin-booming-permanent-holder-demand-btc-price-116k",
        "card_text": "Bitcoin holders with no record of selling their holdings have increased their BTC reserves during the Trump-led market rally."
      },
      {
        "title": "Crypto betting markets’ huge growth fuels calls for billion-dollar volumes in 2025",
        "url": "https://cointelegraph.com/crypto-betting-markets-huge-growth-fuels-calls-for-billion-dollar-volumes-in-2025",
        "card_text": "Crypto-based prediction markets, casinos and sports betting are reshaping the iGaming sector while generating billions of dollars in trading volume."
      },
      {
        "title": "Tesla Q4 Bitcoin profit highlights BTC collateral opportunity — Crypto execs",
        "url": "https://cointelegraph.com/tesla-q4-bitcoin-profit-btc-collateral-opportunity-execs",
        "card_text": "“Mark-to-market gains, Tesla could use its Bitcoin as collateral to unlock liquidity and hedge against market downturns,” said Gadi Chait, an investment manager at Xapo Bank."
      },
      {
        "title": "USDC hits $56.3B market cap, regains losses from bear market",
        "url": "https://cointelegraph.com/usdc-56bn-market-cap-regains-losses-bear-market",
        "card_text": "Circle’s USDC stablecoin has reached a $56.3 billion market capitalization, erasing losses sustained during the bear market."
      },
      {
        "title": "Alleged hacker behind fake SEC post could forfeit $50K in plea deal",
        "url": "https://cointelegraph.com/sec-hacker-fake-bitcoin-etf-post-plea-agreement",
        "card_text": "The individual who allegedly helped compromise the SEC’s X account to post a fake Bitcoin ETF approval message earned roughly $50,000 that he could now be forced to forfeit."
      },
      {
        "title": "Ethereum short positions surge 500% as hedge funds bet on decline",
        "url": "https://cointelegraph.com/ethereum-hedge-funds-short-bets-price-struggles",
        "card_text": "Ethereum may also lack fundamental blockchain activity for an Ether price recovery, analysts told Cointelegraph."
      },
      {
        "title": "ZK identity project Holonym acquires Gitcoin Passport for $10M",
        "url": "https://cointelegraph.com/zk-identity-holonym-acquire-gitcoin-passport-10-million",
        "card_text": "Following the acquisition, Holonym plans to offer its rebranded Human Passport to users worldwide."
      },
      {
        "title": "Web3 growth will be synonymous with Ethereum growth",
        "url": "https://cointelegraph.com/web3-growth-and-ethereum-growth",
        "card_text": "Ethereum is the key to driving Web3 growth, thanks to its robust ecosystem, the rise of layer 2 rollups, and the Superchain’s potential."
      },
      {
        "title": "Bitcoin teases gains as traders say $100K now key support reclaim",
        "url": "https://cointelegraph.com/bitcoin-teases-upside-traders-100k-essential-support-reclaim",
        "card_text": "BTC price momentum is still lacking as the active Bitcoin trading range gets ever narrower."
      },
      {
        "title": "Michael Saylor’s Strategy bags first Bitcoin purchase under new name",
        "url": "https://cointelegraph.com/michael-saylor-s-strategy-makes-first-bitcoin-acquisition-under-new-name",
        "card_text": "Strategy’s fresh 7,633-BTC purchase came days after the firm rebranded from “MicroStrategy” last week."
      },
      {
        "title": "Central African Republic ‘CAR’ memecoin info pages plagued with phishing links",
        "url": "https://cointelegraph.com/car-memecoin-crypto-scam-phishing-links",
        "card_text": "Investors may find themselves clicking on malicious links while researching the controversial Central African Republic memecoin."
      }
    ]
  }
}
```

> 400 Response

```json
{
  "error": "string"
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description | Data schema |
| ---------------- | ---------------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | none        | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | none        | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name           | Type      | Required | Restrictions | Title | description |
| -------------- | --------- | -------- | ------------ | ----- | ----------- |
| » code         | integer   | true     | none         |       | none        |
| » msg          | string    | true     | none         |       | none        |
| » data         | object    | true     | none         |       | none        |
| »» infos       | \[object] | true     | none         |       | none        |
| »»» title      | string    | true     | none         |       | none        |
| »»» url        | string    | true     | none         |       | none        |
| »»» card\_text | string    | true     | none         |       | none        |

HTTP Status Code **400**

| Name    | Type   | Required | Restrictions | Title | description |
| ------- | ------ | -------- | ------------ | ----- | ----------- |
| » error | string | true     | none         |       | none        |

## Data Schema


# On-chain Data SQL Query

## Schema

If you want to leverage LLM to generate sql queries, you can refer to below schemas as prompt to the LLM:

1. [Ethereum Schema](/d.a.t.a.-ai-framework/api-documentation/on-chain-data-sql-query/ethereum-schema)
2. [BTC Schema](/d.a.t.a.-ai-framework/api-documentation/on-chain-data-sql-query/bitcoin-schema)
3. [Base Schema](/d.a.t.a.-ai-framework/api-documentation/on-chain-data-sql-query/base-schema)
4. [Solana Schema](/d.a.t.a.-ai-framework/api-documentation/on-chain-data-sql-query/solana-schema)

### **POST /ai-agent-backend/sql\_query**

This endpoint allows you to send SQL queries to the CARV backend to fetch on-chain data.

#### **Request Parameters**

| Name         | Location | Type   | Required | Description                   |
| ------------ | -------- | ------ | -------- | ----------------------------- |
| sql\_content | Body     | string | Yes      | The SQL query to be executed. |

#### **Example Request**

```http
curl -X POST https://interface.carv.io/ai-agent-backend/sql_query \
     -H "Content-Type: application/json" \
     -H "Authorization: <YOUR_AUTH_TOKEN>" \
     -d '{"sql_content":"WITH address_activity AS (SELECT from_address AS address, COUNT(*) AS tx_count FROM eth.transactions WHERE date_parse(date, '\''%Y-%m-%d'\'') >= date_add('\''month'\'', -3, current_date) GROUP BY from_address UNION ALL SELECT to_address AS address, COUNT(*) AS tx_count FROM eth.transactions WHERE date_parse(date, '\''%Y-%m-%d'\'') >= date_add('\''month'\'', -3, current_date) GROUP BY to_address) SELECT address, SUM(tx_count) AS total_transactions FROM address_activity GROUP BY address ORDER BY total_transactions DESC LIMIT 1;"}'
```

#### **Example Response**

**200 OK Response**

```json
{
    "code": 0,
    "msg": "Success",
    "data": {
        "column_infos": [
            "address",
            "total_transactions"
        ],
        "rows": [
            {
                "items": [
                    "0xdac17f958d2ee523a2206206994597c13d831ec7",
                    "11021156"
                ]
            }
        ]
    }
}
```

**400 Bad Request Response**

```json
{
  "error": "Invalid SQL query."
}
```

#### **Response Status Codes**

| Status Code | Description | Data Model |
| ----------- | ----------- | ---------- |
| 200         | OK          | Inline     |
| 400         | Bad Request | Inline     |

#### **Response Data Structure**

**200 OK**

<table><thead><tr><th>Field</th><th width="97">Type</th><th>Required</th><th>Constraints</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>integer</td><td>Yes</td><td>None</td><td>Status code.</td></tr><tr><td>msg</td><td>string</td><td>Yes</td><td>None</td><td>Response message.</td></tr><tr><td>data</td><td>object</td><td>Yes</td><td>None</td><td>Data from the query.</td></tr><tr><td>column_infos</td><td>array</td><td>Yes</td><td>None</td><td>Column headers of data.</td></tr><tr><td>rows</td><td>array</td><td>Yes</td><td>None</td><td>Query result rows.</td></tr></tbody></table>

**400 Bad Request**

| Field | Type   | Required | Constraints | Description    |
| ----- | ------ | -------- | ----------- | -------------- |
| error | string | Yes      | None        | Error message. |


# Ethereum Schema

### Blocks

```sql
CREATE EXTERNAL TABLE `eth.blocks`(
  `timestamp` timestamp, 
  `number` bigint, 
  `hash` string, 
  `parent_hash` string, 
  `nonce` string, 
  `sha3_uncles` string, 
  `logs_bloom` string, 
  `transactions_root` string, 
  `state_root` string, 
  `receipts_root` string, 
  `miner` string, 
  `difficulty` double, 
  `total_difficulty` double, 
  `size` bigint, 
  `extra_data` string, 
  `gas_limit` bigint, 
  `gas_used` bigint, 
  `transaction_count` bigint, 
  `base_fee_per_gas` bigint)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/blocks'
TBLPROPERTIES (
)
```

### Transactions

```sql
CREATE EXTERNAL TABLE `eth.transactions`(
  `hash` string, 
  `nonce` bigint, 
  `transaction_index` bigint, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `gas` bigint, 
  `gas_price` bigint, 
  `input` string, 
  `receipt_cumulative_gas_used` bigint, 
  `receipt_gas_used` bigint, 
  `receipt_contract_address` string, 
  `receipt_root` string, 
  `receipt_status` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string, 
  `max_fee_per_gas` bigint, 
  `max_priority_fee_per_gas` bigint, 
  `transaction_type` bigint, 
  `receipt_effective_gas_price` bigint)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/transactions'
TBLPROPERTIES (
)
```

### Contracts

```sql
CREATE EXTERNAL TABLE `eth.contracts`(
  `address` string, 
  `bytecode` string, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/contracts'
TBLPROPERTIES (
)
```

### Logs

```sql
CREATE EXTERNAL TABLE `eth.logs`(
  `log_index` bigint, 
  `transaction_hash` string, 
  `transaction_index` bigint, 
  `address` string, 
  `data` string, 
  `topics` array<string>, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/logs'
TBLPROPERTIES (
)
```

### Token\_transfers

```sql
CREATE EXTERNAL TABLE `eth.token_transfers`(
  `token_address` string, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `transaction_hash` string, 
  `log_index` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/token_transfers'
TBLPROPERTIES (
)
```

### Traces

```sql
CREATE EXTERNAL TABLE `eth.traces`(
  `transaction_hash` string, 
  `transaction_index` bigint, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `input` string, 
  `output` string, 
  `trace_type` string, 
  `call_type` string, 
  `reward_type` string, 
  `gas` double, 
  `gas_used` double, 
  `subtraces` bigint, 
  `trace_address` string, 
  `error` string, 
  `status` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string, 
  `trace_id` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/traces'
TBLPROPERTIES (
)
```


# Bitcoin Schema

### Blocks

```sql
CREATE EXTERNAL TABLE `btc.blocks`(
  `hash` string, 
  `size` bigint, 
  `stripped_size` bigint, 
  `weight` bigint, 
  `number` bigint, 
  `version` bigint, 
  `merkle_root` string, 
  `timestamp` timestamp, 
  `nonce` bigint, 
  `bits` string, 
  `coinbase_param` string, 
  `transaction_count` bigint, 
  `mediantime` timestamp, 
  `difficulty` double, 
  `chainwork` string, 
  `previousblockhash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/btc/blocks'
TBLPROPERTIES (
) 
```

### Transactions

```sql
CREATE EXTERNAL TABLE `transactions`(
  `hash` string, 
  `size` bigint, 
  `virtual_size` bigint, 
  `version` bigint, 
  `lock_time` bigint, 
  `block_hash` string, 
  `block_number` bigint, 
  `block_timestamp` timestamp, 
  `index` bigint, 
  `input_count` bigint, 
  `output_count` bigint, 
  `input_value` double, 
  `output_value` double, 
  `is_coinbase` boolean, 
  `fee` double, 
  `inputs` array<struct<index:bigint,spent_transaction_hash:string,spent_output_index:bigint,script_asm:string,script_hex:string,sequence:bigint,required_signatures:bigint,type:string,address:string,value:double>>, 
  `outputs` array<struct<index:bigint,script_asm:string,script_hex:string,required_signatures:bigint,type:string,address:string,value:double>>)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/btc/transactions'
TBLPROPERTIES (
)
```


# Base Schema

### Blocks

```sql
CREATE EXTERNAL TABLE IF NOT EXISTS sonarx_base.blocks (
  block_number DECIMAL(38, 0),
  timestamp DECIMAL(38, 0),
  datetime TIMESTAMP,
  block_hash STRING,
  block_parent_hash STRING,
  nonce DECIMAL(38, 0),
  sha3_uncles STRING,
  logs_bloom STRING,
  transactions_root STRING,
  state_root STRING,
  receipts_root STRING,
  miner STRING,
  mix_hash STRING,
  extra_data STRING,
  difficulty DECIMAL(38, 0),
  total_difficulty DECIMAL(38, 0),
  size DECIMAL(38, 0),
  gas_limit DECIMAL(38, 0),
  gas_used DECIMAL(38, 0),
  transaction_count DECIMAL(38, 0),
  base_fee_per_gas DECIMAL(38, 0),
  blob_gas_used DECIMAL(38, 0),
  excess_blob_gas DECIMAL(38, 0),
  parent_beacon_block_root STRING,
  withdrawals_root STRING,
  withdrawal_count DECIMAL(38, 0),
  date_created TIMESTAMP,
  date_updated TIMESTAMP)
PARTITIONED BY (
  `date` STRING)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION 's3://aws-public-blockchain/v1.1/sonarx/base/blocks'
TBLPROPERTIES (
);
```

### Transactions

```sql
CREATE EXTERNAL TABLE IF NOT EXISTS sonarx_base.`transactions` (
  block_number DECIMAL(38, 0),
  datetime TIMESTAMP,
  `timestamp` DECIMAL(38, 0),
  transaction_hash STRING,
  transaction_index DECIMAL(38, 0),
  nonce DECIMAL(38, 0),
  block_hash STRING,
  from_address STRING,
  to_address STRING,
  value DOUBLE,
  transaction_fee DOUBLE,
  gas_price DOUBLE,
  gas_price_gwei DOUBLE,
  effective_gas_price DOUBLE,
  effective_gas_price_gwei DOUBLE,
  max_fee_per_gas DOUBLE,
  max_fee_per_gas_gwei DOUBLE,
  max_priority_fee_per_gas DOUBLE,
  max_priority_fee_per_gas_gwei DOUBLE,
  gas_limit DECIMAL(38, 0),
  gas_used DECIMAL(38, 0),
  gas_used_pct DECIMAL(38, 6),
  cumulative_gas_used DECIMAL(38, 0),
  input STRING,
  transaction_type DECIMAL(38, 0),
  contract_address STRING,
  status DECIMAL(38, 0),
  source_value DOUBLE,
  deposit_receipt_version DECIMAL(38, 0),
  mint DECIMAL(38, 0),
  source_hash STRING,
  y_parity DECIMAL(38, 0),
  l1_gas_price DOUBLE,
  l1_gas_price_gwei DOUBLE,
  l1_gas_used DECIMAL(38, 0),
  l1_fee_scalar DOUBLE,
  l1_fee DOUBLE,
  l2_fee DOUBLE,
  deposit_nonce DECIMAL(38, 0),
  date_created TIMESTAMP,
  date_updated TIMESTAMP)
PARTITIONED BY (
  `date` STRING)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION 's3://aws-public-blockchain/v1.1/sonarx/base/transactions'
TBLPROPERTIES (
);
```


# Solana Schema

### Blocks

```sql
CREATE EXTERNAL TABLE IF NOT EXISTS solana.blocks(
    slot bigint,
    block_hash string,
    block_timestamp timestamp,
    height bigint,
    previous_block_hash string,
    transaction_count bigint,
    leader_reward DECIMAL(38, 0),
    leader string
)
PARTITIONED BY (
  `date` STRING)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION 's3://carv-dev-blockchain/solana/v1.0/blocks'
TBLPROPERTIES (
);
```


# On-chain Data SQL Query by LLM

### **POST /ai-agent-backend/sql\_query\_by\_llm**

This endpoint allows you to use the nature language to query the on-chain data. Behind the scean, CARV will use LLM model to interpreate the nature language input and convert into the sql query based on the above schemas.

#### Params

| Name          | Location | Type   | Required | Description                     |
| ------------- | -------- | ------ | -------- | ------------------------------- |
| question      | query    | string | no       | ask question, return sql result |
| Authorization | header   | string | yes      | login token in redis            |
| body          | body     | object | no       | none                            |
| » question    | body     | string | yes      | none                            |

#### **Example Request**

```http
curl -X POST https://interface.carv.io/ai-agent-backend/sql_query_by_llm \
     -H "Content-Type: application/json" \
     -H "Authorization: <YOUR_AUTH_TOKEN>" \
     -d '{"question":"What's the most active address on Ethereum during the last 24 hours?"}'
```

> Response Examples

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "column_infos": [
      "hash",
      "nonce",
      "transaction_index",
      "from_address",
      "to_address",
      "value",
      "gas",
      "gas_price",
      "input",
      "receipt_cumulative_gas_used",
      "receipt_gas_used",
      "receipt_contract_address",
      "receipt_root",
      "receipt_status",
      "block_timestamp",
      "block_number",
      "block_hash",
      "max_fee_per_gas",
      "max_priority_fee_per_gas",
      "transaction_type",
      "receipt_effective_gas_price",
      "date"
    ],
    "rows": [
      {
        "items": [
          "0x21a577613807eded967575e6350f927071ff440b1013067fe8fe738bf2e9cb7a",
          "317711",
          "0",
          "0xca74f404e0c7bfa35b13b511097df966d5a65597",
          "0x111111125421ca6dc452d289314280a0f8842a65",
          "0.0",
          "296049",
          "899984959",
          "0x07ed23790000000000000000000000005141b82f5ffda4c6fe1e372978f1c5427640a190000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f20000000000000000000000005141b82f5ffda4c6fe1e372978f1c5427640a190000000000000000000000000ca74f404e0c7bfa35b13b511097df966d5a65597000000000000000000000000000000000000000000000000011c37937e0800000000000000000000000000000000000000000000000000000000b7ae8e38ec310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000005180000000000000000000000000000000000000000000004fa0004cc00003c4101c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000496066a9893cc07d91d95644aedd05d03f95e1dba8afeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee02e424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060b0e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b5dcfc56c65f0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000111111125421ca6dc452d289314280a0f8842a6500000000000000000000000000000000000000000000000000000000000000000020d6bdbf78851f679a5edfb16e7cf1ad157c6995b7e7f333f2111111125421ca6dc452d289314280a0f8842a650000000000000000fb39cfb5",
          "174546",
          "174546",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "1217100000",
          "100000000",
          "2",
          "899984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xbc5d47d72f253617b4bd1534b93cf39ae1678dd2866989171e2d04157692685d",
          "135",
          "25",
          "0xdbb4754bedb8c28e7e7b25e4b85565b7fbcad1da",
          "0x267be1c1d684f78cb4f6a176c4911b741e4ffdc0",
          "1.19987609121647693E18",
          "21000",
          "5799984959",
          "0x",
          "4615886",
          "21000",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "5900418263",
          "5000000000",
          "2",
          "5799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x42d86916e29412544b4446ce2254322da8b5027961651fae0faee66e5e5e4eeb",
          "1010",
          "2",
          "0x61c1162e6632b9055d154479fcebd161073f9279",
          "0xa4eddfe4ba5143ac17fd6bc1e53de0384df8c660",
          "0.0",
          "230709",
          "888984959",
          "0x3df0212400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000016790dd900000000000000000000000000000000000000000000000000000000165becdd6",
          "1557147",
          "161293",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "1570000000",
          "89000000",
          "2",
          "888984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x8784a6c97ce5e78a7cda2c9eca060e7eaeb603e934491a28734c184c75dca150",
          "5559827",
          "26",
          "0xf89d7b9c864f589bbf53a82105107622b35eaa40",
          "0x09395a2a58db45db0da254c7eaa5ac469d8bdc85",
          "0.0",
          "90000",
          "2799984959",
          "0xa9059cbb000000000000000000000000daa04b6651ef21bab01f2ce74f7a5065637f7ba7000000000000000000000000000000000000000000000077107e104249bc6000",
          "4667310",
          "51424",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "200000000000",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xdf2a300d11032a4b028f39c4a26d5d4f0f1a99261fcb6a3365e6a624cf682bb8",
          "8",
          "11",
          "0x50d2cf05d98d8e7140392c53a92413be6b198e4a",
          "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "0.0",
          "50834",
          "5818692699",
          "0xa9059cbb0000000000000000000000001ca5aa5b1dd8d948bb0971a5fb1762fe172e0040000000000000000000000000000000000000000000000000000000002474f9a8",
          "3882838",
          "41297",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "0",
          "5818692699",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xf8133fe59e596dc04814882afe36c77232ef8975bd0972225b5e6aa069b92b4a",
          "8",
          "23",
          "0x84188654266f8a1fc6829e2034b08140dca6db40",
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "0.0",
          "65147",
          "2799984959",
          "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
          "4573886",
          "55846",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2840390378",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xee4a69a9d618b77e483e6d5225c57d83e520f1db55a2f86708bedd34d55c0736",
          "247135",
          "6",
          "0xb0ba33566bd35bcb80738810b2868dc1ddd1f0e9",
          "0xe592427a0aece92de3edee1f18e0157c05861564",
          "0.0",
          "600000",
          "7032887706",
          "0xc04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000b0ba33566bd35bcb80738810b2868dc1ddd1f0e90000000000000000000000000000000000000000000000000000000067abe5a300000000000000000000000000000000000000000000000007cb23e938256c0000000000000000000000000000000000000000000000000000000000f0e77f45000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2002710d7efb00d12c2c13131fd319336fdf952525da2af000000000000000000000000000000000000000000",
          "2894327",
          "137116",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "26415305982",
          "6232902747",
          "2",
          "7032887706",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x86ac42fff13882c5407a17ff7f5bf6fa6669e3aef838006b405b71a28dfc5e8f",
          "79",
          "27",
          "0x79b3bf3e5d8b72f83f00fa843aa3e2c742486f12",
          "0xb612bfc5ce2fb1337bd29f5af24ca85dbb181ce2",
          "0.0",
          "47594",
          "2799984959",
          "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
          "4714520",
          "47210",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "3716331977",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xc1c000a4ae818449b84b046d23d307067ed8e76ffca3e9bcb49694696e9e2a58",
          "0",
          "12",
          "0xc373dfcea18132f4ccaa36c974a9abcc4028e008",
          "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "0.0",
          "50834",
          "5818692699",
          "0xa9059cbb0000000000000000000000001ca5aa5b1dd8d948bb0971a5fb1762fe172e00400000000000000000000000000000000000000000000000000000000024a69f3d",
          "3924135",
          "41297",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "0",
          "5818692699",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xbf1f2d155360b5b34918afdf7ddd0e7547a629bf7ac40f5eb3ee42b3435f93b3",
          "84402",
          "24",
          "0x2703983059c7b60515b4fab6fb8b301f7781f5c6",
          "0xd411315c5de4ebe8530676e60de71902cb60307a",
          "2.2435525873547E14",
          "21000",
          "5818692699",
          "0x",
          "4594886",
          "21000",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "0",
          "5818692699",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x077f149341fe548076033010ce8d4ce210eec4a8bfe717e8e7d54934e5ff335c",
          "3156",
          "4",
          "0x7257dd87d9250fcfaa9b838efd5f42bcd42f7525",
          "0x881d40237659c251811cec9c364ef91dc08d300c",
          "0.0",
          "356010",
          "2799984959",
          "0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000002bca234a7248aa825d65e9e737a27f1a2c8e5df90000000000000000000000000000000000000000000000000429d069189e000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563546656544796e616d69630000000000000000000000000000000000000000000000000000000000000000000000000000000000000002200000000000000000000000002bca234a7248aa825d65e9e737a27f1a2c8e5df900000000000000000000000084dbfc16e8c8c237d8a94b5db1850b496c9986010000000000000000000000000000000000000000000000000429d069189e000000000000000000000000000000000000000000000000000000130ba7b0a9901a000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002acf35c9a3f4c5c3f4c78ef5fb64c3ee82f07c45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e80502b1c50000000000000000000000002bca234a7248aa825d65e9e737a27f1a2c8e5df90000000000000000000000000000000000000000000000000429d069189e000000000000000000000000000000000000000000000000000000130ba7b0a9901a0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000200000000000000003b6d034045e98d18ec8f6aa04347234505e9d67942028daa80000000000000003b6d03403415a2e1cbef32014ed89c95be580ae6f4f0ec417dcbea7c00000000000000000000000000000000000000000000000001ed",
          "1988463",
          "269696",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "3707129120",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xf2a95ba605a5cbedca713cf78b38e3b332a279f2ea47520986dbb6925c8a811a",
          "312898",
          "10",
          "0xc16157e00b1bff1522c6f01246b4fb621da048d0",
          "0x45118b56d5066a6352d78d15f795cfab33c4def3",
          "1.9418545E17",
          "342197",
          "1547046685",
          "0xae4e0a18000000000000000000000000cb2c9050769bcb7b2c6f8498ebe4f7d42a673565000000000000000000000000000000000000000000000000000000000000518c0000000000000000000000000000000000000000000000000000000000000001",
          "3841541",
          "306729",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "0",
          "1547046685",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x7aebbdc6ae3ca900397dcf63770ea71ac48207b5aee48e1cca9f1217c3a3406a",
          "2793688",
          "18",
          "0x89e51fa8ca5d66cd220baed62ed01e8951aa7c40",
          "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "0.0",
          "500000",
          "2799984959",
          "0xa9059cbb000000000000000000000000c8a5197c1695f018e1a682c41588f89a2c9c74e6000000000000000000000000000000000000000000000000000000009368ac48",
          "4275402",
          "63209",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "5050484368",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xe3295c1243a650a87b73479b6ef2ba7e8b9a4f50a930af0cdca05ad67f6b9584",
          "3",
          "22",
          "0xfef572c866ac127342aef3681475eadce7f6d776",
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "0.0",
          "65147",
          "2799984959",
          "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
          "4518040",
          "55846",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2876759249",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xbf4fc7f7cbac0a83500342a0c1b8dc8f48610ea92ccf8c39f66e29c41c136182",
          "2203470",
          "14",
          "0x264bd8291fae1d75db2c5f573b07faa6715997b5",
          "0xb24c2bfd8c1a113ab11d02d4bc5c2a5b66ca2a90",
          "7.874884E16",
          "500000",
          "10000000000",
          "0x",
          "3966135",
          "21000",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "1",
          "10000000000",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xb7cb81705c5f882b383ab4c42a2588648cf2ad80c1804a417e52e5d2f21b33f4",
          "80",
          "28",
          "0x79b3bf3e5d8b72f83f00fa843aa3e2c742486f12",
          "0x881d40237659c251811cec9c364ef91dc08d300c",
          "0.0",
          "265789",
          "2799984959",
          "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000b612bfc5ce2fb1337bd29f5af24ca85dbb181ce200000000000000000000000000000000000000000000000000003755ef35a1fe00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563546656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b612bfc5ce2fb1337bd29f5af24ca85dbb181ce2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003755ef35a1fe000000000000000000000000000000000000000000000000009e30553524a9e9000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000016cc41f60ab9d000000000000000000000000f326e4de8f66a0bdc0970b79e0924e33c79f1915000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c80502b1c5000000000000000000000000b612bfc5ce2fb1337bd29f5af24ca85dbb181ce200000000000000000000000000000000000000000000000000003755ef35a1fe000000000000000000000000000000000000000000000000009f95cdba4b14a70000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000140000000000000003b6d03408a85f9384c37ecc64d33c37e490d7b4e5951cb597dcbea7c00000000000000000000000000000000000000000000000000b4",
          "4925948",
          "211428",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "3716331977",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x09b04fcf0de63fda2c660030f3f4030f5e0de4117d540bc6259363f66e71d967",
          "164",
          "13",
          "0x4f74b62efa4bd1958f1ed6a059373f6702a25a61",
          "0xb43c1981d57161dcb077ee4bcbb2d376b577a857",
          "7.9287237742658032E16",
          "21000",
          "10000000000",
          "0x",
          "3945135",
          "21000",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "0",
          "0",
          "0",
          "10000000000",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x5e6d46916393927206920fa857f6b7316fd4023a4d629ac093b8a6e768b9df9f",
          "254",
          "21",
          "0x11acce523d02f9322e8b93cf4c8f2d91a27dfd00",
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "0.0",
          "80000",
          "2799984959",
          "0xa9059cbb0000000000000000000000009d133466a9093b9aa026cc0e018079bdf50dd61300000000000000000000000000000000000000000000000000000000bec3c319",
          "4462194",
          "62260",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "6875000000",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x181ff1b057a7a9082d57c4b65ac117c5719fac34dd8a34d2154bb42f9149a869",
          "4205170",
          "5",
          "0xae2fc483527b8ef99eb5d9b44875f005ba1fae13",
          "0x1f2f10d1c40777ae1da742455c65828ff36df387",
          "127.0",
          "1098211",
          "18894070801",
          "0x2bd000000000efe302beaa2b3e6e1b18d08d69a9012a0044a9059cbb000000000000000000000000a4eddfe4ba5143ac17fd6bc1e53de0384df8c6600000000000000000000000000000000000000000000000000000000088982bd1d0a4eddfe4ba5143ac17fd6bc1e53de0384df8c66000847e3db030000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088982bd1000000000000000000000000000000000000000000000000000000008a270000b0dac17f958d2ee523a2206206994597c13d831ec7b6bebc44782c7db0a1a60cb6fe97d0b483032ff1c75f0146e8f67a01294700020000d083f20f44975d03b1b09e64809b757c47f942beea00446e553f65000000000000000000000000000000000000000000000129479b000000000000000000000000000000000000ce6431d21e3fb1036ce9973a3312368ed96f5ce7d0ce6431d21e3fb1036ce9973a3312368ed96f5ce700a4afb4301200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103841700000000000000000000000000000000000000000000000000000000012a0000000000000000000000000000000000000000f5d7c5484c02c03cf131b76c67c3eb969828bd3dd0f5d7c5484c02c03cf131b76c67c3eb969828bd3d00a4afb430120000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012a6c540000000000000000000000000000000000000000000000000000000000000000000147000000000000000000000000000000a4eddfe4ba5143ac17fd6bc1e53de0384df8c660d0a4eddfe4ba5143ac17fd6bc1e53de0384df8c66000847e3db030000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000147b67e000000000000000000000000000000000000000000000000000000000147000000883ac8f69a9b46b235de8d0b77c355fff7994f1b090f223cdbe11c0123502e8b3d84dbfc16e8c8c237d8a94b5db1850b496c9986010c4efb4c3d348aad7f06",
          "2757211",
          "768748",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "18894070801",
          "18894070800",
          "2",
          "18894070801",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xcdb4fbf60f39824ce3adc182b5e0f16814b2a1a27b7d5f8131ba78f9d6059860",
          "60",
          "9",
          "0xa92fcd2e64f3092b3d47f0fdb1ad209dc06f04b0",
          "0x0000000000000068f116a894984e2db1123eb395",
          "0.0",
          "359154",
          "1769984959",
          "0xf2d12b1200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000ae00000000000000000000000000000000000000000000000000000000000000be0000000000000000000000000a92fcd2e64f3092b3d47f0fdb1ad209dc06f04b000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000520000000000000000000000000000000000000000000000000000000000000058000000000000000000000000064fa8a3af8624edc7b61a7ac8ad42bd1fcae2218000000000000000000000000000056f7000000ece9003ca63978907a00ffd1000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000067abe18c0000000000000000000000000000000000000000000000000000000067abe63c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000005000000000000000000000000875427563cc7e083e55f0abee7edc10f649e8e5b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000064fa8a3af8624edc7b61a7ac8ad42bd1fcae22180000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b5e620f480000000000000000000000000000000000000000000000000000000b5e620f480000000000000000000000000000000a26b00c1f0df003000390027140000faa7190000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d79883d200000000000000000000000000000000000000000000000000000002d79883d2000000000000000000000000000045295985e074fd1e08c99363d961f9da3e335e970000000000000000000000000000000000000000000000000000000000000040d2c976c3e82de18a7dbb03f2fad716d4e0f039eada59514e09ceaf9ccb4de2c885eda5f41e172f589b7e0e0f12e3845f21eb99627e64d5047a0d0db52ab810a1000000000000000000000000000000000000000000000000000000000000007e00a92fcd2e64f3092b3d47f0fdb1ad209dc06f04b00000000067abe59dfcba301b82cbf4a10102bdb70dca44a4fba024a493dd317b32276199106aba82b40637483d3ea12bf7d27f70d5fda7e3d7ae46a0c7c4e75e1074fe4023ecc809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000a92fcd2e64f3092b3d47f0fdb1ad209dc06f04b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000067abe18c0000000000000000000000000000000000000000000000000000000067abe63c0000000000000000000000000000000000000000000000000000000000000000360c6ebe0000000000000000000000000000000000000000cbfd7b6358e0cd530000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000875427563cc7e083e55f0abee7edc10f649e8e5b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006379da05b60000000000000000000000000000000000000000000000000000006379da05b6000000000000000000000000000a92fcd2e64f3092b3d47f0fdb1ad209dc06f04b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000360c6ebe",
          "3534812",
          "270521",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2031388975",
          "970000000",
          "2",
          "1769984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x0f1db0de7f051d548661b7b82993d464a6548a5bbc73aaed50013b9cebe12861",
          "547",
          "17",
          "0x0dfbdd0db899225d1ddcd3d8500ce033b0ed3209",
          "0x984914e05ac56781b5ebf33f288e89e4f038251a",
          "8.108955E15",
          "21000",
          "6875000000",
          "0x",
          "4212193",
          "21000",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "6875000000",
          "6875000000",
          "2",
          "6875000000",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x0b3cf1212aa205ae366b8e6efff5f9a9e4a3504d8eceebc534ab940a23475f7e",
          "3139",
          "20",
          "0x3d49f87ebf1354b196b665bb5dbefc39f2b5caef",
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "0.0",
          "200000",
          "2799984959",
          "0xa9059cbb000000000000000000000000f93b1386ee6050f057e20a240342537530ce7f070000000000000000000000000000000000000000000000000000000026be3680",
          "4399934",
          "62260",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "4000000000",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x453d3752cdd1723fa32c1500e66c4e82e3bcfe4d2c06af8c53bb1d591f15119e",
          "4205169",
          "1",
          "0xae2fc483527b8ef99eb5d9b44875f005ba1fae13",
          "0x1f2f10d1c40777ae1da742455c65828ff36df387",
          "127.0",
          "1744725",
          "799984959",
          "0x2bd0dac17f958d2ee523a2206206994597c13d831ec70044a9059cbb000000000000000000000000a4eddfe4ba5143ac17fd6bc1e53de0384df8c6600000000000000000000000000000000000000000000000000000000088630170d0a4eddfe4ba5143ac17fd6bc1e53de0384df8c66000847e3db03000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000008863017000000000000000000000000000000000000000000000000000000000889800002f5d52dbd001351ba02fe2e58f64eba572bf0ac994a0fd0024f1c0f31fbeac7dd066686a29d3dba55e6c2afce44c961dd2b87af79a0044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000001fbeac7c0000000000d0000000000022d473030f116ddee9f6b43ac78ba3008487517c4500000000000000000000000066686a29d3dba55e6c2afce44c961dd2b87af79a00000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000ff0000000000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000002000000000000000000000000066686a29d3dba55e6c2afce44c961dd2b87af79a000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000001fbeac7c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000066686a29d3dba55e6c2afce44c961dd2b87af79a00000000000000000000000000000000000000000000001fbeac7c00000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000036f900000000d0851f679a5edfb16e7cf1ad157c6995b7e7f333f20044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000036f9d01b0000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036f9d01b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000036f9d01b0000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055a50000000000acc855a512cb2f5d1d495601351d1d91389b2aa45c388c4d02eb39a7726d02a71d18117cc451d0698b1d54e936b9f772b8f58447194bbc82ec19330044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba300000000000000000000000000000000000000000000000000117cc450000000d0000000000022d473030f116ddee9f6b43ac78ba3008487517c45000000000000000000000000698b1d54e936b9f772b8f58447194bbc82ec193300000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000ff0000000000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000698b1d54e936b9f772b8f58447194bbc82ec1933000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000117cc4500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000698b1d54e936b9f772b8f58447194bbc82ec193300000000000000000000000000000000000000000000000000117cc4500000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000013ca00000000d0851f679a5edfb16e7cf1ad157c6995b7e7f333f20044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000013caf51e0000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013caf51e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000013caf51e000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e5a0000000000acc81e5a851e2f5d0baa3701351cc6c8f121f6b56896628a7b15c1fcde6d395b908aaf6bae45d067c4d14861f9c975d004cfb3ac305bee673e996e0044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000af6bae4400000000d0000000000022d473030f116ddee9f6b43ac78ba3008487517c4500000000000000000000000067c4d14861f9c975d004cfb3ac305bee673e996e00000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000ff0000000000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000002000000000000000000000000067c4d14861f9c975d004cfb3ac305bee673e996e000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000af6bae4400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000067c4d14861f9c975d004cfb3ac305bee673e996e000000000000000000000000000000000000000000000000af6bae44000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f20000000000000000000000000000000000000000000000000000082f00000000d0851f679a5edfb16e7cf1ad157c6995b7e7f333f20044095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000000000000000000000000000000082f65860000d066a9893cc07d91d95644aedd05d03f95e1dba8af042424856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082f658600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000851f679a5edfb16e7cf1ad157c6995b7e7f333f20000000000000000000000000000000000000000000000000000082f6586000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c7a0000000000acccc7ab5e9f0b3afdb676331a4b37689b2ea12f14ff895b640a4379223cdbe25c0121c6310b1d3415a2e1cbef32014ed89c95be580ae6f4f0ec410c4efb4d5d3333f88006",
          "1395854",
          "1221308",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "799984959",
          "1",
          "2",
          "799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xf460fc538366f3e51b2a0157ae216190ef816cd86c6f61872f73506376685d4a",
          "13",
          "3",
          "0xbd7da806827cae10f2e14a08a26c99329ba644c7",
          "0x66a9893cc07d91d95644aedd05d03f95e1dba8af",
          "1.85137889197943872E17",
          "247386",
          "878984959",
          "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067abeb8000000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000291bdede81bec38000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000291bdede81bec38000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c8f69a9b46b235de8d0b77c355fff7994f1b090f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c8f69a9b46b235de8d0b77c355fff7994f1b090f000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c8f69a9b46b235de8d0b77c355fff7994f1b090f000000000000000000000000bd7da806827cae10f2e14a08a26c99329ba644c7000000000000000000000000000000000000000000004ce40e8cfe56e0c674d70c",
          "1718767",
          "161620",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "1520000000",
          "79000000",
          "2",
          "878984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x11740cb8153548d13da061b6afb02721152c0c9e257cb53be2d9a9ff462bc787",
          "6910",
          "7",
          "0x90e5e021399b125a6aac864975bbbb57e5535c3a",
          "0xac6dd5d70abf45179122074a3bc750df5aa1cf69",
          "0.0",
          "500000",
          "2636769507",
          "0x5eaa9ced83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce49920000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000001136400000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000008d13f8a8bc23d30000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000953706f745072696365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003657468000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037573640000000000000000000000000000000000000000000000000000000000",
          "3165712",
          "271385",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2636769507",
          "2636769507",
          "2",
          "2636769507",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xf9b81c806b0435b181a544684fbf7644ec52e09ebeb773064137d2d93b6a1455",
          "467893",
          "8",
          "0x315d2ee4fccda0def532ef4108ff57204f8d9eba",
          "0x738e79fbc9010521763944ddf13aad7f61502221",
          "0.0",
          "350000",
          "4508379685",
          "0x859b75710bdcde6854f64a1144192b2e2bb4c995b50cd84900000000000000000122a742ef2b541000000000000000371eac59cf4fb8000062d63efdfdc7804666725f4cc8cb45c1a41a080901c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb8dc9cb148ecb70876db0abeb92f515a5e1dc9f580",
          "3264291",
          "98579",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "4508379685",
          "4508379685",
          "2",
          "4508379685",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xfb1cf169ceb9728cc4cd745fa77ad94b61db5e82e098b068a0dff7c16fc24442",
          "9",
          "15",
          "0xdf7ca097acbdf6fca71b61b35b1a563a7c93ef11",
          "0xbf68cc2020c6af7ced2186e606b2e4d91cbed04f",
          "0.0",
          "221957",
          "1799984959",
          "0xe55b64920000000000000000000000000000000000000000000000000000000000000040000000000000000000000000df7ca097acbdf6fca71b61b35b1a563a7c93ef1100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000014e49891531ef2c30545fc726b17903db8fbfbc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000df7ca097acbdf6fca71b61b35b1a563a7c93ef1100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
          "4145084",
          "178949",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2134543298",
          "1000000000",
          "2",
          "1799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xcc3a125e3ee17469657d5abf9948c3c06dab8dc5f70410921c232d0e46815d45",
          "68887",
          "16",
          "0x0abbc482fbd91dbf413e3d6cc5622e03552ac13a",
          "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "0.0",
          "65000",
          "3799984959",
          "0xa9059cbb00000000000000000000000079d6ad819361b97c695dee09713b34dcb1643766000000000000000000000000000000000000000000000000000000012a05f200",
          "4191193",
          "46109",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "4291925805",
          "3000000000",
          "2",
          "3799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0x1ef054a207e4d50c2c4fd8a5dc0bb822af39d2234d4f1bba313b20e1a73c624c",
          "11306753",
          "19",
          "0x21a31ee1afc51d94c2efccaa2092ad1028285549",
          "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "0.0",
          "207128",
          "2799984959",
          "0xa9059cbb0000000000000000000000009ab1e2eb630ee2f200d0050df7758d75040cdf85000000000000000000000000000000000000000000000000000002c4a6021580",
          "4337674",
          "62272",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "102000000000",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      },
      {
        "items": [
          "0xf2d68a31bd4557714eb81b4c0f9eeeb16b7dc3a53f3641a3084f16ee9b0fa202",
          "511",
          "29",
          "0x40f7645d96ade7066e329bc48729aaad7f901973",
          "0xc770eefad204b5180df6a14ee197d99d808ee52d",
          "0.0",
          "53854",
          "2799984959",
          "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
          "4972395",
          "46447",
          "",
          "",
          "1",
          "2025-02-11 23:59:59.000",
          "21826720",
          "0xea513277ed1add2912cc96230a302f65a4fcbd0e8135da55e56cb3acebbf20ae",
          "2840390378",
          "2000000000",
          "2",
          "2799984959",
          "2025-02-11"
        ]
      }
    ]
  }
}
```

> 400 Response

```json
{
  "error": "string"
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description | Data schema |
| ---------------- | ---------------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | none        | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | none        | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name             | Type      | Required | Restrictions | Title | description |
| ---------------- | --------- | -------- | ------------ | ----- | ----------- |
| » code           | integer   | true     | none         |       | none        |
| » msg            | string    | true     | none         |       | none        |
| » data           | object    | true     | none         |       | none        |
| »» column\_infos | \[string] | true     | none         |       | none        |
| »» rows          | \[object] | true     | none         |       | none        |
| »»» items        | \[string] | true     | none         |       | none        |

HTTP Status Code **400**

| Name    | Type   | Required | Restrictions | Title | description |
| ------- | ------ | -------- | ------------ | ----- | ----------- |
| » error | string | true     | none         |       | none        |

### GET News

GET /ai-agent-backend/news

#### Params

| Name          | Location | Type   | Required | Description          |
| ------------- | -------- | ------ | -------- | -------------------- |
| Authorization | header   | string | yes      | login token in redis |

> Response Examples

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "infos": [
      {
        "title": "Why is XRP price up today?",
        "url": "https://cointelegraph.com/why-is-xrp-price-up-today",
        "card_text": "XRP price is up 3% on Feb. 11, responding to Ripple’s partnership with Unicâmbio and increasing chances of XRP ETF approval."
      },
      {
        "title": "New Bitcoin miner ‘capitulation’ hints at sub-$100K BTC price bottom",
        "url": "https://cointelegraph.com/new-bitcoin-miner-capitulation-sub-100k-btc-price-bottom",
        "card_text": "Bitcoin miners may be pointing the way to a major long-term BTC price rebound."
      },
      {
        "title": "How a simple browser extension prevented an $80K transfer to a malicious wallet",
        "url": "https://cointelegraph.com/how-a-simple-browser-extension-prevented-an-80k-transfer-to-a-malicious-wallet",
        "card_text": "A last-minute alert stops an $80,000 transfer to a terrorist-linked wallet, underscoring the growing need for onchain security."
      },
      {
        "title": "SEC and Binance seek 60-day pause in crypto case",
        "url": "https://cointelegraph.com/binance-sec-case-halt-60-days-crypto-task-force",
        "card_text": "The SEC and Binance filed a joint motion to pause their legal case for 60 days, citing the newly formed SEC Crypto Task Force’s potential impact on regulations."
      },
      {
        "title": "2024 crypto VC deals fell 46% from Q1 to Q4 as investment volume rebounded",
        "url": "https://cointelegraph.com/crypto-vc-deal-count-dropped-46-percent-2024",
        "card_text": "Crypto VC deals dropped 46% from Q1 to Q4, but investment value rebounded in Q4, signaling a shift toward selective, high-value projects, according to PitchBook."
      },
      {
        "title": "Why is Cardano (ADA) price up today?",
        "url": "https://cointelegraph.com/why-is-cardano-ada-price-up-today",
        "card_text": "ADA price is up 15% on Feb. 11, responding to Grayscale’s application for a spot Cardano ETF in the United States."
      },
      {
        "title": "What is a Phantom wallet? How to set up and use it",
        "url": "https://cointelegraph.com/what-is-a-phantom-wallet-how-to-set-up-and-use-it",
        "card_text": "Learn how to set up and use a Phantom wallet, including downloading the extension, creating an account, securing your keys and more."
      },
      {
        "title": "Crypto advocates call for post-Biden clarity on digital asset regulations",
        "url": "https://cointelegraph.com/us-congress-crypto-regulation-hearing-2025",
        "card_text": "Industry leaders at a US congressional subcommittee hearing are set to call for clear digital asset regulations to maintain global competitiveness and attract crypto firms."
      },
      {
        "title": "BNB Chain memecoin platform Four.Meme hit by $183K exploit",
        "url": "https://cointelegraph.com/bnb-chain-memecoin-fourmeme-hacked-183k",
        "card_text": "The memecoin launch platform has temporarily stopped the creation of new liquidity pools while it addresses the exploit."
      },
      {
        "title": "Solo miner snags Bitcoin block reward worth $300K",
        "url": "https://cointelegraph.com/solo-miner-snags-bitcoin-block-reward-worth-300-k",
        "card_text": "Bitcoin rose back above $98,000 after dipping slightly when US President Donald Trump announced tariffs on aluminum and steel as part of an escalating US trade war."
      },
      {
        "title": "Story Protocol confirms public mainnet to launch on Feb. 13",
        "url": "https://cointelegraph.com/story-protocol-public-mainnet-launches-february-13",
        "card_text": "The Web3 IP protocol aims to provide an open market for programmable intellectual property, enabling creators and rights holders to protect their IP."
      },
      {
        "title": "ETF issuer Osprey wants judge to review its failed suit against Grayscale",
        "url": "https://cointelegraph.com/osprey-wants-judge-review-failed-suit-against-grayscale-bitcoin-etf",
        "card_text": "A Connecticut judge handed a win to Grayscale in Osprey Funds’ unfair trade practice suit but now Osprey is asking for that to be reviewed."
      },
      {
        "title": "Crypto’s onboarding tipping point – can verification keep up?",
        "url": "https://cointelegraph.com/crypto-s-onboarding-tipping-point",
        "card_text": "Crypto’s rapid growth brings new risks. As fraud escalates, can verification technology keep pace? AI, biometrics and regulatory shifts shape the future of secure crypto onboarding."
      },
      {
        "title": "Bitcoin, top altcoins are ripping attention from memecoins: Santiment",
        "url": "https://cointelegraph.com/bitcoin-top-altcoins-regaining-attention-heathier-market-cycle-santiment",
        "card_text": "Santiment’s social tracker shows top layer-1 blockchains are dominating 44% of the discussion on social media, while the top six memecoins are at 4%."
      },
      {
        "title": "Swedish fintech giant Klarna will ‘embrace crypto,’ CEO says",
        "url": "https://cointelegraph.com/swedish-fintech-firm-klarna-embrace-crypto",
        "card_text": "Klarna, a Swedish payments firm with 85 million users, is reportedly eyeing a US initial public offering — and its CEO is looking for ideas on how it can integrate digital assets."
      },
      {
        "title": "North Carolina House speaker files bill for state to invest in Bitcoin ETPs",
        "url": "https://cointelegraph.com/north-carolina-files-bill-allow-state-treasurer-to-invest-bitcoin",
        "card_text": "The bill limits investments to Bitcoin exchange-traded products only but includes various state funds such as pensions and insurance."
      },
      {
        "title": "Crypto broker breaks ankles while fleeing kidnappers in Spain",
        "url": "https://cointelegraph.com/crypto-broker-escapes-kidnappers-breaks-ankles-while-fleeing-spain-report",
        "card_text": "A search of the apartment in the Spanish town of Estepona where the broker was held by the kidnappers uncovered two firearms, knives, drugs and over $10,000 in cash."
      },
      {
        "title": "Grayscale, NYSE Arca file to launch US-based spot Cardano ETF",
        "url": "https://cointelegraph.com/grayscale-files-cardano-trust-spot-etf",
        "card_text": "NYSE Arca has filed on behalf of Grayscale to launch the firm’s first-ever standalone Cardano ETF product."
      },
      {
        "title": "Litecoin ETF has 90% chance to get SEC approval in 2025: Analysts",
        "url": "https://cointelegraph.com/litecoin-etf-90-percent-chance-sec-approval-2025",
        "card_text": "Bloomberg ETF analysts say Litecoin regulatory filings have been acknowledged and the SEC likely views it as a commodity."
      },
      {
        "title": "OpenAI’s Altman appears to reject Musk’s $97.4B bid for control",
        "url": "https://cointelegraph.com/openai-sam-altman-rejects-elon-musk-takeover-offer",
        "card_text": "OpenAI’s Sam Altman declined Elon Musk’s reported $100 million offer to buy the AI firm, responding with a simple “no thank you” on X."
      },
      {
        "title": "Here’s what happened in crypto today",
        "url": "https://cointelegraph.com/what-happened-in-crypto-today",
        "card_text": "Need to know what happened in crypto today? Here is the latest news on daily trends and events impacting Bitcoin price, blockchain, DeFi, NFTs, Web3 and crypto regulation."
      },
      {
        "title": "Rep. Waters calls for support on bipartisan stablecoin legislation",
        "url": "https://cointelegraph.com/maxine-waters-bipartisan-stablecoin-legislation",
        "card_text": "US House Financial Services Committee ranking member Maxine Waters suggested lawmakers look to bipartisan stablecoin legislation drafted in the 118th session of Congress."
      },
      {
        "title": "Solana revenues outpace Ethereum, L2s despite market dip",
        "url": "https://cointelegraph.com/solana-outpaces-ethereum-l2s-despite-trading-dip",
        "card_text": "Solana-based app revenues beat Ethereum apps by 10x, according to crypto researcher Aylo."
      },
      {
        "title": "Post-election trading surge bullish for Coinbase earnings: Kaiko",
        "url": "https://cointelegraph.com/election-trading-bullish-coinbase-stock-earnings-kaiko",
        "card_text": "Coinbase is among several top US crypto firms scheduled to report earnings this week."
      },
      {
        "title": "Bitcoin price rallies above $97K as institutional and retail traders’ appetites shrink",
        "url": "https://cointelegraph.com/bitcoin-price-rallies-above-97-k-as-institutional-and-retail-traders-appetites-shrink",
        "card_text": "Bitcoin traders are not slamming the buy button, but most of their concerns are connected to macroeconomic conditions."
      },
      {
        "title": "CFTC announces crypto fraud action after enforcement priorities shift",
        "url": "https://cointelegraph.com/cftc-crypto-fraud-enforcement-priorities",
        "card_text": "Acting CFTC Chair Caroline Pham announced on Feb. 4 that the commission would essentially end its practice of regulation by enforcement."
      },
      {
        "title": "Metaplanet share price rises 4,800% as company stacks BTC",
        "url": "https://cointelegraph.com/metaplanet-shares-rise-btc-reserve-strategy",
        "card_text": "Metaplanet shares have risen 4,800% as the company, known as “Asia’s MicroStrategy,” has stacked Bitcoin."
      },
      {
        "title": "US Treasury sued over DOGE access, lawmakers propose stablecoin bill: Law Decoded",
        "url": "https://cointelegraph.com/us-treasury-sued-over-doge-access-lawmakers-propose-stablecoin-bill-law-decoded",
        "card_text": "The United States’ largest union group sued the Treasury Department, accusing it of unlawfully providing sensitive information to Elon Musk’s DOGE."
      },
      {
        "title": "Web3-focused campaign aims to catapult DePIN into mainstream",
        "url": "https://cointelegraph.com/web3-focused-campaign-aims-to-catapult-depin-into-mainstream",
        "card_text": "A token-backed campaign encouraging users to interact with decentralized infrastructure through real-world tasks is accelerating DePIN’s mainstream adoption."
      },
      {
        "title": "Bitcoin's booming 'permanent holder demand' positions BTC price for $116K",
        "url": "https://cointelegraph.com/bitcoin-booming-permanent-holder-demand-btc-price-116k",
        "card_text": "Bitcoin holders with no record of selling their holdings have increased their BTC reserves during the Trump-led market rally."
      },
      {
        "title": "Crypto betting markets’ huge growth fuels calls for billion-dollar volumes in 2025",
        "url": "https://cointelegraph.com/crypto-betting-markets-huge-growth-fuels-calls-for-billion-dollar-volumes-in-2025",
        "card_text": "Crypto-based prediction markets, casinos and sports betting are reshaping the iGaming sector while generating billions of dollars in trading volume."
      },
      {
        "title": "Tesla Q4 Bitcoin profit highlights BTC collateral opportunity — Crypto execs",
        "url": "https://cointelegraph.com/tesla-q4-bitcoin-profit-btc-collateral-opportunity-execs",
        "card_text": "“Mark-to-market gains, Tesla could use its Bitcoin as collateral to unlock liquidity and hedge against market downturns,” said Gadi Chait, an investment manager at Xapo Bank."
      },
      {
        "title": "USDC hits $56.3B market cap, regains losses from bear market",
        "url": "https://cointelegraph.com/usdc-56bn-market-cap-regains-losses-bear-market",
        "card_text": "Circle’s USDC stablecoin has reached a $56.3 billion market capitalization, erasing losses sustained during the bear market."
      },
      {
        "title": "Alleged hacker behind fake SEC post could forfeit $50K in plea deal",
        "url": "https://cointelegraph.com/sec-hacker-fake-bitcoin-etf-post-plea-agreement",
        "card_text": "The individual who allegedly helped compromise the SEC’s X account to post a fake Bitcoin ETF approval message earned roughly $50,000 that he could now be forced to forfeit."
      },
      {
        "title": "Ethereum short positions surge 500% as hedge funds bet on decline",
        "url": "https://cointelegraph.com/ethereum-hedge-funds-short-bets-price-struggles",
        "card_text": "Ethereum may also lack fundamental blockchain activity for an Ether price recovery, analysts told Cointelegraph."
      },
      {
        "title": "ZK identity project Holonym acquires Gitcoin Passport for $10M",
        "url": "https://cointelegraph.com/zk-identity-holonym-acquire-gitcoin-passport-10-million",
        "card_text": "Following the acquisition, Holonym plans to offer its rebranded Human Passport to users worldwide."
      },
      {
        "title": "Web3 growth will be synonymous with Ethereum growth",
        "url": "https://cointelegraph.com/web3-growth-and-ethereum-growth",
        "card_text": "Ethereum is the key to driving Web3 growth, thanks to its robust ecosystem, the rise of layer 2 rollups, and the Superchain’s potential."
      },
      {
        "title": "Bitcoin teases gains as traders say $100K now key support reclaim",
        "url": "https://cointelegraph.com/bitcoin-teases-upside-traders-100k-essential-support-reclaim",
        "card_text": "BTC price momentum is still lacking as the active Bitcoin trading range gets ever narrower."
      },
      {
        "title": "Michael Saylor’s Strategy bags first Bitcoin purchase under new name",
        "url": "https://cointelegraph.com/michael-saylor-s-strategy-makes-first-bitcoin-acquisition-under-new-name",
        "card_text": "Strategy’s fresh 7,633-BTC purchase came days after the firm rebranded from “MicroStrategy” last week."
      },
      {
        "title": "Central African Republic ‘CAR’ memecoin info pages plagued with phishing links",
        "url": "https://cointelegraph.com/car-memecoin-crypto-scam-phishing-links",
        "card_text": "Investors may find themselves clicking on malicious links while researching the controversial Central African Republic memecoin."
      }
    ]
  }
}
```

> 400 Response

```json
{
  "error": "string"
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description | Data schema |
| ---------------- | ---------------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | none        | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | none        | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name           | Type      | Required | Restrictions | Title | description |
| -------------- | --------- | -------- | ------------ | ----- | ----------- |
| » code         | integer   | true     | none         |       | none        |
| » msg          | string    | true     | none         |       | none        |
| » data         | object    | true     | none         |       | none        |
| »» infos       | \[object] | true     | none         |       | none        |
| »»» title      | string    | true     | none         |       | none        |
| »»» url        | string    | true     | none         |       | none        |
| »»» card\_text | string    | true     | none         |       | none        |

HTTP Status Code **400**

| Name    | Type   | Required | Restrictions | Title | description |
| ------- | ------ | -------- | ------------ | ----- | ----------- |
| » error | string | true     | none         |       | none        |

## Data Schema

```
```


# Token Info and Price

### GET TokenInfo

#### Endpoint

`GET /ai-agent-backend/token_info`

#### Parameters

| Name          | Location | Type   | Required | Description                |
| ------------- | -------- | ------ | -------- | -------------------------- |
| ticker        | query    | string | No       | The token's ticker symbol. |
| Authorization | header   | string | Yes      | Login token in Redis.      |

#### Example Request (HTTP)

```http
curl -X GET "https://interface.carv.io/ai-agent-backend/token_info?ticker=aave" \
      -H "Content-Type: application/json" \
      -H "Authorization: <YOUR_AUTH_TOKEN>"
```

#### Example Request (Shell)

```bash
curl -X GET "https://interface.carv.io/ai-agent-backend/token_info?ticker=aave" \
    -H "Authorization: your_token_here"
```

#### Example Request (JavaScript)

```javascript
fetch('https://interface.carv.io/ai-agent-backend/token_info?ticker=aave', {
  method: 'GET',
  headers: {
    'Authorization': 'your_token_here'
  }
})
  .then(response => response.json())
  .then(data => console.log(data));
```

#### Example Response (200 OK)

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "ticker": "aave",
    "symbol": "aave",
    "name": "Aave",
    "platform": "ethereum",
    "categories": [
      "Decentralized Finance (DeFi)",
      "Governance",
      "Yield Farming",
      "BNB Chain Ecosystem",
      "Lending/Borrowing Protocols",
      "Avalanche Ecosystem",
      "Polygon Ecosystem",
      "Near Protocol Ecosystem",
      "Fantom Ecosystem",
      "Harmony Ecosystem",
      "Arbitrum Ecosystem",
      "Ethereum Ecosystem",
      "Optimism Ecosystem",
      "Index Coop Defi Index",
      "Energi Ecosystem",
      "Sora Ecosystem",
      "Huobi ECO Chain Ecosystem",
      "GMCI DeFi Index",
      "Blockchain Capital Portfolio",
      "Index Coop Index",
      "GMCI Index",
      "World Liberty Financial Portfolio"
    ],
    "contract_infos": [
      {
        "platform": "near-protocol",
        "address": "7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9.factory.bridge.near"
      },
      {
        "platform": "huobi-token",
        "address": "0x202b4936fe1a82a4965220860ae46d7d3939bb25"
      },
      {
        "platform": "fantom",
        "address": "0x6a07a792ab2965c72a5b8088d3a069a7ac3a993b"
      },
      {
        "platform": "energi",
        "address": "0xa7f2f790355e0c32cab03f92f6eb7f488e6f049a"
      },
      {
        "platform": "binance-smart-chain",
        "address": "0xfb6115445bff7b52feb98650c87f44907e58f802"
      },
      {
        "platform": "ethereum",
        "address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
      },
      {
        "platform": "optimistic-ethereum",
        "address": "0x76fb31fb4af56892a25e32cfc43de717950c9278"
      },
      {
        "platform": "polygon-pos",
        "address": "0xd6df932a45c0f255f85145f286ea0b292b21c90b"
      },
      {
        "platform": "harmony-shard-0",
        "address": "0xcf323aad9e522b93f11c352caa519ad0e14eb40f"
      },
      {
        "platform": "arbitrum-one",
        "address": "0xba5ddd1f9d7f570dc94a51479a000e3bce967196"
      },
      {
        "platform": "avalanche",
        "address": "0x63a72806098bd3d9520cc43356dd78afe5d386d9"
      },
      {
        "platform": "sora",
        "address": "0x0091bd8d8295b25cab5a7b8b0e44498e678cfc15d872ede3215f7d4c7635ba36"
      }
    ],
    "price": 12.34
  }
}
```

#### Example Response (400 Bad Request)

```json
{
  "error": "Invalid token ticker."
}
```

#### Response Data Schema

**HTTP Status Code: 200 OK**

<table><thead><tr><th width="160">Name</th><th width="106">Type</th><th width="97">Required</th><th width="97">Restrictions</th><th>Title</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>integer</td><td>Yes</td><td>None</td><td>Response Code</td><td>The status code of the response.</td></tr><tr><td>msg</td><td>string</td><td>Yes</td><td>None</td><td>Response Message</td><td>A descriptive message about the response.</td></tr><tr><td>data</td><td>object</td><td>Yes</td><td>None</td><td>Token Data</td><td>The data object containing token details.</td></tr><tr><td>data.ticker</td><td>string</td><td>Yes</td><td>None</td><td>Ticker Symbol</td><td>The token’s ticker symbol.</td></tr><tr><td>data.symbol</td><td>string</td><td>Yes</td><td>None</td><td>Symbol</td><td>The token’s symbol.</td></tr><tr><td>data.name</td><td>string</td><td>Yes</td><td>None</td><td>Name</td><td>The token’s name.</td></tr><tr><td>data.platform</td><td>string</td><td>Yes</td><td>None</td><td>Platform</td><td>The blockchain platform of the token.</td></tr><tr><td>data.categories</td><td>array of strings</td><td>Yes</td><td>None</td><td>Categories</td><td>The categories associated with the token.</td></tr><tr><td>data.contract_infos</td><td>array of objects</td><td>Yes</td><td>None</td><td>Contract Info</td><td>The contract information for different platforms.</td></tr><tr><td>data.price</td><td>number</td><td>Yes</td><td>None</td><td>Price</td><td>The token's price in USD.</td></tr></tbody></table>

**HTTP Status Code: 400 Bad Request**

<table><thead><tr><th>Name</th><th width="100">Type</th><th width="109">Required</th><th width="128">Restrictions</th><th width="89">Title</th><th width="211">Description</th></tr></thead><tbody><tr><td>error</td><td>string</td><td>Yes</td><td>None</td><td>Error</td><td>Error message indicating the issue with the request.</td></tr></tbody></table>


# User Balance by Twitter ID

{% hint style="info" %}
This endpoint relies on CARV ID to establish the relationship between the provided Twitter ID and the corresponding blockchain address. If the specified twitter\_user\_id is not connected to any address through CARV ID, the API will not be able to retrieve the expected result. Ensure that the Twitter account is properly linked to a blockchain address via CARV ID before making a request.
{% endhint %}

### GET UserBalanceByTwitter

#### Endpoint

`GET /ai-agent-backend/user_balance_by_twitter_id`

#### Parameters

| Name              | Location | Type   | Required | Description                       |
| ----------------- | -------- | ------ | -------- | --------------------------------- |
| twitter\_user\_id | query    | string | no       | Twitter handle                    |
| chain\_name       | query    | string | no       | Blockchain name, e.g., "ethereum" |
| token\_ticker     | query    | string | no       | Token ticker, e.g., "ETH"         |
| Authorization     | header   | string | yes      | Login token in Redis              |

**Description**

* **chain\_name**: Supported values include `"ethereum_mainnet"`, `"base_mainnet"`, `"solana_mainnet"`, `"opbnb_mainnet"` (and all testnets as well).

#### Example Request (HTTP)

```http
GET /ai-agent-backend/user_balance_by_twitter_id?twitter_user_id=123456&chain_name=ethereum_testnet&token_ticker=aave
Authorization: <your-auth-token>
```

#### Example Request (Shell)

```bash
curl -X GET "https://interface.carv.io/ai-agent-backend/user_balance_by_twitter_id" \
-H "Authorization: <your-auth-token>" \
-d "twitter_user_id=123456" \
-d "chain_name=ethereum_mainnet" \
-d "token_ticker=eth"
```

#### Example Request (JavaScript)

```javascript
const fetch = require('node-fetch');

const url = 'https://interface.carv.io/ai-agent-backend/user_balance_by_twitter_id';
const params = new URLSearchParams({
    twitter_user_id: '123456',
    chain_name: 'ethereum_testnet',
    token_ticker: 'eth'
});

const options = {
    method: 'GET',
    headers: {
        'Authorization': '<your-auth-token>'
    }
};

fetch(`${url}?${params.toString()}`, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
```

4o

#### Example Response (200 OK)

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "balance": "0.010000"
  }
}
```

**Error Response (400):**

```json
jsonCopy code{
  "error": "Invalid request"
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description | Data Schema |
| ---------------- | ---------------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | none        | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | none        | Inline      |

#### Response Data Schema

**HTTP Status Code 200**

| Name    | Type    | Required | Restrictions | Title | Description      |
| ------- | ------- | -------- | ------------ | ----- | ---------------- |
| code    | integer | true     | none         |       | Response code    |
| msg     | string  | true     | none         |       | Response message |
| data    | object  | true     | none         |       | Response data    |
| balance | string  | true     | none         |       | User balance     |

**HTTP Status Code 400**

| Name  | Type   | Required | Restrictions | Title | Description       |
| ----- | ------ | -------- | ------------ | ----- | ----------------- |
| error | string | true     | none         |       | Error description |


# User Balance by Discord ID

{% hint style="info" %}
This endpoint relies on CARV ID to establish the relationship between the provided Discord ID and the corresponding blockchain address. If the specified discord\_user\_id is not connected to any address through CARV ID, the API will not be able to retrieve the expected result. Ensure that the Discord account is properly linked to a blockchain address via CARV ID before making a request.
{% endhint %}

### GET UserBalanceByDiscordID

GET /ai-agent-backend/user\_balance\_by\_discord\_id

#### Params

| Name              | Location | Type   | Required | Description          |
| ----------------- | -------- | ------ | -------- | -------------------- |
| discord\_user\_id | query    | string | no       | none                 |
| chain\_name       | query    | string | no       | "ethereum"           |
| token\_ticker     | query    | string | no       | none                 |
| Authorization     | header   | string | yes      | login token in redis |
| Origin            | header   | string | yes      | none                 |

**Description**

* **chain\_name**: Supported values include `"ethereum_mainnet"`, `"base_mainnet"`, `"solana_mainnet"`, `"opbnb_mainnet"` (and all testnets as well).

#### Example Request (HTTP)

```http
GET /ai-agent-backend/user_balance_by_discord_id?discord_user_id=123456&chain_name=ethereum_testnet&token_ticker=aave
Authorization: <your-auth-token>
```

> Response Examples

```json
{
  "code": 0,
  "msg": "Success",
  "data": {
    "balance": "0.010000"
  }
}
```

> 400 Response

```json
{
  "error": "string"
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description | Data schema |
| ---------------- | ---------------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | none        | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | none        | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name       | Type    | Required | Restrictions | Title | description |
| ---------- | ------- | -------- | ------------ | ----- | ----------- |
| » code     | integer | true     | none         |       | none        |
| » msg      | string  | true     | none         |       | none        |
| » data     | object  | true     | none         |       | none        |
| »» balance | string  | true     | none         |       | none        |

HTTP Status Code **400**

| Name    | Type   | Required | Restrictions | Title | description |
| ------- | ------ | -------- | ------------ | ----- | ----------- |
| » error | string | true     | none         |       | none        |


# Source code

The source code for the **D.A.T.A Framework** is available on GitHub: 👉 [**GitHub Repository: Eliza D.A.T.A**](https://github.com/carv-protocol/eliza-d.a.t.a/tree/carv/dev)

This implementation is built as a **plugin for Eliza**, leveraging its capabilities to provide a robust foundation for AI agents to access and process on-chain and off-chain data using the **D.A.T.A Framework**. The current implementation enables AI agents to utilize structured tags, on-chain metrics, and CARV ID for intelligent decision-making and interaction.

## **Future Development**

The D.A.T.A plugin will continue to evolve with the following goals:

* **Support for New Frameworks**: Expand compatibility beyond Eliza to integrate with leading AI agent platforms like **ZerePy**, **Rig**, and **Virtual**.
* **Enhanced Features**: Introduce additional metrics, deeper on-chain analytics, and cross-chain interoperability to enrich AI agents’ capabilities.
* **Privacy and Trust**: Strengthen TEE and CARV Verifier Node integration to ensure secure and trustless operation.

## **How to Contribute**

Developers are encouraged to explore the repository and contribute to the project by:

* Extending support for additional AI agent frameworks.
* Enhancing existing features, such as advanced metrics and data tagging.
* Proposing new use cases or integrations.

Get started by visiting the repository: 👉 [**GitHub Repository: Eliza D.A.T.A**](https://github.com/carv-protocol/eliza-d.a.t.a/tree/carv/dev)

The **D.A.T.A Framework** is designed to grow with the AI agent ecosystem, and your contributions can help shape its future. Join us in building the next generation of decentralized intelligence!


# CARV Play

CARV: VERB. cut (a hard material) in order to make important things recorded and lasting; sculpt and shape one's skillset and technique.

[CARV Play](https://carv.io/) is an AI-powered gaming Super App built on top of the CARV Protocol, enabling gamers with seamless credential-based gaming experiences and empowering games with data-driven growth & intelligence.&#x20;

## CARV Play is:

#### **The First Cross-Platform Achievement System**

CARV Play ensures gamer data privacy and sovereignty by converting all your gaming achievements into verifiable SBTs (Soul bound Tokens), storing your in-game achievements, memories, and journeys across all games and gaming platforms.&#x20;

#### **The Largest Web3 Gaming Platform**

CARV Play features 600+ top notch and rewarding NFT games with detailed information and game reviews from seasoned gamers alike. CARV Play hosts exclusive partnership events with rewards including USDT, NFTs, and physical items, allowing gamers to play and earn at the same time.

#### **The Most Engaging and Genuine Gaming Community**

Join the vibrant CARV community with millions of gamers, connect with gaming influencers, make gaming friends, compete in community game events, and win prizes.

## **Key Features for Gamers:**

#### **Credential-Based Player Profile and Soulbound NFT Badges**

* **Cross-Platform Account Binding**

Bind your gaming accounts directly from your profile page. For instance, connect your Steam account to verify in-game data and earn exclusive NFTs (Soulbound NFT Badges) forever belonging to you, hard proof of you.

<figure><img src="/files/0THWxJSC3DnjT0kuGP2C" alt="CARV Profile"><figcaption><p>CARV Profile</p></figcaption></figure>

* **Soulbound NFT Badges**

Known as Soulbound Tokens, these non-transferable NFTs validate your gaming experiences and traits, forming the foundation of your gaming credentials. As you reach game milestones and engage in game-hosted events, you earn additional Badges, bolstering your credentials and enriching your gaming identity. CARV categorize soulbound NFT badges into Achievement Badges, Event Badges, Membership Badges, and Generative Archive Tokens (GAT).

* **Achievement Badges**: Achievement badges signify your in-game accomplishments with no time limit for claiming; you can claim them whenever you meet the specific criteria. CARV also introduces a series of achievement badges, grouped by required behaviors on CARV. You can unlock and upgrade your badges as you progress. Minting a higher-level badge burns the lower-level one, and CARV covers all minting gas fees.
  * *Use Case:* [*Armour Achievements Badges*](https://carv.io/games/carv_armour/detail/badges)
* **Event Badges**: Event badges mark your participation in CARV or game project events. Complete all event quests, you can earn an event badge and accompanying rewards.
  * *Use Case: BNB CARVnival \[*[*Read more*](https://medium.com/@Carv/bnb-game-carvnival-overview-3f00368f06ec)*]*
  * *Use Case: Web3 Summer Game Fest with Most Anticipated Games of the Year \[*[*Read more*](https://medium.com/carv-official/unleash-your-spirit-with-web3-summer-game-fest-75e4eed8fdd4)*]*
* **Membership Badges**: These badges indicate your membership in a DAO (Decentralized Autonomous Organization) or organization. Eligibility is managed by the organization's manager via whitelisting. Membership badges are revocable and non-transferable. You can choose badge images from the provided stock options, ensuring uniqueness. CARV covers all minting gas fees.
  * *Use Case: Wolves DAO Membership PFP - Proof of Influence in Web3 Gaming \[*[*Read More*](https://medium.com/carv-official/proof-of-influence-credential-in-web3-gaming-wolves-dao-membership-soulbound-tokens-sbts-223572043796)*]*
* **Generative Archive Tokens (GAT)**: GAT is a unique gaming credential that continually captures and preserves your gaming achievements and cherished memories. It serves as a depot for your hard-earned accolades, creating an immutable record. Here:"**Generative**" means that GAT is dynamically generated based on your individual in-game data and game accomplishments, adapting and evolving alongside your gaming journey."**Archive**" represents that it is a permanent record where your gaming achievements and memories are preserved and you retain full ownership."**Token**" indicates GAT's existence and storage on the blockchain, ensuring its authoritative verification, enduring preservation, and immutability.
  * *Why Is CARV GAT Special? And How Do You GAT IT!* [*\[Read More*](https://medium.com/carv-official/carv-gat-gat-all-your-gaming-memories-and-moments-62117383bbda)*]*

<figure><img src="/files/xi2AYYv9D21aTOj6ifuf" alt=""><figcaption><p>Why CARV GAT</p></figcaption></figure>

#### **NFT Badge CARV (Mint) and Gas Fee Explained**

When CARV (minting) NFT badges in an event on CARV, gas fee is paid to blockchains. CARV provides options for events hosts to choose whether they would cover gas fee for users:

* **Gasless CARV (Mint):** Gasless minting means you don't need to pay the gas fee. Instead, it's covered by the event host or CARV, with a 'Gasless' label on the event page.

<figure><img src="/files/D2h3btLeHMjzrndqbLDE" alt="Gasless Minting" width="240"><figcaption><p>CARV Gasless Minting</p></figcaption></figure>

* **CARV (Mint) with Gas Fee**: When minting a badge, you need pay gas fee with your wallet balance. This requires you to sign the transaction with your wallet, e.g., MetaMask.&#x20;
* **Gasless with Gas Card**: Not covered by event host, yet you can still enjoy a gasless experience by using the Gas Card. A gas card is a prepaid asset on CARV Play. Obtain it by:&#x20;
  * Advancing your [CARV Pass](https://carv.io/carvpass) to critical levels
  * Participating in raffles or direct purchase in CARV shop with GEMs, in-platform currency

#### **Vibrant** [**Events**](https://carv.io/events) **and Fruitful Rewards**

CARV Play, with gaming partners, runs various events on the [Event page](https://carv.io/events), including social events, in-game activities, live streams, AMA sessions, beta tests, global cultural festivals, and more, all with exclusive rewards.

Furthermore, CARV hosts themed events, such as [collaborations with ecosystems like zkSync](https://medium.com/carv-official/ignite-the-new-era-embrace-the-carv-x-zksync-collaboration-celebration-304160bbb233), themed events like [the Shooting Game Battlefield](https://medium.com/carv-official/unleash-the-action-shooting-game-battlefield-66058990cadc), and web2 game events including [Steam Frenzy Hours](https://medium.com/carv-official/join-steam-frenzy-hours-power-up-your-carv-pass-journey-by-playing-csgo-dota2-baldurs-gate-3-bf33c9fda604). Joining these events and completing quests earns you rewards like GEMs, USDT, NFTs, and more! The GEMs you earn during events can be directly used to redeem various rewards in CARV shop, including physical rewards, gift cards, in-game NFTs, profile frames, etc. In addition to the above, SBT Badges CARVed are your proof of participation, verifiable and interoperable in gaming ecosystem.

<figure><img src="/files/RQOVoadY7zhxB8TvvR9B" alt="CARV Events Page"><figcaption><p>CARV Events Page</p></figcaption></figure>

* **What's GEM after all?**

  GEM serves as a kind of incentive on CARV Play. You can accumulate GEM through various means:

  * Participating in events with GEM prize pools
  * Unlocking mystery boxes in CARV Pass
  * Reaping level-up rewards in CARV Pass
  * Securing a position within the top 300 on the CARV Pass seasonal leaderboard
  * Exploring other opportunities

  GEM is your ticket to redeeming various rewards, including in-game items, cash, $CARV rewards, physical prizes from CARV Shop, and more!

#### [**CARV Shop**](https://carv.io/shop/all) **- Where Reward Redemption Happens!**

CARV Shop provides diverse real-world and virtual rewards, such as game consoles, computers, gift cards, in-game NFT, profile frames, etc. You can purchase them or join raffles using your GEMs to win these prizes.

<figure><img src="/files/FI4tLpogFEdYCgQCuLXl" alt="CARV Shop"><figcaption><p>CARV Shop</p></figcaption></figure>

#### [**Game Discovery**](https://carv.io/discovery) **by All Means**

CARV lists 600+ top notch Web2 and Web3 games, mostly though official partnerships, offering our gamer community exclusive events and rewards. Discovery games might interest you driven by data and authentic reviews (credential-gated, with real players) from gamers alike.

<figure><img src="/files/hG9L6gtoMJ4SAfbWVrxl" alt="CARV Discovery Page"><figcaption><p>CARV Discovery Page</p></figcaption></figure>

<figure><img src="/files/KCsAKUOQsGsHLa8DIfFV" alt="CARV Games Page"><figcaption><p>CARV Games Page</p></figcaption></figure>

* **Game Details with Game's Mission Board, Analytics and Progression & Portfolio Overview**
  * **Missions:** Various, on-demand in-game or community missions launched by the game, with mission points offered. These missions not only guide you through the game but also bids you onto leaderboard and redeems rewards.
    * Use case: [CARV Mission Board Spotlight: Apeiron, Tearing Space, and Genopets](https://medium.com/carv-official/carv-mission-board-spotlight-activating-communities-through-customizable-events-ffd82fb5456f)
  * **Insights:** Go-to analysis of the game token performance and social trends.
  * **Reviews:** Rate the game on gameplay and whether 'bullish' with authentic reviews during or post play.

<figure><img src="/files/ynJ3PME199smwjLKwAJO" alt="CARV Game Detail Page - Overview"><figcaption><p>CARV Game Detail Page - Overview</p></figcaption></figure>

#### [**CARV Pass**](https://carv.io/carvpass) **- Elevate Your Play Experience**

CARV Pass marks the pioneering project on the CARV platform, where players can earn GEM and unlock rewards directly. It offers a thrilling journey with critical levels, packed with opportunities, rewards, and surprises. There are four distinct types of quests in CARV Pass each season:

* **Time Limited**: Only available for a specified period - race against the clock!
* **Weekly**: Enjoy recurring weekly quests, e.g., daily check-ins and say hi to CARV community.
* **Monthly**: On a monthly basis. Riding your play, signature activity quests might include writing game reviews on CARV Play or CARV game achievement SBTs.
* **Seasonal**: Get into the spirit of the season!

Upon completing quests, EXP will be collected. Level up with EXP, and unlock a host of rewards, including Power, GEMs, mystery boxes, SBTs, Titles, lottery entries, and more!&#x20;

<figure><img src="/files/rJ2W8d176uyoxN1g3dNH" alt="CARV Pass Level Up Rule"><figcaption><p>CARV Pass Level Up Rule</p></figcaption></figure>

* **What’s Power?**

  Power dictates how effectively you can benefit from the GEM prize pool. The higher power, the bigger share of GEM rewards you will get from total prize pool. Base power starts at 1.0, your power can go up to 3.0. Boost your power by:

  * Leveling up your Pass&#x20;
  * Equipping the Dragon Treasure NFT.[Learn more about Dragon Treasure NFT](https://medium.com/@Carv/carvers-did-arise-dragonball-in-a-nutshell-34ea58923af5) and acquire one on [OpenSea](https://opensea.io/collection/dragontreasure)! Note that if you own multiple Dragon Treasure NFTs, only the highest-level one will be used for power enhancemen&#x74;*.*

<figure><img src="/files/YS5D0c3Bb83mFkpu3PB3" alt="CARV Pass Power Explanation"><figcaption><p>CARV Pass Power Explanation</p></figcaption></figure>

* **Seasonal Leaderboard**

  The leaderboard hinges on your Pass Level and EXP. CARV will take a snapshot of the Top 300 on the leaderboard at the end of each season. A sneak peek at the leaderboard's rewards:

<figure><img src="/files/D0k9PQYgQ6UAx2TfvItq" alt="CARV Pass Leaderboard Reward"><figcaption><p>CARV Pass Leaderboard Reward</p></figcaption></figure>


# Portal Access

Reach passionate gamers worldwide with intuitive onboarding and interactive campaigns built with off-the-shelf modules!

CARV Portal is the game distribution and data analytics tooling for games, helps game partners to acquire, onboard, retain gamers on CARV Play and learn users' insights from the large quantity and high quality first\&zero party data.

### **Game Listing**

Listing games on CARV is the first step to unlocking a comprehensive range of features and services provided by CARV. By building dedicated gamezones, developers can get exposure to millions of gamers and start to launch events, missions, rewards to onboard and retain gamers.Learn more: <https://carv-official.notion.site/Game-Listing-f03aa8bc342848e19ce5dc200f1a9219>

### **Events**

With CARV's event launcher module, game developers can create incentive campaigns to gain exposure to real gamers in both the Web2 and Web3 gaming space. CARV offers highly customizable qualification criteria and rewards tailored to your specific goals.[Learn more: https://carv-official.notion.site/Event-Launcher-a8b9664ce751469092e978b3e9724b86](https://carv-official.notion.site/Event-Launcher-a8b9664ce751469092e978b3e9724b86)

### **Mission integrations**

Missions offer a complete solution for projects seeking to acquire, activate, engage, and retain your community and players. Games can create recurring quests designed to span extended periods. Players earn rewards points as they complete these quests, which can be redeemed for in-game rewards.[Learn more: https://carv-official.notion.site/Missions-System-3e05da5f70084af28798164fb9c104a7](https://docs.carv.io/resources/for-developer)

### **SBT membership**

Unique, non-transferable digital profile pictures created using AI, each linked to a soulbound token that signifies the owner's permanent and exclusive membership, reinforcing their identity and belonging within the Wolves DAO community.

### **MOFF integrations**

Moff is the Discord bot that empowers game community managers and supercharges the Discord servers. It was a winning project from BNBChain's Zero2Hero Hackathon and will help games grow the community, gain deeper insights into users, and streamline the day-to-day tasks.[Learn more: https://moff-bot.notion.site/Moff-Guide-2084f6f6c855436ba0b25fc7b8611779?pvs=4](https://moff-bot.notion.site/Moff-Guide-2084f6f6c855436ba0b25fc7b8611779?pvs=4)

### **Data Analytics**

Based on the on-chain and off-chain zero & first-party data from over 2.4M users across various platforms, along with user behavior within CARV and CARV-partnered games, CARV offers its partners data analysis capabilities not limited to the following, to help games better understand their users:

1. Based on user on-chain and off-chain account bindings and data authorizations, generate over 200 user tags, providing games with data query capabilities, targeted advertising, and user attribute analysis based on tags.
2. Based on user participation in events, provide game projects with post-event data and participant profiles.
3. Based on user behavior in partnership games (through CARV ID Oauth or CARV API), provide game projects with user behavior data analysis and user profiling.
4. Based on game’s target user profiles, provide similar target audience group analysis and competitive analysis to partnered games.
5. Discord growth, engagement, retention, event data, and regional data analysis
6. Twitter data monitoring and analysis and sentiment analysis (in alpha testing).

After verification, you will be able to list your game, launch campaign, and engage your community through [here](https://portal.carv.io/).&#x20;


# Integration Guide

#### .Play Name Service&#x20;

For dApps to integrate the .Play Name Service (PNS) into your application. It allows your dApp to resolve domain names to Ethereum Virtual Machine (EVM) wallet addresses and to retrieve domain names associated with a user's EVM wallet address.

{% content-ref url="/pages/oIA7NQp98ZprIFQ0GJUy" %}
[.Play Name Service Integration](/carv-ecosystem/carv-play/carv-intro/.play-name-service-integration)
{% endcontent-ref %}

#### API-Verifed Quest

For games who wish to create their own quest in Events or Missions on CARV Play, such as instructing users to complete specific in-game tasks where data is not publicly available, CARV made it possible by allowing games to provide their own verification API to check user completion status. CARV supports both RESTful API and GraphQL API for maximum compatibility with your current system.

{% content-ref url="/pages/Ojaa4PdNU0m7nwz8FnIq" %}
[API-Verified Quest (RESTFUL)](/carv-ecosystem/carv-play/carv-intro/api-verified-quest-restful)
{% endcontent-ref %}

{% content-ref url="/pages/shxbbpWXHatKDwK5iThp" %}
[API-Verified Quest (GraphQL)](/carv-ecosystem/carv-play/carv-intro/api-verified-quest-graphql)
{% endcontent-ref %}


# .Play Name Service Integration

### Overview

This guide provides instructions for integrating the .Play Name Service (PNS) into your application using our JavaScript SDK. It allows your app to resolve domain names to Ethereum Virtual Machine (EVM) wallet addresses and to retrieve domain names associated with a user's EVM wallet address.

### Use Cases

In any scenario where a user would normally encounter an EVM wallet address, your application can now present a more user-friendly PNS name. This integration primarily enhances your app in two ways:

1. Displaying PNS Names Instead of EVM Wallet Addresses: In the user interface of your application, replace the raw display of EVM wallet addresses with corresponding PNS names. This substitution can occur wherever an address typically appears, making the interface more intuitive and user-friendly.
2. Enabling PNS Name Entry in Input Fields: Modify input fields that traditionally require an EVM wallet address, allowing users to input PNS names instead. This feature simplifies user interactions, particularly in situations where memorizing or copying lengthy EVM wallet addresses can be cumbersome.

### Getting Started

#### Install

```Python
npm install @carv-protocol/pns-js
```

#### Set up

```Python
import { getNames, getAddress} from '@carv-protocol/pns-js'
```

#### Forward Resolution

You can get address from domain name using the following method.

```Python
  const testDomain = "carv-engineer.play"
  const address = await getAddress(testDomain);
```

#### Reverse Resolution

You can get a list of domain names associated with an address. Note that the 'Primary Domain' feature is not yet released where a user can choose one domain name (from multiple) an address resolves to. This method will simply return all the associated domain names in ascending order by length.

```Python
const testAddress = "0x25dC11C90349024C083e34f3f749ffAb7AEd0e48";
const names = await getNames(testAddress);
```


# API-Verified Quest (RESTFUL)

How to set up custom quest using RESTful API.

## Introduction

CARV allows the use of OpenAPI to verify whether a user has completed a quest.&#x20;

## Sequence Digram

<figure><img src="/files/7A6BxlcyOlGpFmlDYyTA" alt=""><figcaption></figcaption></figure>

## Specifications&#x20;

**Request**

The API used for verification must be an open API. \
You can choose to use either **email** or **wallet address** or **user ID of third-party platforms** as the identifier to verify a user. \
You can choose *optionally* to add custom headers to the request, such as an API key.\
We will also include **begin time** and **end time** (timestamp in milliseconds) for a quest in case this information is required for verification.&#x20;

So a GET Request will look like the followings:

{% code overflow="wrap" %}

```sh
# wallet address
curl https://<domain>/<serverpath>?address=<userAddress>&begin_time=<timestamp>&end_time=<timestamp>
```

{% endcode %}

OR

{% code overflow="wrap" %}

```sh
# email
curl https://<domain>/<serverpath>?email=<userEmail>&begin_time=<timestamp>&end_time=<timestamp>
```

{% endcode %}

OR

{% code overflow="wrap" %}

```sh
# Telegram id
curl https://<domain>/<serverpath>?telegram_id=<userTelegramId>&begin_time=<timestamp>&end_time=<timestamp>
```

{% endcode %}

OR

{% code overflow="wrap" %}

```sh
# Line id
curl https://<domain>/<serverpath>?line_id=<userTelegramId>&begin_time=<timestamp>&end_time=<timestamp>
```

{% endcode %}

#### Response Format

{% code overflow="wrap" %}

```json
{
    "result":{                    //required on success
        "isValid":<true | false>  //boolean: whether the user completed the quest.
    },
    "error":{                      //required on error, this field MUST NOT exist if there was no error triggered during invocation.
        "code":<error code>,       //number
        "message":"<error message>"
    }
}
```

{% endcode %}


# API-Verified Quest (GraphQL)

How to set up custom quest using GraphQL API.

## Introduction

GraphQL verification takes a single wallet address or email as input and outputs 0(false)/1(true) to indicate whether the wallet address is eligible. It requires 3 fields to be filled in: **GraphQL Endpoint (HTTPs)**, **Query** and **Expression**.

## Sequence Diagram

<figure><img src="/files/gYosVRyAiX08oTqMsmaS" alt=""><figcaption></figcaption></figure>

## GraphQL Endpoint (HTTPs)

It's the HTTPs endpoint where Subgraph queries go to, see the example below.&#x20;

{% hint style="warning" %}
NOTE: If you saw an error when testing the API, check if the endpoint is a valid GraphQL API endpoint. Common misconfigurations include:

* &#x20;Incorrectly used a GraphQL *playground* url, that usually ends with `/graph`
* &#x20;The GraphQL endpoint does now allow CORS from carv.io.
  {% endhint %}

## Query

The GraphQL query requires a single wallet address as input. In the dashboard, once you finish your query, fill in a test address and click 'Run' button to check if the query's return is good.

## Expression

A JavaScript (ES6) function with this type signature: `(object) => int`. The function must be anonymous, which means that the first line of the expression should be like `function(data) {`, instead of `let expression = (data) => {`.

The function should return either number 1 or 0, representing if the address has completed the quest. Behind the scenes, first, we send the query with the user's address to the GraphQL endpoint, and then we will apply the function against the 'data' field of the response. If the returned value is 1, then user is considered to have completed this quest, otherwise not.

Once the query's output is good, click 'Run' button to check if expression processes the query's output correctly.

## Subgraph Examples

**Endpoint**

```
https://api.thegraph.com/subgraphs/name/carv-protocol/carvachievementsonbnb
```

**Query**

```graphql
query info($address: String!) {
  # write you query here 
    erc1155Balances(
    first: 1
    where: {token_: {identifier: "1"}, account_: {id: $address}}
  ) {
    account {
      id
    }
    token {
      id
      identifier
    }
  }
}

# test address: 0x357A5eE000B5cA0935Aad7bb4Cb96E8AcAf46727
```

**Query Output**

```json
{
  "erc1155Balances": [
    {
      "account": {
        "id": "0x357a5ee000b5ca0935aad7bb4cb96e8acaf46727"
      },
      "token": {
        "id": "0xc2f24ffe96a69e381a747dc73fcd51492e29a0a4/0x1",
        "identifier": "1"
      }
    }
  ]
}
```

**Expression**

```javascript
function verify(data){
    if (data.erc1155Balances.length > 0){
        return true
    } else {
        return false
    }
}
```

**Expression Output**

```
true
```


# CARV ID OAuth 2.0

## Overview

This guide is intended for developers looking to integrate CARV ID authentication into their applications using OAuth 2.0. OAuth 2.0 is a standard for authorization that enables third-party applications to obtain limited access to an HTTP service. By integrating CARV ID OAuth 2.0, users can securely and conveniently log in to your application using their CARV ID credentials.

## Prerequisites

Before you begin, ensure you have the following:

* A registered application with CARV and your `Client ID` and `Client Secret`.&#x20;
* An understanding of OAuth 2.0 flow.

### Step 1: Register Your Application

1. **Determining Necessary Permissions**: Begin by reviewing the [application scopes available](#scopes) to identify the permissions your application will need.
2. Provide Application Information: Share your application's **Redirect URL** and the **scopes** you've selected based on your needs. Additionally, provide the following information:
   * **Name Displayed on OAuth Screen**: The name of your application as it will appear during the authentication process.
   * **Home Page URL**: The main URL of your application, where users can learn more about your service.
   * **Logo Image URL**: A URL pointing to your logo image, which will be displayed during the authentication process.
   * **Privacy Policy URL**: The URL of your privacy policy page.
   * **Terms of Service URL**: The URL of your terms of service page.
3. After we receive this information, we will set up your OAuth configuration and provide you with a Client ID and Client Secret. Keep these confidential.

### Step 2: Implement the OAuth 2.0 Flow

{% hint style="info" %}
&#x20;OAuth 2.0 flow at a very high level:

* The application renders a “Sign in with CARV ID” link or button.
* The user clicks the sign in button.
* The current web browser is redirected to CARV (or a new browser is opened and directed to CARV).
* The user completes a login and authorization step at CARV if needed.
* CARV redirects back to an URL under the application’s control, passing authorization information for the user.

<img src="/files/yDZ8S8rAE00X6it0GMBU" alt="" data-size="original">
{% endhint %}

## API Details

**Discover OAuth Information**

```bash
curl -X GET https://oauth.carv.io/.well-known/openid-configuration
```

#### Authorization Request

Construct and redirect users to the CARV ID authorization page to begin the authentication process:

{% code overflow="wrap" %}

```bash
https://auth.carv.io/auth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&scope=YOUR_SCOPE&state=YOUR_STATE
```

{% endcode %}

Parameters:

* `response_type`: Should be `code` for the authorization code flow.
* `client_id`: Your application's Client ID.
* `redirect_uri`: The URL to which CARV ID will send the user after authorization.
* `scope`: The space-separated list of permissions your application requests.
* `state`: A unique state value that your application generates to mitigate CSRF attacks.

After successful login and authorization, user will be redirected to the provided URL with `code` and `state` included in the parameters.

#### **Scopes**

Scopes allow you to set granular access for your application so that your application only has the permissions that it needs.

<table><thead><tr><th width="262">Scope</th><th>Description</th></tr></thead><tbody><tr><td>carv_id_basic_read</td><td>Basic CARV ID info</td></tr><tr><td>email_basic_read</td><td>Email address</td></tr><tr><td>twitter_basic_read</td><td>Basic Twitter account info</td></tr><tr><td>discord_basic_read</td><td>Basic Discord account info</td></tr><tr><td>facebook_basic_read</td><td>Basic Facebook account info</td></tr><tr><td>google_basic_read</td><td>Basic Google account info</td></tr><tr><td>steam_basic_read</td><td>Basic Steam account info</td></tr><tr><td>steam_detailed_read</td><td>Detailed Steam account info</td></tr><tr><td>carv_play_basic_read</td><td>Basic CARV Play account info</td></tr><tr><td>evm_address_basic_read</td><td>EVM address</td></tr><tr><td>solana_address_basic_read</td><td>Solana address</td></tr><tr><td>bitcoin_address_basic_read</td><td>Bitcoin address</td></tr><tr><td>platform_detailed_read</td><td>User's account info from your platform/application/game</td></tr><tr><td>platform_detailed_write</td><td>Update user's account info from your platform/application/game to CARV ID</td></tr></tbody></table>

#### Access Token Request

After the user authorizes your application, they will be redirected to your `redirect_uri` with a `code` parameter. Exchange this code for an access token.

```bash
curl -X POST https://oauth.carv.io/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic YOUR_BASE64_ENCODED_CLIENT_ID_AND_SECRET" \
-d "grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=YOUR_REDIRECT_URI"
```

Parameters:

* `grant_type`: Should be `authorization_code`.
* `code`: The authorization code received from the authorization request.
* `redirect_uri`: Must match the redirect URI used in the authorization request.
* `client_id`: Your application's Client ID.
* `client_secret`: Your application's Client Secret.

Sample Python code to encode credentials:

```python
import base64

# Your client ID and client secret
client_id = 'your_client_id_here'
client_secret = 'your_client_secret_here'

# Concatenate the client ID and client secret with a colon
credentials = f"{client_id}:{client_secret}"

# Encode the credentials using base64
encoded_credentials = base64.b64encode(credentials.encode()).decode()

# The result can be used in the Authorization header
print("Basic " + encoded_credentials)
```

Response Sample

```json
{
  "code": 0,
  "msg": "",
  "data": {
    "access_token": "xxxx",
    "token_type": "Bearer",
    "expires_in": "604800",
    "scope": "xxxx",
    "refresh_token": "xxxx",
    "id_token": "xxxx"
  }
}

```

#### Token Refresh Request

Refresh an expired access token using:

```bash
curl -X POST https://oauth.carv.io/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic YOUR_BASE64_ENCODED_CLIENT_ID_AND_SECRET" \
-d "grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN&scope=YOUR_SCOPE"
```

Parameters:

* `grant_type`: Should be `refresh_token`.
* `refresh_token`: The `refresh_code` received from the access token request.
* `scope`: The space-separated list of permissions your application requests.
* `client_id`: Your application's Client ID.
* `client_secret`: Your application's Client Secret.

Response Sample

```json
{
  "code": 0,
  "msg": "",
  "data": {
    "access_token": "xxxx",
    "token_type": "Bearer",
    "expires_in": "604800",
    "scope": "xxxx",
    "refresh_token": "xxxx",
    "id_token": "xxxx"
    }
}
```

#### Fetch User Detailed Info&#x20;

Retrieve detailed user information with:

```bash
curl -X GET https://oauth.carv.io/api/userinfo \
-H "Authorization: Bearer ACCESS_TOKEN"
```

Response Sample

```json
{
  "code": 0,
  "msg": "",
  "data": {
    "smart_wallet_address": "xxxx",
    "signer_wallet_address": "xxxx",
    "email_address": "abc@gmail.com",
    "twitter": {
         "id": "xxxx",
         "username": "xxxx"
         }
    // Additional fields
    }
}
```

#### Update User Profile

Third-party data providers can update the user's profile data via:

```bash
curl -X POST https://oauth.carv.io/api/userinfo/update \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d "user_id=xxx&user_name=xxx&properties={}"
```

Parameters:

* `user_id`: The unique identifier for the user on the third-party platform.
* `user_name`: The name of the user on the third-party platform.
* `properties`: A JSON formatted string containing any additional property data to upload.

Note that to use this API, you will need to apply for the write access scope for the platform.

## Conclusion

This guide outlines the process for securely integrating CARV ID OAuth 2.0 into your applications, enhancing user authentication experiences.


# CARV ID Telegram SDK

## Overview

The **CARV ID Telegram SDK** provides a seamless solution for third-party games and Telegram-based applications to integrate CARV ID functionality.&#x20;

With this SDK, you can connect users to their CARV IDs, enable third-party account binding, and empower developers with access to powerful data insights and analytics powered by CARV ID.

It features both **light and dark modes** for optimal user experience and a **customizable plugin appearance** to match your brand and app design.

## How Does it Work?

The CARV ID Telegram SDK leverages the robust CARV ID suite to simplify authentication and account integration. The following illustration provides an overview of how the CARV ID ecosystem integrates with Telegram applications.

<figure><img src="/files/qe88JMlKtiCPrPkaOW4L" alt=""><figcaption></figcaption></figure>

## Getting Started

The SDK implements the OAuth 2.0 standard, ensuring secure and reliable authentication. You would need to register your application first with CARV.

{% hint style="info" %}
How to register your application:

* **Determining Necessary Permissions**: Begin by reviewing the [application scopes available](#scopes) to identify the permissions your application will need.
* Provide Application Information: Share your application's **Redirect URL** and the **scopes** you've selected based on your needs. Additionally, provide the following information:
  * **Name Displayed on OAuth Screen**: The name of your application as it will appear during the authentication process.
  * **Home Page URL**: The main URL of your application, where users can learn more about your service.
  * **Logo Image URL**: A URL pointing to your logo image, which will be displayed during the authentication process.
  * **Privacy Policy URL**: The URL of your privacy policy page.
  * **Terms of Service URL**: The URL of your terms of service page.
* After we receive this information, we will set up your OAuth configuration and provide you with a Client ID and Client Secret. Keep these confidential.
  {% endhint %}

## Implementation&#x20;

Once you receive your client ID and secret, you integrate the SDK into your Telegram bot. Use the SDK's prebuilt methods to handle user authentication and launch of CARV ID account center.&#x20;

Please refer to our detailed documentation in the Github repository for step-by-step guide via [**https://github.com/carv-protocol/carv-id-sdk**](https://github.com/carv-protocol/carv-id-sdk). You can also access a **demo project and the source code there.**


# Smart Contracts & Security

> For details on contracts related to nodes (veCARV, Node License, etc), please refer to [Smart Contract Addresses](/carv-ecosystem/verifier-nodes/smart-contract-addresses)

## Code Repository

The source code for core contracts can be found below:

{% embed url="<https://github.com/carv-protocol/carv-contracts>" %}

{% embed url="<https://github.com/carv-protocol/contracts>" %}

## Audit Reports

The core contracts have been audited by Certik. You can find the audit reports [here](https://skynet.certik.com/projects/carv).

## Contract Addresses

Here are the list of contract addresses deployed by CARV.

<table><thead><tr><th width="183">Contract Name</th><th width="119">Blockchain</th><th width="151">Token Standard</th><th>Contract Address</th></tr></thead><tbody><tr><td>CARV Token</td><td>Ethereum</td><td>OFT</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>CARV Token</td><td>Base</td><td>OFT</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>CARV Token</td><td>Arbitrum</td><td>OFT</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>CARV Token</td><td>BSC</td><td>OFT</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>CARV Token</td><td>Linea</td><td>OFT</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>CARV Testnet Token</td><td>BNB-testnet</td><td>OFT</td><td>0xbdd15B0fec494a0234F7A13fD60D10f38F751763</td></tr><tr><td>Airdrop SBT</td><td>Base</td><td>ERC721</td><td>0x2b790Dea1f6c5d72D5C60aF0F9CD6834374a964B</td></tr><tr><td>CARV Airdrop</td><td>Base</td><td>Airdrop</td><td>0x584cB7Dae5158be594AA1022Fb38017C791af2A0</td></tr><tr><td>veCARV Airdrop</td><td>Arbitrum</td><td>Airdrop</td><td>0x584cB7Dae5158be594AA1022Fb38017C791af2A0</td></tr><tr><td>veCARV(s)</td><td>Base</td><td>Staking</td><td>0x7aFC144a0c3C62e24d8f9c592feF8F65ce631C59</td></tr><tr><td>CARV Verifier License </td><td>Arbitrum</td><td>ERC721</td><td>0x6584533decbcb8c05fb7eabfa93f92b7b3a85038</td></tr><tr><td>CARV ID</td><td>opBNB</td><td>ERC721</td><td>0xcd3c861a0c8f867f78396a69B14c4F8953fC4Ee9</td></tr><tr><td>.Play Name Service</td><td>opBNB</td><td>ERC721</td><td>0xC5Cb997016c9A3AC91cBe306e59B048a812C056f</td></tr><tr><td>Dragon Treasure</td><td>Polygon</td><td>ERC721</td><td>0x3B1DE80137985CE69C87E999d888c0997F482Fb6</td></tr><tr><td>CARV Events<br></td><td>Polygon</td><td>ERC1155</td><td>0x6d778a0f5e07c01211672F57f246166ccF6541C1</td></tr><tr><td>CARV Events</td><td>BNB Chain</td><td>ERC1155</td><td>0xDda56260FCb1B1C6Ba1D84C5f99f5507d556A04b</td></tr><tr><td>CARV Events</td><td>zkSync</td><td>ERC1155</td><td>0x089b353642E6f066bAD44A6a854Ef4e3bCb0dC9C</td></tr><tr><td>CARV Events</td><td>Solana</td><td>SPL</td><td>8d8d41fc0db5ae1309245fa83d69358ce56baea7ca62799232ccf4950f348954</td></tr><tr><td>CARV Events</td><td>NEAR</td><td>NEP171</td><td>events.carv.near</td></tr><tr><td>CARV Events</td><td>Sei</td><td>CW721</td><td>sei1zc4u2fw96xx03x3lq5pfnk4vsr2rxjylqueucceuhf92te9sregsjak3ac</td></tr><tr><td>CARV Events</td><td>opBNB</td><td>ERC1155</td><td>0xde50d9F0B51C2f81512455bffdf4144cAa58dE0D</td></tr><tr><td>CARV Events</td><td>Ronin</td><td>ERC1155</td><td>SOON</td></tr><tr><td>CARV Events</td><td>Fantom</td><td>ERC1155</td><td>0x8B4dc268F1B28B1eD9F76B0C05CAA3D0a75953BC</td></tr><tr><td>CARV Events</td><td>Linea</td><td>ERC1155</td><td>0x134b50a34a2a56d1dad865a7a7d0f6534c8c4586</td></tr><tr><td>CARV Events</td><td>BNB</td><td>ERC721</td><td>0xb1544f3615B23b0D4fb8B6B71ebC1BD78b636e5F</td></tr><tr><td>CARV Achievements</td><td>Cyber</td><td>ERC1155</td><td>0x2E421EB05Ffa719c42C280Ec0D52b38bB9e7923c</td></tr><tr><td>CARV Achievements (Deprecated)</td><td>Polygon Mumbai</td><td>ERC1155</td><td>0x30F977Ca7e383A1143f4a328eB2B011b664441e4</td></tr><tr><td>CARV Achievements</td><td>BNB Chain</td><td>ERC1155</td><td>0xc2F24Ffe96A69e381A747dc73FCd51492E29a0A4</td></tr><tr><td>CARV Memberships</td><td>Polygon</td><td>ERC721</td><td>0x0433882C60aDa1077A9F652ca2d1D36422c62C6C</td></tr><tr><td>CARV GAT</td><td>Cyber</td><td>ERC721</td><td>0xEb5fB40b071c0d59449a3e12a09dbD0E23f4836E</td></tr><tr><td>CARV GAT (Deprecated)</td><td>Polygon Mumbai</td><td>ERC721</td><td>0x20a1d5D4e8eCa3838f237F98151558831Bc7930b</td></tr><tr><td>SOUL Token</td><td>opBNB</td><td>ERC20</td><td>0xc32338e7f84f4c01864c1d5b2b0c0c7c697c25dc</td></tr><tr><td>SOUL Token</td><td>zkSync</td><td>ERC20</td><td>0x5155704BB41fDe152Ad3e1aE402e8E8b9bA335D3</td></tr><tr><td>SOUL Token</td><td>Ronin</td><td>ERC20</td><td>0xc39a2430b0b6f1edad1681672b47c857c1be0998</td></tr><tr><td>SOUL Token</td><td>Linea</td><td>ERC20</td><td>0xc5cb997016c9a3ac91cbe306e59b048a812c056f</td></tr><tr><td>CARV Pass S2</td><td>Polygon</td><td>ERC1155</td><td>0x4822d5ac20a8242b525f2edabf82b9a2311eb515</td></tr><tr><td>CARV Pass S3</td><td>Polygon</td><td>ERC1155</td><td>0xddA7C9FCCBf2F882C56f97E4647EDc775C5975d8</td></tr><tr><td>CARV Pass S4</td><td>Polygon</td><td>ERC1155</td><td>0xf5f293af7a7a5654c505a21767a9b8ead5835303</td></tr><tr><td>CARV Pass S5</td><td>Polygon</td><td>ERC1155</td><td>0x7C6abC5428ea6Bb952Dd84d2C3694132cD761a96</td></tr><tr><td>CARV Pass S6</td><td>Polygon</td><td>ERC1155</td><td>0x88db2a843b2efc1ccc3c988b1179b86204c897a9</td></tr><tr><td>CARV Pass S7</td><td>Polygon</td><td>ERC1155</td><td>0x6df4741cba8300a9c2eec12c40126b1a06617e88</td></tr><tr><td>CARV Pass S8</td><td>Polygon</td><td>ERC1155</td><td>0xee6160bf539391dbd31378105c2718a7b84f1d5f</td></tr></tbody></table>


# MOFF Bot & Customer Data Platform

A Winner from BNBChain's Zero2Hero Hackathon Gaming Track. Building with CARV's ID SDK and Graph, Incubated by CARV.

Moff is a community bot that supercharges your Discord servers and empowers your community manager with user intelligence. It was a Gaming track winning project, integrating CARV SDK, from BNBChain's Zero2Hero Hackathon.&#x20;

It not only grows your community, helps gain deeper insights into your users, but also streamlines your day-to-day tasks. Moff currently offers the following features:

### User Insights

* **`Insights Dashboard`**: Empower community admins with valuable information and data-driven insights. With this powerful tool, you can now gain a better understanding of your community members x platform activities by accessing in-depth analysis. Discover key demographics, interests, and behaviors, allowing you to refine your messaging and operating strategies with precision. You can access this dashboard on [CARV Portal](/carv-ecosystem/carv-play/portal-access).
* **`ID Graph`**: Gain a better understanding of your community with in-depth analysis of their profiles and refine your messaging and targeting. Let your users connect their wallets and third-party accounts and add more dimensions to the profile of your users. [Details](https://www.notion.so/ID-Graph-c8940690bb43434eba9b809925367d09?pvs=21)

<figure><img src="/files/5c0gDXAZ3aC84Um6agaL" alt="Moff CDP - CARV"><figcaption><p>Moff CDP</p></figcaption></figure>

<figure><img src="/files/l23DgtCOt3cuTP2K0hzn" alt="Moff CDP - CARV"><figcaption><p>Moff CDP</p></figcaption></figure>

### Community Quest Creation on CARV Play

* **`Discord Quests`** Launch your [incentive campaigns](https://www.notion.so/carv-official/Event-Launcher-a8b9664ce751469092e978b3e9724b86) on [mission system](https://www.notion.so/carv-official/Missions-System-3e05da5f70084af28798164fb9c104a7) CARV and attract users to join your Discord, get a certain role, send messages, invite others to your server, etc. [Details](https://www.notion.so/2f4becefb5b64bfcbf10b08873e64eaf?pvs=21)

<figure><img src="/files/AnA8zUnOZbgnADu8l8BD" alt="CARV Portal UI"><figcaption><p>CARV Portal UI</p></figcaption></figure>

### **Community Management**

* **`Channel Snapshot`**: Record the attendance of live-streaming events, e.g., AMA, and how long each member stays for the live event using this feature. It can be activated in Text, Forum, Voice, and Stage channels. The attendance can be exported as Google Sheets or viewed via Insights Dashboard on CARV Portal. [Details](https://www.notion.so/Channel-Snapshot-93b3393e6ad647b48740120fb13b2d2a?pvs=21)

<figure><img src="/files/Uh759g9KoVoNIpuDLPol" alt="Moff Community Snapshot - CARV"><figcaption><p>Moff Community Snapshot - CARV</p></figcaption></figure>

### **Campaign Traffic Tracking**

* **`Permanent Invites`**: Create never-expiring Discord invite links customized for each campaign and each distribution source. And track the performance of your campaigns and effectiveness of your distribution sources to grow your community in the future. Such insights can also be viewed via Insights Dashboard on [CARV Portal](/carv-ecosystem/carv-play/portal-access).  [Details](https://www.notion.so/Permanent-Invites-3689f1d44a594fbaa23479c68643a79c?pvs=21)

<figure><img src="/files/qyHRYh5Narupv8vwT7NE" alt="Moff Community Growth - CARV"><figcaption><p>Moff Community Growth</p></figcaption></figure>

Visit [Moff Guide](https://www.notion.so/carv-official/Moff-Guide-b20d93b13f1141be97a6218d26e4a270) at [Help Center](https://carv-official.notion.site/CARV-Help-Center-94043498ebdc4a9a8fd5fc3315ae819c) for more details!


# CARV Account

Like your Meta, Instagram, X IDs and ENS Domains, but now you aggregate them and truly own it!

Both in Web2 and Web3 realms, your IDs pertain to user identitification mechanisms. But in Web2, where you've had your most online actvities in the past 40 years or throughout your lifetime, your IDs are:

* **Under Centralized Control** with **u**ser data and identities are stored on centralized servers
* **Data Ownership with Limited Control** by users on how it's used or shared.
* **Privacy and Security Issues** with potential single point of failure and potential data breaches.
* **Walled Garden of Siloed Data** leading to fragmented digital identities.

On the other side, one of the most interesting aspects of Web3 is the ability to bring an individual’s own identity to different applications. Even more powerful is the fact that individuals truly own their accounts without relying on centralized gatekeepers, disclosing to different apps components necessary for authentication and approved by individuals.&#x20;

Existing solutions such as ENS, although open, decentralized, and more convenient for Ethereum-based applications, suffer from a lack of data standardization and authentication of identity due to inherent anonymity. Other solutions such as SBTs rely on centralized attestors, cannot prevent data tampering, and do not inscribe data into the ledger itself in a privacy enabling way.&#x20;

So CARV raised a novel solution, standardize it, [ERC 7231: Identity Aggregated NFT](/carv-ecosystem/carv-account/erc-7231) and launched CARV ID integrated with this standard, an extention of ERC 721 token. With CARV ID, a multi-chain identity aggregating Web2 and Web3 IDs, empowering users to have a unified identity across the universe with:

* Credential showcasing: Your ownership, role-behaviors, social relation, and past experiences all can be authorized, verified, and generated into your digital identity and credentials as hard proof to showcase.
* Integration capabilities: Applications can integrate CARV ID and gain consented access to user data within your products, empowering interoperability.


# ERC 7231

The ERC 7231: Identity Aggregated NFT, pushes the boundaries of solving identity problems with Identity Aggregated NFT, i.e., the individual-authenticated aggregation of web2 and web3 identities to NFTs (SBTs included).

This standard extends [ERC-721](https://eips.ethereum.org/EIPS/eip-721) by binding individuals’ Web2 and Web3 identities to non-fungible tokens (NFTs) and soulbound tokens (SBTs). By binding multiple identities, aggregated and compossible identity information can be verified, resulting in more beneficial onchain scenarios for individuals, such as self-authentication, social overlapping, commercial value generation from user targeting, etc. By adding a custom schema in the metadata and updating and verifying the schema hash in the contract, the binding of NFT and identity information is completed.

Designing the proposal, we considered the following problems that are solved by this standard:&#x20;

<figure><img src="https://eips.ethereum.org/assets/eip-7231/img/Identity-aggregated-NFT-flow.png" alt="ERC 7231"><figcaption><p>ERC 7231: : Identity Aggregated NFT</p></figcaption></figure>

1. Resolve the issue of multiple ID bindings for web2 and web3. By incorporating the MultiIdentities schema into the metadata file, an authorized bond is established between user identity information and NFTs. This schema encompasses a userID field that can be sourced from a variety of web2 platforms, or a decentralized identity (DID) created on blockchain. By binding the NFT ID with the UserIDInfo array, it becomes possible to aggregate multiple identities seamlessly.
2. Users have full ownership and control of their data. Once the user has set the metadata; they can utilize the setIdentitiesRoot function to establish a secure binding between hashed userIDs objects and NFT ID. As only the user holds the authority to carry out this binding, it can be assured that the data belongs solely to the user.
3. Verify the binding relationship between data on-chain and off-chain data through signature based on [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) Through the signature method based on the [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) protocol, the verifyIdentiesBinding function of this EIP realizes the binding of the userID and NFT owner address between the on-chain and off-chain.
   * NFT ownership validation
   * UserID format validation
   * IdentitiesRoot Consistency verification
   * Signature validation from NFT owner

As for how to verify the authenticity of the individuals’ identities, wallets, and accounts, there are various methods, such as ZK-based DID authentication on-chain, and off-chain authentication algorithms, such as auth2, openID2, etc.

To learn more about this Ethereum Improvement Proposal #7231, please read [here](https://eips.ethereum.org/EIPS/eip-7231).


# Verifier Nodes

Verifier nodes are components of the [verification layer](broken://pages/f3qNmGd14Orx00KB8FRl).

Verifier nodes are lightweight nodes managed by the community. They play a crucial role in maintaining the protocol's integrity, thereby enhancing its trustworthiness and security. Currently, these nodes primarily check TEE attestations on-chain, verifying that the results are reliable and that the process maintains the privacy of user data.


# How to Purchase Nodes

#### **Step 1 - Go to** [**https://node.carv.io/buy**](https://node.carv.io/buy) **and connect your wallet**

<div align="left"><figure><img src="/files/nxl0DXbI2IGoBpTpEMXo" alt=""><figcaption></figcaption></figure></div>

#### **Step 2 - Get ETH or CARV and Arbitrum gas tokens**

The CARV Verifier Node Sale will be on the Arbitrum Network. You will need:

* ETH or CARV on Arbitrum network
* ETH for gas fees

{% hint style="info" %}
If you only have CARV on Base network, you can use the token bridge to transfer your CARV tokens to Arbitrum One.\
&#x20;![](/files/JtqSkcr2b7CjDpS2tLjt)

Enter the amount of tokens you'd like to transfer. Note that there will be a 0.1% fee applied to every transfer in addition to the network fees. The transfer usually take less than a minute.\
![](/files/DZ5mAnUNtpOYX36aHuyu)&#x20;
{% endhint %}

#### **Step 3 - Select payment option and set the amount of node(s)**

Choose ETH or CARV and enter the number of node(s) that you will be purchasing.

<div align="left"><figure><img src="/files/X1CBWGP4gzZhJl6ilAY2" alt="" width="466"><figcaption></figcaption></figure></div>

#### **Step 4 - Agree to all the terms, conditions and disclaimers**

<div align="left"><figure><img src="/files/ajegp2Xx5JM3fZc1gWWU" alt=""><figcaption></figcaption></figure></div>

#### **Step 5 - Purchase your Verifier Node License**

Click `Buy Now` and approve the transaction in your wallet.

#### **Step 9 - Success!**

After confirming your purchase, you will receive a notification on the top right of the page to inform you on the successful purchase. The License NFT(s) will minted to your wallet within a few minutes.

**Congratulations, you have now successfully purchased your Verifier Node granting you access to operate a node on CARV!**


# Buyback Program

## **What is the Up-to-100% Buyback Program?**

In order to empower our community to participate confidently in building the foundation of a sustainable, user-owned internet, CARV is pioneering a mechanism: the 'Up-to-100% Buyback Program',

**Eligibility:** Pre-Token Generation Event (TGE) Node license holders who have maintained 70% or higher participation rate, and have not claimed any veCARV rewards will be eligible for the buyback program.

{% hint style="info" %}
Participants who delegate their node, instead of running it independently, must delegate only to nodes with a commission rate of up to 3% and that maintain over 70% uptime until the buyback claim is made. Additionally, these delegators are not eligible to claim any remaining rewards beyond what is covered by the delegation terms.
{% endhint %}

**Timeline:** From six months post Token Generation Event (TGE), node license holders have 7 days to participate in the Program.

### **Execution options:**

**100% buyback with $CARV**, value equivalent to the price of nodes denominated in USDT at the time of node purchase. 30-day linear vesting from time of buyback. OR

**80% immediate buyback in ETH**, value equivalent to the price of nodes snapshot in ETH at time of purchase. Immediate ETH release.\
To ensure transparency and security, CARV is integrating the 100% buyback program into smart contracts and collaborating with reputable, top-tier third-party auditors.

{% hint style="info" %}
Funds will be collected in a [Ceffu ](https://www.ceffu.com/)cold wallet address and serve as the security deposit for the ETH buyback.

Arbitrum Address: [0x3014Ab992464E3323D4b53570baDF782aC897a67 ](https://arbiscan.io/address/0x3014Ab992464E3323D4b53570baDF782aC897a67)
{% endhint %}

10,000,000 $CARV is allocated from treasury to ensure a 100% buyback with a 30-day linear vesting period. Node license holders will keep all airdrops prior to participation in the Program.

Some of the bought-back nodes will be reallocated to existing active node operators to further incentivize their participation. The rest will go to the CARV treasury, with potential uses including sharing node operation rewards with $CARV stakers, or conducting node resale or burning.\
\
More information will be announced on this webpage. You can also follow CARV's social media and community to receive notifications.


# Why Verifier Nodes

CARV is renowned for developing both applications and a foundational, modular data layer protocol known as the CARV Protocol. This protocol manages end-to-end data flow, including identity aggregation through [CARV ID](broken://pages/fZG5E7KkcezXwVce3Lch) ([ERC7231](https://eips.ethereum.org/EIPS/eip-7231)), data authentication ([CARVLink](broken://pages/fZG5E7KkcezXwVce3Lch)), storage ([CARV DB](broken://pages/IIphEh6X85yFmRvKHDqi)), processing, and AI model training. Results from these processes are posted across multiple blockchains to ensure fair value distribution.

To safeguard the security, decentralization, and privacy of this complete flow, it is critical to incorporate community-operated verifier nodes. These nodes scrutinize the outcomes at each protocol layer, ensuring integrity and compliance with set standards. Currently, these nodes are primarily focused on verifying results from the data processing and AI model training layers. Computations and model training are conducted within Trusted Execution Environment (TEE) clusters to protect user data privacy. The outcomes are then recorded on the blockchain, accompanied by TEE attestation to verify that the processes are secure and private, enabling equitable redistribution of data value among various stakeholders.

However, to prevent system manipulation and ensure a fair distribution of data value, involving a third-party to verify the TEE attestation is essential. This necessity drives our active pursuit of community participation to strengthen the protocol by operating these verifier nodes.

A single honest node can detect fraudulent activity, but achieving significant enforcement against misbehaving TEE nodes and protecting user data requires that at least half of the nodes operate honestly. Therefore, establishing a decentralized network of community nodes is crucial not only for securing the protocol but also for its scalability.

Looking ahead to Q3 2024, these nodes will take on additional responsibilities such as verifying CARV DB, an Autonomous Virtual Storage (AVS) built on Eigenlayer, to ensure reliable content storage for each operator. By Q4 2024, the scope will broaden to include securing CARV Link, an on-chain Oracle/Attestation service that seamlessly imports data from both web2 and web3 sources into the CARV protocol, thereby creating value for users and businesses. Expanding our community node base is vital to support these growing responsibilities and ensure the ongoing robustness of the CARV ecosystem.

<br>


# How do Verifier Nodes Work

## Overview

<figure><img src="/files/Tl39Lze38zPjRHcYzghg" alt=""><figcaption><p>CARV Smart Contract Design</p></figcaption></figure>

The CARV Protocol consists of five key modules, each corresponding to a separate smart contract: **Proxy**, **Service**, **Vault**, **VRF Manager**, and **Settings**. Each module serves a specific function within the system:

* **Vault Contract:** The Vault contract is responsible for managing the assets within the CARV Protocol. It supports three distinct roles: **CARV Treasury**, **veCARV Reward Pool**, and each role is limited to specific operations that can be executed only through predefined methods. The Vault also defines the **reward release curve**, which governs and restricts how reward funds are handled.
* **Settings Contract**: This contract manages all the configurations within the CARV Protocol.
* **VRF Manager Contract**: The VRF Manager is used to obtain random numbers by calling services like **Chainlink** or **CARVLink** and processing their callbacks. It ensures that logic contracts can access random numbers in a **decoupled** way, allowing smooth upgrades to the random number generation logic without disrupting the system.
* **NFT Contract:** This contract oversees the purchase and redemption of NFTs by users. The ETH from NFT purchases is stored in the NFT account within the Vault. Upon redemption, 80% of the ETH is returned to the user (with the remaining 20% serving as a channel fee) or exchanged for an equivalent amount of CARV, which is then linearly released back to the user. The exchange of ETH for CARV is managed by the foundation, completed by the Vault contract, and based on Chainlink exchange rates.
* **Protocol Service Contract:** This contract handles the majority of the business logic and includes several components:
  * **Access Management**: Manages different roles such as admin, TEE (Trusted Execution Environment), and slash roles.
  * **System Parameter Management**: Governs system parameters through the Settings contract.
  * **Verifier Operations**: Includes actions like entering, exiting, reporting activity, applying slashes, and managing commissions and claimers.
  * **Delegation Operations**: Includes delegation, redelegation, and undelegation processes.
  * **Report Operations**: Manages attestations and verifications.
  * **Claim Operations**: Handles verifier claims and NFT token ID claims.

## Verifier Nodes Workflow

1. Upon completing data processing, TEE nodes submit the data verification, AI model training result and the TEE attestation to smart contracts on the execution layer.
2. The smart contracts employ a Verifiable Random Function (VRF) to randomly choose a subset of verifiers for attestation validation.

   > In cryptography, a verifiable random function (VRF) is a random number generator (RNG) that generates an output that can be cryptographically verified as random. Verifiable randomness is essential to many blockchain applications because its tamper-proof unpredictability enables exciting gameplay, rare NFTs, and unbiased outcomes. As the name suggests, a verifiable random function is defined by its core features: Verifiable, Random, Function.
3. Verifiers monitor events from the smart contract to initiate the verification process.
4. Verifiers assess the authenticity of the attestation. For more details, please check [SGX Attestation Verification](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/sgx-attestation-verification)
5. Based on the outcome, verifiers relay their findings to the smart contract:
   * If the attestation is invalid, the smart contract penalizes the responsible TEE node by slashing its stake, which is then allocated to the verifiers as additional rewards.
6. When the attestation is confirmed as valid with over 50% of designated Verifiers, the smart contract distributes not only the consumers' fees but also on-chain rewards among the TEE nodes, verifiers, and data providers.


# CARV/veCARV Token

## **CARV Token**

1. Implements the standard ERC20 (decimals: 18).
2. Mints 1 billion tokens to a specified address upon deployment; no further minting is possible afterward.

## **veCARV Token**

1. A non-transferable ERC20 token (decimals: 18), where standard addresses cannot invoke transfer or *transferFrom* methods.
2. Only the Vault contract can call transfer, used for distributing user verification rewards.
3. Locks the CARV Token address upon deployment, which cannot be modified thereafter.
4. No explicit minting method; veCARV can only be minted through 1:1 staking of CARV and is burned upon redemption.
5. Future governance of the CARV protocol will be enabled by associating the veCARV Token address with the governance contract.

### Function Definitions & Explanations

Reference: <https://docs.carv.io/carv-token/utility>

```Solidity
interface IveCarv {

    /**
     * @notice This struct represents information about a Withdraw by the user.
     *
     * `withdrawer`: address of who initiates this Withdraw.
     * `canceledOrClaimed`: Has this Withdraw been canceled or claimed?
     * `amount`: The amount of Withdraw initiated by the user.
     * `timestamp`: The time this Withdraw was initiated.
     */
    struct WithdrawInfo {
        address withdrawer;
        bool canceledOrClaimed;
        uint256 amount;
        uint256 timestamp;
    }

    event Deposit(address depositer, uint256 amount);

    event Withdraw(uint64 indexed id, address withdrawer, uint256 amount);

    event CancelWithdraw(uint64 indexed id);

    event Claim(uint64 id, uint256 amount);

    event ClaimBatch(uint64[] ids, uint256 amount);

    /**
     * @notice convert CARV to veCARV by locking CARV in this contract and minting veCARV to msg.sender.
     * @notice CARV can be converted to veCARV with 1:1 ratio through deposit.
     * @notice veCARV stands for voting-escrow CARV, is a non-transferable token. veCARV is mainly used for:
     * @notice 1. CARV Protocol governance.
     * @notice 2. Incentive to bootstrap incentive layer, e.g., data owners, providers, consumers.
     * @notice 3. Used for governance voting in P2E system 'Infinite Play'.
     * @notice 4. Used in P2E systems to delegate voting rights to escrow pool owners and receive pool rewards.
     * @notice 5. Incentivizes node operators who secure and support the network.
     *
     * @dev Emits `Deposit`.
     *
     * @param amount: amount of CARV to be deposited
     */
    function deposit(uint256 amount) external;

    /**
     * @notice convert veCARV to CARV, veCARV conversion to CARV requires an unlocking period.
     * @notice The withdraw rate varies for different unlocking periods,
     * @notice with longer unlocking periods resulting in higher withdraw rates, reaching up to 100%.
     * @notice Users are required to pay a network channel fee of 1 CARV each time they initiate a Withdraw.
     *
     * @dev Emits `Withdraw`.
     *
     * @param amount: amount of veCARV to be withdrawn
     */
    function withdraw(uint256 amount) external;

    /**
     * @notice Cancel the Withdraw by withdrawID.
     * @notice It can be canceled before the user claims.
     * @notice After the operation, the locking veCARV is returned to msg.sender.
     *
     * @dev Emits `CancelWithdraw`.
     *
     * @param withdrawID: The withdrawID that the user needs to cancel
     */
    function cancelWithdraw(uint64 withdrawID) external;

    /**
     * @notice Return the CARV corresponding to the specified withdrawID to the user.
     * @notice The relationship between the user’s Locking Duration and claimable ratio is as follows:
     *    ----------------------------------------------------
     *    |   Locking Duration (Days)   |    Claims (CARV)   |
     *    |            15               |        25%         |
     *    |            90               |        60%         |
     *    |           150               |       100%         |
     *    ----------------------------------------------------
     * @notice after that, Burn the locking veCARV corresponding to the specified withdrawID
     * @notice If the Locking Duration is less than 150 days, the remaining CARV will be:
     * @notice 1. 50% enter the CARV foundation to maintain network operation.
     * @notice 2. 50% will be burned, which makes CARV deflationary.
     *
     * @dev Emits `Claim`.
     *
     * @param withdrawID: The withdrawID that the user needs to claim CARV
     */
    function claim(uint64 withdrawID) external;

    /**
     * @notice To claim CARV by withdrawIDs (Batch).
     *
     * @dev Emits `ClaimBatch`.
     *
     * @param withdrawIDs: The withdrawIDs that the user needs to claim CARV
     */
    function claimBatch(uint64[] calldata withdrawIDs) external;
}
```


# CARV Vault

## **CARV Vault**

1. The Vault contract manages funds, distinguishing account permissions where each role can only call methods specific to its permissions.
2. Except for the foundation address, other addresses must be preset and cannot be changed afterward. The foundation can only operate assets within its designated permissions, ensuring the overall security of CARV Protocol funds.

The Vault contract includes the following account permissions:

* **Foundation Account:** Receives protocol-generated fees (e.g., from NFT redemptions or veCARV withdrawals) and acts as a buffer for fund exchanges (e.g., CARV/ETH exchanges required by the system). It also has the authority to initialize rewards accounts.
* **Rewards Account:** Pre-funded by the foundation, releasing funds strictly according to a curve (with a fixed daily release of veCARV Tokens, decreasing by 25% every six months). For details, refer to [Node Rewards](https://docs.carv.io/carv-protocol/verifier-node-explained/node-rewards).

### **Function Definitions & Explanations**

```Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.20;

interface IVault {

    event FoundationWithdraw(address token, uint256 amount);

    event RewardsDeposit(uint256 amount);

    event RewardsWithdraw(address to, uint256 amount);

    event ChangeFoundation(address newFoundation);

    /**
     * @notice Withdraw token by foundation: by specifying the token address and amount.
     * @notice Foundation authorities can only withdraw token from their own accounts and cannot operate locked assets.
     *
     * @dev Emits `FoundationWithdraw`.
     *
     * @param token: address of withdraw token, nil address is the source token(like eth)
     * @param amount: amount of withdraw token
     */
    function foundationWithdraw(address token, uint256 amount) external;

    /**
     * @notice Rewards account Deposit, only foundation authority can operate
     * @notice Deposit veCARV(CARV -> veCARV) for verification rewards
     * @notice Define token release rules
     *
     * @dev Emits `RewardsDeposit`.
     */
    function rewardsDeposit(uint256 amount) external;

    /**
     * @notice Called by ServiceProtocol contract, used to issue rewards to nodes or NFT holders.
     * @notice Strictly follow the release rules and do not release beyond the rules.
     *
     * @dev Emits `RewardsWithdraw`.
     *
     * @param receiver: address to receive rewards
     * @param amount: amount of rewards
     */
    function rewardsWithdraw(address receiver, uint256 amount) external;

    /**
     * @notice Change the address of foundation.
     * @notice can only be operated by foundation authority
     *
     * @dev Emits `ChangeFoundation`.
     *
     * @param newFoundation: address of new foundation.
     */
    function changeFoundation(address newFoundation) external;

    function startTimestamp() external view returns (uint256);

    function totalRewardByDate(uint32 dateIndex) external pure returns (uint256);
}
```


# CARV NFT License

## CARV NFT License

1. Non-transferable ERC-721 (can be updated with governance).
2. Only syndicate funds can transfer NFT once and redistribute to their community.
3. A maximum of 100,000 tokens can be minted, with token IDs incrementing automatically.
4. Upon redemption, the token ID is permanently destroyed, and any unclaimed veCARV reverts to the foundation.
5. To redeem the NFT License, transfer the NFT to our predefined address. Redemption will be available 6 months after the TGE.

**Function Definitions & Explanations**

```Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

interface ICarvNft {
    /**
     * @notice This struct represents meta information bound to TokenID,
     *
     * `code`: code of this token entered by buyer
     * `price`: price of this token paid by buyer
     * `tier`: tier of this token
     */
    struct MetaData {
        string code;
        uint64 price;
        uint8 tier;
    }

    /**
     * @notice mint {count} nft to {receiver}.
     * @notice totalSupply 100,000
     *
     * @dev Auth: Only Owner.
     *
     * @param receiver: nft receiver
     * @param count: how many nft to be minted to receiver
     * @param meta: `MetaData` of this tokenID
     */
    function mint(address receiver, uint256 count, MetaData calldata meta) external;

    /**
     * @notice mint {counts} nft to {receivers}.
     * @notice call `mint`
     *
     * @dev Auth: Only Owner.
     *
     * @param receivers: array of receivers
     * @param counts: array of counts
     * @param metas: array of meta
     */
    function mintBatch(address[] calldata receivers, uint256[] calldata counts, MetaData[] calldata metas) external;

    /**
     * @notice Set BaseURI of all the tokens
     *
     * @dev Auth: Only Owner.
     *
     * @param newBaseURI: newBaseURI
     */
    function setBaseURI(string memory newBaseURI) external;

    /**
     * @notice Set TransferProhibitedUntil
     * @notice When the time has not reached the `TransferProhibitedUntil`, ordinary tokens cannot be transferred.
     *
     * @dev Auth: Only Owner.
     *
     * @param newTransferProhibitedUntil: newTransferProhibitedUntil
     */
    function setTransferProhibitedUntil(uint256 newTransferProhibitedUntil) external;

    /**
     * @notice Set RedeemAddress
     * @notice When `transfer.to` is RedeemAddress, the token can be transferred under any circumstances
     *
     * @dev Auth: Only Owner.
     *
     * @param newRedeemAddress: newRedeemAddress
     */
    function setRedeemAddress(address newRedeemAddress) external;

    /**
     * @notice Set TransferOnceWhitelist
     * @notice Addresses in the whitelist can transfer tokens once before `TransferProhibitedUntil`
     *
     * @dev Auth: Only Owner.
     *
     * @param whitelist: whitelist
     */
    function setTransferOnceWhitelist(address[] calldata whitelist) external;
}
```


# CARV Protocol Service

## CARV Protocol Service

* Utilizes a proxy contract.
* Manages system parameters separately through the Settings contract.
* The **VRF Manager contract** decouples random number generation logic from the core logic contracts, allowing for seamless upgrades.
* The contract itself does not store any funds; all assets are managed within the **Vault contract**, with specific roles assigned to manage funds through predefined actions.
* Implements the main logic of the CARV protocol.

### **Core Function Explanations**

[Trusted Execution Environment (TEE)](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/trusted-execution-environment-tee)

[Verifier Node](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/verifier-node)

[Attestation](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/attestation)

[Delegation](/carv-ecosystem/verifier-nodes/delegation)

[Rewards](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/rewards)

**Function Definitions & Explanations**

```Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

interface IProtocolService {

    /**
     * @notice This enum represents result of an attestation reported by verifier
     *
     * `Valid`: This attestation can be parsed successfully and is not malicious
     * `Invalid`: This attestation cannot be parsed successfully
     * `Malicious`: This attestation can be parsed successfully but is malicious
     */
    enum AttestationResult {
        Valid,
        Invalid,
        Malicious
    }

    /**
     * @notice This struct represents information of a node
     *
     * `id`: The globally unique ID of the node. The node is automatically registered when
     *        it calls `nodeEnter` for the first time. Up to 65535 nodes can be registered.
     * `listIndex`: The position of the node in the current `activeVrfNodeList`
     * `active`: Is the node active?
     * `lastConfirmDate`: The date on which reward was last confirmed.
     * `missedVerifyCount`: The number of verifications the node currently misses
     * `selfTotalRewards`: The total rewards of the node itself
     * `selfClaimedRewards`: The rewards claimed by the node itself
     * `delegationRewards`: The rewards of the node’s delegator
     * `lastEnterTime`: The time when the node last called `nodeEnter` to go online
     * `commissionRate`: rate of commission, which is given by NFT holders to the verifier node.(decimals: 4)
     * `commissionRateLastModifyAt`: timestamp of last modifying commission rate
     */
    struct NodeInfo {
        uint16 id;
        uint16 listIndex;
        bool active;
        uint32 lastConfirmDate;
        uint64 missedVerifyCount;
        int256 selfTotalRewards;
        uint256 selfClaimedRewards;
        uint256 delegationRewards;
        uint256 lastEnterTime;
        address claimer;
        uint32 commissionRate; // decimals: 4
        uint256 commissionRateLastModifyAt;
    }

    /**
     * @notice This struct represents reward information of a CarvNft token
     *
     * `initialRewards`: When this tokenID is delegated to a node, the initial amount of delegator's rewards needs to be recorded.
     * `totalRewards`: The amount of rewards this tokenID has been confirmed
     * `claimedRewards`: The amount of rewards this tokenID has been claimed
     */
    struct TokenRewardInfo {
        uint256 initialRewards;
        uint256 totalRewards;
        uint256 claimedRewards;
    }

    /**
     * @notice This struct represents staking information of a tee
     *
     * `valid`: Whether tee is currently valid, invalid tee cannot report attestation
     * `staked`: tee’s current staked amount
     * `lastReportAt`: The time when tee last reported attestation, used for unstake check
     */
    struct TeeStakeInfo {
        bool valid;
        uint256 staked;
        uint256 lastReportAt;
    }

    /**
     * @notice This struct represents information of an attestation
     *
     * `reporter`: The address of the tee who reported this attestation
     * `valid`: The number of votes that this attestation is considered valid (voted by the verifier node)
     * `invalid`: The number of votes that this attestation is considered invalid (voted by the verifier node)
     * `vrfChosenID`: ID of the currently randomly selected verification nodes
     * `slashed`: Has this attestation been slashed?
     * `deadline`: Deadline for collecting verification
     */
    struct Attestation {
        address reporter;
        uint16 valid;
        uint16 invalid;
        uint16 malicious;
        uint32 vrfChosenID;
        bool slashed;
        uint256 deadline;
    }

    /**
     * @notice This struct represents information of an verification with signature
     *
     * `result`: result of this attestation
     * `index`: index of this node in activeVrfNodeList
     * `signer`: address of this node (sign the Data to call contract gasless)
     * `v`: v of signature signed by signer
     * `r`: r of signature signed by signer
     * `s`: s of signature signed by signer
     */
    struct VerificationInfo {
        AttestationResult result;
        uint16 index;
        address signer;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    // admin
    event UpdateVrfAddress(address vrf);
    event UpdateSettingsAddress(address settings);

    // tee
    event TeeStake(address tee, uint256 amount);
    event TeeUnstake(address tee, uint256 amount);
    event TeeSlash(address tee, bytes32 attestationID, uint256 amount);
    event ClaimMaliciousTeeRewards(address verifer, uint256 amount);
    event TeeReportAttestations(address tee, bytes32[] attestationIDs, string[] attestationInfos, uint256 requestID);
    event ConfirmVrfNodes(uint256 requestId, uint16[] vrfChosen, uint256 deadline);

    // node
    event NodeRegister(address node, uint16 id);
    event NodeActivate(address node);
    event NodeClear(address node);
    event NodeSlash(address node, bytes32 attestationID, uint256 rewards);
    event NodeModifyCommissionRate(address node, uint32 commissionRate);
    event NodeSetClaimer(address node, address claimer);
    event NodeClaim(address node, address claimer, uint256 rewards);
    event NodeReportVerification(address node, bytes32 attestationID, AttestationResult result);
    event NodeReportVerificationBatch(bytes32 attestationID, VerificationInfo[] infos);

    // delegation
    event Delegate(uint256 tokenID, address to);
    event Redelegate(uint256 tokenID, address to);
    event Undelegate(uint256 tokenID, address to);
    event ClaimRewards(uint256 tokenID, uint256 rewards);

    /*----------------------------------------------------------------------------------------------------------------*/

    /**
     * @notice update address of Settings contract.
     *
     * @dev Only admin role.
     * @dev Emits `UpdateSettingsAddress`.
     *
     * @param settings_: address of Settings contract.
     */
    function updateSettingsAddress(address settings_) external;
    /**
     * @notice update address of CarvVrf contract.
     *
     * @dev Only admin role.
     * @dev Emits `UpdateVrfAddress`.
     *
     * @param carvVrf_: address of CarvVrf contract.
     */
    function updateVrfAddress(address carvVrf_) external;

    /**
     * @notice Tee needs to stake CARVs before reporting attestation,
     * @notice and CARVs will be converted to veCARVs stored in Vault.
     * @notice which will be used to slash when tee proven to be evil.
     *
     * @dev Only tee role (granted by admin role).
     * @dev Emits `TeeStake`.
     *
     * @param amount: amount of CARV tee plans to stake.
     */
    function teeStake(uint256 amount) external;

    /**
     * @notice Tee withdraws staked veCARVs, rules are as follows:
     * @notice 1. enough time has passed since the last attestation was submitted.
     * @notice 2. veCARVs that have been slashed cannot be unstaked.
     * @notice 3. unable to continue reporting attestation after unstaking.
     *
     * @dev Only tee role (granted by admin role).
     * @dev Emits `TeeUnstake`.
     */
    function teeUnstake() external;

    /**
     * @notice When the attestation reported by a tee is proven to be malicious,
     * @notice anyone can initiate a teeSlash, which will slash the veCARVs staked by the tee.
     * @notice Each malicious attestation can only be slashed once.
     * @notice When the veCARVs staked by a tee are slashed below a threshold,
     * @notice the tee will be forcibly restricted from continuing to report attestation.
     *
     * @dev Emits `TeeSlash`.
     *
     * @param attestationID: id of attestation which is proven malicious.
     */
    function teeSlash(bytes32 attestationID) external;

    /**
     * @notice When an attestation reported by a tee is slashed,
     * @notice verifiers that have reported verification for this attestation can claim the reward.
     * @notice If a verifier have not reported verification of this attestation, it cannot claim the reward.
     *
     * @dev Emits `ClaimMaliciousTeeRewards`.
     *
     * @param attestationID: id of attestation which is slashed.
     */
    function claimMaliciousTeeRewards(bytes32 attestationID) external;

    /**
     * @notice Tee reports attestations. The same attestation can only be reported once.
     *
     * @dev Only staked tee role.
     * @dev Emits `TeeReportAttestations`.
     * @dev A request to apply for VRF will be sent to chainlink.
     * @dev After receiving the callback from chainlink, emits `ConfirmVrfNodes`.
     *
     * @param attestationInfos: attestations to be reported.
     */
    function teeReportAttestations(string[] memory attestationInfos) external;

    /**
     * @notice In order to save costs more efficiently when selecting nodes in VRF,
     * @notice we designed a data structure `activeVrfNodeList` for this purpose.
     * @notice `activeVrfNodeList` stores up to 2000 active nodes with delegation weight,
     * @notice and each time VRF will select from these nodes.
     *
     * @notice Nodes need to activate themselves by calling nodeEnter of the smart contract
     * @notice To successfully activate a node, caller need to meet the following conditions:
     * @notice 1. The caller needs to hold CarvNft, or be delegated by other holders
     * @notice 2. If the current `activeVrfNodeList` is full, you need to choose a node
     * @notice    in the list with less delegation weight than yourself to replace it.
     *
     * @dev Emits `NodeActivate`.
     * @dev If any node is kicked and replaced by your node. Emits `NodeClear`.
     * @dev If any node calls nodeEnter for the first time. Emits `NodeRegister`.
     *
     * @param replacedNode: address of the node that needs to be replaced by your node
     *                  only works when the `activeVrfNodeList` is full
     */
    function nodeEnter(address replacedNode) external;

    /**
     * @notice Exits by node itself, and verification cannot be reported after exiting.
     * @notice When a node exits, it will be punished based on missing counts during the online period.
     *
     * @dev Emits `NodeClear`.
     */
    function nodeExit() external;

    /**
     * @notice Modify the commission rate of verifier node
     *
     * @dev Emits `NodeModifyCommissionRate`.
     *
     * @param commissionRate: rate of commission, which is given by NFT holders to the verifier node
     */
    function nodeModifyCommissionRate(uint32 commissionRate) external;

    /**
     * @notice Similar to `nodeEnter`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeEnter`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeActivate`.
     * @dev If any node is kicked and replaced by your node. Emits `NodeClear`.
     * @dev If any node calls nodeEnter for the first time. Emits `NodeRegister`.
     *
     * @param replacedNode: address of the node that needs to be replaced by your node
     *                  only works when the `activeVrfNodeList` is full
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node ready to enter
     */
    function nodeEnterWithSignature(
        address replacedNode, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Similar to `nodeExit`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeExit`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeClear`.
     *
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node ready to exit
     */
    function nodeExitWithSignature(
        uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Similar to `nodeModifyCommissionRate`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeModifyCommissionRate`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeModifyCommissionRate`.
     *
     * @param commissionRate: rate of commission, which is given by NFT holders to the verifier node
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node
     */
    function nodeModifyCommissionRateWithSignature(
        uint32 commissionRate, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Specify the address that can claim rewards of this verifier node
     * @notice it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeSetClaimer`.
     *
     * @param claimer: address of whom can claim reward of this verifier
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node
     */
    function nodeSetRewardClaimerWithSignature(
        address claimer, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Claim reward of node.
     * @notice The reward for reporting verifications is divided into two parts: node's reward and delegators' reward
     * @notice Only when the node is online for more than 6 hours/day will there be reward.
     *
     * @dev Emits `NodeClaim`.
     *
     * @param node: address of node to claim reward
     */
    function nodeClaim(address node) external;

    /**
     * @notice Anyone can initiate a slash for a miss reporting of a node.
     * @notice Each miss reporting of a node can only be slashed once.
     * @notice When a node is selected by VRF but fails to report a verification within the specified time,
     * @notice the node can be slashed.
     *
     * @dev Emits `NodeSlash`.
     *
     * @param node: address of node to be slashed
     * @param attestationID: id of attestation that node miss reporting
     * @param index: index of this node in vrfChosen list of this attestation
     */
    function nodeSlash(address node, bytes32 attestationID, uint16 index) external;

    /**
     * @notice If the node is online but hasn't reported verification that day,
     * @notice the smart contract needs to be notified through this function to update the status of the node today.
     *
     * @param node: address of the node to report daily active
     */
    function nodeReportDailyActive(address node) external;

    /**
     * @notice After an attestation is reported, a group of nodes will be randomly selected through chainlink's VRF.
     * @notice These nodes need to submit the verification within the specified time.
     * @notice When a node is selected by VRF, the proof is submitted by calling `nodeReportVerification`.
     * @notice The verification cannot be submitted repeatedly.
     *
     * @dev Only nodes chosen by VRF in this attestation.
     * @dev Emits `NodeReportVerification`.
     *
     * @param attestationID: id of attestation
     * @param index: index of this node in vrfChosen list of this attestation
     * @param result: Whether the attestation is valid after being checked by the node.
     */
    function nodeReportVerification(bytes32 attestationID, uint16 index, AttestationResult result) external;

    /**
     * @notice Batch reporting verification.
     * @notice One address can collect multiple verifications and delegate reporting them in batches,
     * @notice following the eip-712.
     *
     * @dev Emits `NodeReportVerificationBatch`.
     */
    function nodeReportVerificationBatch(bytes32 attestationID, VerificationInfo[] calldata infos) external;

    /**
     * @notice If the NFT holder doesn't want to run the node to report the verification himself,
     * @notice he can delegate the authority to others to run by calling `delegate`.
     * @notice After delegating, NFT holders will give a proportion of rewards (10%) to the delegatee.
     *
     * @dev Emits `Delegate`.
     *
     * @param tokenID: tokenID of CarvNft to be delegated.
     * @param to: address of whom you want to delegate to
     */
    function delegate(uint256 tokenID, address to) external;

    /**
     * @notice Specify a new delegatee to replace the current delegatee.
     * @notice During the `redelegate`, the node may be triggered to exit.
     *
     * @dev Emits `Redelegate`.
     * @dev When the node's delegation weight is reduced to 0, it will be forced offline. Emits `NodeClear`
     *
     * @param tokenID: tokenID of CarvNft to be redelegated.
     * @param to: address of whom you want to redelegate to
     */
    function redelegate(uint256 tokenID, address to) external;

    /**
     * @notice Cancel current delegation.
     * @notice During the `undelegate`, the node may be triggered to exit.
     *
     * @dev Emits `undelegate`.
     * @dev When the node's delegation weight is reduced to 0, it will be forced offline. Emits `NodeClear`
     *
     * @param tokenID: tokenID of CarvNft to be undelegated.
     */
    function undelegate(uint256 tokenID) external;

    /**
     * @notice Claim rewards corresponding to a certain tokenID owned by you.
     * @notice vault.rewardsWithdraw() will be called to transfer veCARV to the user.
     * @notice After the user claim the reward, this CarvNft cannot be redeemed.
     *
     * @dev Emits `ClaimRewards`.
     *
     * @param tokenID: The token ID that needs to be claimed rewards
     */
    function claimRewards(uint256 tokenID) external;

    /**
     * @notice Check whether this tokenID has already claimed rewards.
     *
     * @param tokenID: token ID
     * @return claimed: whether this tokenID has already claimed rewards
     */
    function checkClaimed(uint256 tokenID) external view returns (bool);

    /**
     * @notice Get the index of today.
     */
    function todayIndex() external view returns (uint32);

    /**
     * @notice Get the offset of today.
     */
    function todayOffset() external view returns (uint256);
}
```


# Trusted Execution Environment (TEE)

* **Role Assignment**: The **TEE role** can only be assigned by the **admin** of the Service contract, ensuring that only trusted entities manage sensitive operations.
* **Attestation Submission**: Only **users or nodes** with TEE permissions are authorized to submit **attestations**, ensuring a controlled and secure submission process.
* **Privacy and Security**: **TEE nodes** are responsible for processing **encrypted data**, ensuring that sensitive information remains secure throughout the execution process. This guarantees the **privacy of user data**, allowing operations to be performed without exposing any confidential information.
* **Batching and On-Chain Attestation**: **TEE nodes** play a critical role in **batching and submitting attestations** on-chain. They collect, verify, and consolidate multiple attestations, then post them in batches to the blockchain. This approach ensures that the data is verifiable and transparent while also maintaining efficiency by reducing on-chain transaction costs.


# Verifier Node

* Any address holding a CARV NFT License, or delegated by an address holding a CARV NFT License, can become a verifier node.
* Each node has a delegation weight (initially set to 100, with an upper limit adjustable by the admin). The delegation weight represents the number of delegations to that node.
* Before a verifier node can publish a verification, it must notify the service contract to go online. The first time each verifier node goes online, it is registered with a uint16 nodeID, with the system capable of registering up to 65,535 nodes.
* After each attestation is published, Chainlink VRF will select the verification nodes for that round from the currently online nodes. The nodeID list of selected verification nodes will be stored in the service contract. When a verifier submits a verification, the contract will check if it is on the current round's verification node list.
* To randomly select verifier nodes from the pool of active nodes, the Service contract maintains a list called **activeVrfNodeList**, which has an initial maximum size of **5,000 nodes** (this limit is a governance parameter and can be adjusted). When the list is full, any new node entering the pool must replace an existing node with a lower delegation weight.
* Nodes that are online for at least 6 hours daily are eligible for rewards (refer to the [Rewards](/carv-ecosystem/verifier-nodes/how-do-verifier-nodes-work/rewards) rules section for details). Delegators to these nodes can also receive rewards.
* If a node fails to submit a verification, anyone can initiate a **slash** against it (the slasher will receive a reward). If the node fails to submit verifications multiple times (initially set to **2 missed submissions**, adjustable via governance), the node will be forced offline.
* When a verifier node submits a verification, it can delegate the submission process to the **CARV backend**. This submission process is **gasless**, requiring the verifier only to provide an **EIP-712 signature**. The CARV backend will aggregate multiple verifications and submit them in batches, significantly reducing the system's gas costs.

{% hint style="info" %}
Gasless mode is optional. You can always submit the tx to the smart contract directly.
{% endhint %}

* **Commission** is adjustable and can be configured by the verifier. The adjustment range is limited to **5% per change**, with a **minimum adjustment period of one week** (both parameters are subject to governance).
* A verifier node can specify a **reward receiving address**. Both the **verifier address** and the **reward address** are eligible to receive the node’s rewards.


# Attestation

**Attestation Verification Process:**

* When a tee submits an attestation, the service contract requests a random number from Chainlink VRF. Upon receiving the random number, it selects up to 200 nodes from the active online node list as verification nodes for the attestation.
* **Random Node Selection Rules:**
  1. Determine the number of verification nodes C based on the current number of online nodes.
  2. If the number of online nodes is greater than 100, the verification nodes will be 10% of the online nodes.
  3. If the number of online nodes is between 10 and 100, the verification nodes will be 10 nodes.
  4. If the number of online nodes is fewer than 10, all online nodes will be verification nodes.
  5. Using the random number R obtained from VRF, calculate the starting index: $$Index\_{begin} = R mod C$$.
  6. Starting from the **Index\_begin** in the active node list, the next **C nodes** will be selected as verifier nodes for the round (if the index exceeds the list's length, it will loop back to the beginning).

The selected verification nodes must submit their verifications within the specified time frame. If more than half of the selected nodes submit their verifications, and a majority validate the attestation as valid, the attestation is approved.


# Delegation

* **NFT Holder Delegation:** Each NFT holder can delegate to only one verifier per day, thereby earning rewards from only that verifier.
* **Commission Rate:** The CARV protocol has a commission rate for delegations. The rewards from verifications will be shared between the NFT holder and the verifier according to this rate. For example, with a commission rate of 1%, 99% of the verification rewards will go to the NFT holder, and 1% will go to the verifier.


# Rewards

**General Principles:**

* The number of verification reward tokens distributed daily is fixed (it decreases over time, but for any given day, the total reward amount is fixed regardless of the number of verifications. More details pls check [here](/carv-ecosystem/verifier-nodes/node-rewards)).
* Nodes that remain online for at least 6 hours per day can claim the daily rewards (the reward is the same whether online for 6 hours or 24 hours).

**Reward Distribution Cycle:**

* Rewards are distributed on a daily cycle (UTC 0:00 - 24:00), and this cycle is the minimum settlement unit for rewards. Therefore, within the T+1 cycle, rewards can only be claimed for periods up to and including T.

**Daily Online Map:**

* Smart contracts define a "daily online map" where the key is the index of T, and the value is the total number of delegators for online nodes during the T period. Each node also records its own "daily online map" (with the value being the number of its own delegators during the T period).
* Whenever a verifier goes online/offline or submits a verification, the "daily online map" is checked and updated. If a verifier does not perform any operations on a given day, they must manually submit a heartbeat to update their status.

**Claiming Rewards:**

* Nodes can only claim rewards for periods before the current cycle (rewards for the current cycle can be claimed in the next cycle). Smart contracts will calculate the total rewards for the period $$T\_a - T\_b$$​ using the global map $$V\_{global}$$​, the node's own map $$V\_{self}$$​, and the daily reward function $$R\_{(x)}$$. The formula is: $$Rewards = \sum\_{\mathclap{a\le x\le b}} \frac{V\_{self(x)} \* R\_{(x)}}{V\_{global(x)}}$$.

**Redelegate/Undelegate:**

* When an NFT holder redelegates or undelegates, the above formula is used to determine the earnings for that tokenID in the current delegation period, allowing the NFT holder to claim their rewards.

**Missed Submissions and Penalties:**

* If a verifier node misses a submission, anyone can report it. The reporter will receive a reward directly from the verifier's existing rewards, ensuring the total daily reward amount remains fixed. Nodes that miss submissions too frequently will be forced offline.

**Function Definitions & Explanations**

```Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.20;

interface IProtocolService {

    /**
     * @notice This enum represents result of an attestation reported by verifier
     *
     * `Valid`: This attestation can be parsed successfully and is not malicious
     * `Invalid`: This attestation cannot be parsed successfully
     * `Malicious`: This attestation can be parsed successfully but is malicious
     */
    enum AttestationResult {
        Valid,
        Invalid,
        Malicious
    }

    /**
     * @notice This struct represents information of a node
     *
     * `id`: The globally unique ID of the node. The node is automatically registered when
     *        it calls `nodeEnter` for the first time. Up to 4294967295 nodes can be registered.
     * `listIndex`: The position of the node in the current `activeVrfNodeList`
     * `active`: Is the node active?
     * `lastConfirmDate`: The date on which reward was last confirmed.
     * `missedVerifyCount`: The number of verifications the node currently misses
     * `selfTotalRewards`: The total rewards of the node itself
     * `selfClaimedRewards`: The rewards claimed by the node itself
     * `delegationRewards`: The rewards of the node’s delegator
     * `lastEnterTime`: The time when the node last called `nodeEnter` to go online
     * `commissionRate`: rate of commission, which is given by NFT holders to the verifier node.(decimals: 4)
     * `commissionRateLastModifyAt`: timestamp of last modifying commission rate
     */
    struct NodeInfo {
        uint32 id;
        uint32 listIndex;
        bool active;
        uint32 lastConfirmDate;
        uint64 missedVerifyCount;
        int256 selfTotalRewards;
        uint256 selfClaimedRewards;
        uint256 delegationRewards;
        uint256 lastEnterTime;
        address claimer;
        uint32 commissionRate; // decimals: 4
        uint256 commissionRateLastModifyAt;
    }

    /**
     * @notice This struct represents reward information of a CarvNft token
     *
     * `initialRewards`: When this tokenID is delegated to a node, the initial amount of delegator's rewards needs to be recorded.
     * `totalRewards`: The amount of rewards this tokenID has been confirmed
     * `claimedRewards`: The amount of rewards this tokenID has been claimed
     */
    struct TokenRewardInfo {
        uint256 initialRewards;
        uint256 totalRewards;
        uint256 claimedRewards;
    }

    /**
     * @notice This struct represents information of an attestation
     *
     * `reporter`: The address of the tee who reported this attestation
     * `valid`: The number of votes that this attestation is considered valid (voted by the verifier node)
     * `invalid`: The number of votes that this attestation is considered invalid (voted by the verifier node)
     * `vrfChosenID`: ID of the currently randomly selected verification nodes
     * `slashed`: Has this attestation been slashed?
     * `deadline`: Deadline for collecting verification
     */
    struct Attestation {
        address reporter;
        uint16 valid;
        uint16 invalid;
        uint16 malicious;
        uint32 vrfChosenID;
        uint256 deadline;
    }

    /**
     * @notice This struct represents information of an verification with signature
     *
     * `result`: result of this attestation
     * `index`: index of this node in activeVrfNodeList
     * `signer`: address of this node (sign the Data to call contract gasless)
     * `v`: v of signature signed by signer
     * `r`: r of signature signed by signer
     * `s`: s of signature signed by signer
     */
    struct VerificationInfo {
        AttestationResult result;
        uint32 index;
        address signer;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    // admin
    event UpdateVrfAddress(address vrf);
    event UpdateSettingsAddress(address settings);

    // tee
    event TeeReportAttestations(address tee, bytes32[] attestationIDs, string[] attestationInfos, uint256 requestID);
    event ConfirmVrfNodes(uint256 requestId, uint32[] vrfChosen, uint256 deadline);

    // node
    event NodeRegister(address node, uint32 id);
    event NodeActivate(address node, uint32 listIndex);
    event NodeClear(address node);
    event NodeSlash(address slasher, address node, bytes32 attestationID, uint256 rewards);
    event NodeModifyCommissionRate(address node, uint32 commissionRate);
    event NodeSetClaimer(address node, address claimer);
    event NodeClaim(address node, address claimer, uint256 rewards);
    event NodeReportVerification(address node, bytes32 attestationID, AttestationResult result);
    event NodeReportVerificationBatch(bytes32 attestationID, VerificationInfo[] infos);
    event NodeDailyActive(address node, uint32 date);
    event NodeConfirmReward(address node, int256 selfReward, uint256 delegationReward);

    // delegation
    event Delegate(uint256 tokenID, address to);
    event Redelegate(uint256 tokenID, address to);
    event Undelegate(uint256 tokenID, address to);
    event ClaimRewards(uint256 tokenID, address claimer, uint256 rewards);

    /*----------------------------------------------------------------------------------------------------------------*/

    /**
     * @notice update address of Settings contract.
     *
     * @dev Only admin role.
     * @dev Emits `UpdateSettingsAddress`.
     *
     * @param settings_: address of Settings contract.
     */
    function updateSettingsAddress(address settings_) external;
    /**
     * @notice update address of CarvVrf contract.
     *
     * @dev Only admin role.
     * @dev Emits `UpdateVrfAddress`.
     *
     * @param carvVrf_: address of CarvVrf contract.
     */
    function updateVrfAddress(address carvVrf_) external;

    /**
     * @notice Tee reports attestations. The same attestation can only be reported once.
     *
     * @dev Only staked tee role.
     * @dev Emits `TeeReportAttestations`.
     * @dev A request to apply for VRF will be sent to chainlink.
     * @dev After receiving the callback from chainlink, emits `ConfirmVrfNodes`.
     *
     * @param attestationInfos: attestations to be reported.
     */
    function teeReportAttestations(string[] memory attestationInfos) external;

    /**
     * @notice In order to save costs more efficiently when selecting nodes in VRF,
     * @notice we designed a data structure `activeVrfNodeList` for this purpose.
     * @notice `activeVrfNodeList` stores up to 2000 active nodes with delegation weight,
     * @notice and each time VRF will select from these nodes.
     *
     * @notice Nodes need to activate themselves by calling nodeEnter of the smart contract
     * @notice To successfully activate a node, caller need to meet the following conditions:
     * @notice 1. The caller needs to hold CarvNft, or be delegated by other holders
     * @notice 2. If the current `activeVrfNodeList` is full, you need to choose a node
     * @notice    in the list with less delegation weight than yourself to replace it.
     *
     * @dev Emits `NodeActivate`.
     * @dev If any node is kicked and replaced by your node. Emits `NodeClear`.
     * @dev If any node calls nodeEnter for the first time. Emits `NodeRegister`.
     *
     * @param replacedNode: address of the node that needs to be replaced by your node
     *                  only works when the `activeVrfNodeList` is full
     */
    function nodeEnter(address replacedNode) external;

    /**
     * @notice Exits by node itself, and verification cannot be reported after exiting.
     * @notice When a node exits, it will be punished based on missing counts during the online period.
     *
     * @dev Emits `NodeClear`.
     */
    function nodeExit() external;

    /**
     * @notice Modify the commission rate of verifier node
     *
     * @dev Emits `NodeModifyCommissionRate`.
     *
     * @param commissionRate: rate of commission, which is given by NFT holders to the verifier node
     */
    function nodeModifyCommissionRate(uint32 commissionRate) external;

    /**
     * @notice Similar to `nodeEnter`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeEnter`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeActivate`.
     * @dev If any node is kicked and replaced by your node. Emits `NodeClear`.
     * @dev If any node calls nodeEnter for the first time. Emits `NodeRegister`.
     *
     * @param replacedNode: address of the node that needs to be replaced by your node
     *                  only works when the `activeVrfNodeList` is full
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node ready to enter
     */
    function nodeEnterWithSignature(
        address replacedNode, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Similar to `nodeExit`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeExit`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeClear`.
     *
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node ready to exit
     */
    function nodeExitWithSignature(
        uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Similar to `nodeModifyCommissionRate`,
     * @notice but the txn can be broadcast to the chain by other address after being authenticated by the node.
     * @notice Compared with the `nodeModifyCommissionRate`, it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeModifyCommissionRate`.
     *
     * @param commissionRate: rate of commission, which is given by NFT holders to the verifier node
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node
     */
    function nodeModifyCommissionRateWithSignature(
        uint32 commissionRate, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Specify the address that can claim rewards of this verifier node
     * @notice it is gasless for the verifier node.
     * @notice following the eip-712.
     *
     * @dev Emits `NodeSetClaimer`.
     *
     * @param claimer: address of whom can claim reward of this verifier
     * @param expiredAt: transaction expiration time
     * @param signer: address of verifier node
     */
    function nodeSetRewardClaimerWithSignature(
        address claimer, uint256 expiredAt, address signer, uint8 v, bytes32 r, bytes32 s
    ) external;

    /**
     * @notice Claim reward of node.
     * @notice The reward for reporting verifications is divided into two parts: node's reward and delegators' reward
     * @notice Only when the node is online for more than 6 hours/day will there be reward.
     *
     * @dev Emits `NodeClaim`.
     *
     * @param node: address of node to claim reward
     */
    function nodeClaim(address node) external;

    /**
     * @notice Anyone can initiate a slash for a miss reporting of a node.
     * @notice Each miss reporting of a node can only be slashed once.
     * @notice When a node is selected by VRF but fails to report a verification within the specified time,
     * @notice the node can be slashed.
     *
     * @dev Emits `NodeSlash`.
     *
     * @param node: address of node to be slashed
     * @param attestationID: id of attestation that node miss reporting
     * @param index: index of this node in vrfChosen list of this attestation
     */
    function nodeSlash(address node, bytes32 attestationID, uint32 index) external;

    /**
     * @notice If the node is online but hasn't reported verification that day,
     * @notice the smart contract needs to be notified through this function to update the status of the node today.
     *
     * @param node: address of the node to report daily active
     */
    function nodeReportDailyActive(address node) external;

    /**
     * @notice Confirm the node reward,
     * @notice the smart contract needs to be notified through this function to update the reward of the node before today.
     *
     * @param node: address of the node to confirm rewards
     */
    function confirmNodeRewards(address node) external;

    /**
     * @notice After an attestation is reported, a group of nodes will be randomly selected through chainlink's VRF.
     * @notice These nodes need to submit the verification within the specified time.
     * @notice When a node is selected by VRF, the proof is submitted by calling `nodeReportVerification`.
     * @notice The verification cannot be submitted repeatedly.
     *
     * @dev Only nodes chosen by VRF in this attestation.
     * @dev Emits `NodeReportVerification`.
     *
     * @param attestationID: id of attestation
     * @param index: index of this node in vrfChosen list of this attestation
     * @param result: Whether the attestation is valid after being checked by the node.
     */
    function nodeReportVerification(bytes32 attestationID, uint32 index, AttestationResult result) external;

    /**
     * @notice Batch reporting verification.
     * @notice One address can collect multiple verifications and delegate reporting them in batches,
     * @notice following the eip-712.
     *
     * @dev Emits `NodeReportVerificationBatch`.
     */
    function nodeReportVerificationBatch(bytes32 attestationID, VerificationInfo[] calldata infos) external;

    /**
     * @notice If the NFT holder doesn't want to run the node to report the verification himself,
     * @notice he can delegate the authority to others to run by calling `delegate`.
     * @notice After delegating, NFT holders will give a proportion of rewards (10%) to the delegatee.
     *
     * @dev Emits `Delegate`.
     *
     * @param tokenID: tokenID of CarvNft to be delegated.
     * @param to: address of whom you want to delegate to
     */
    function delegate(uint256 tokenID, address to) external;

    /**
     * @notice Specify a new delegatee to replace the current delegatee.
     * @notice During the `redelegate`, the node may be triggered to exit.
     *
     * @dev Emits `Redelegate`.
     * @dev When the node's delegation weight is reduced to 0, it will be forced offline. Emits `NodeClear`
     *
     * @param tokenID: tokenID of CarvNft to be redelegated.
     * @param to: address of whom you want to redelegate to
     */
    function redelegate(uint256 tokenID, address to) external;

    /**
     * @notice Cancel current delegation.
     * @notice During the `undelegate`, the node may be triggered to exit.
     *
     * @dev Emits `undelegate`.
     * @dev When the node's delegation weight is reduced to 0, it will be forced offline. Emits `NodeClear`
     *
     * @param tokenID: tokenID of CarvNft to be undelegated.
     */
    function undelegate(uint256 tokenID) external;

    /**
     * @notice Claim rewards corresponding to a certain tokenID owned by you.
     * @notice vault.rewardsWithdraw() will be called to transfer veCARV to the user.
     * @notice After the user claim the reward, this CarvNft cannot be redeemed.
     *
     * @dev Emits `ClaimRewards`.
     *
     * @param tokenID: The token ID that needs to be claimed rewards
     */
    function claimRewards(uint256 tokenID) external;

    /**
     * @notice Check whether this tokenID has already claimed rewards.
     *
     * @param tokenID: token ID
     * @return claimed: whether this tokenID has already claimed rewards
     */
    function checkClaimed(uint256 tokenID) external view returns (bool);

    /**
     * @notice Get the index of today.
     */
    function todayIndex() external view returns (uint32);

    /**
     * @notice Get the offset of today.
     */
    function todayOffset() external view returns (uint256);
}
```


# SGX Attestation Verification

## SGX Attestation Verification Flow

A SGX-based Gramine service generates a TEE attestation, which is uploaded to a smart contract. Verifiers are required to read and verify the TEE attestation. The verification process typically includes the following steps:

1. **Extract the Attestation**: Initially, extract the attestation data from the smart contract.
2. **Parse the Attestation**: Parse the extracted attestation data, which usually includes the report body, signature, and signing certificate.
   * **Report Body**: The main part of the report containing information about the execution environment, such as the security version number, attributes, attribute mask, and measurements.
   * **Report Data**: The data section of the report, containing user-defined data.
   * **Signature**: The signature over the report body and report data, used to verify the report's integrity and authenticity.
3. **Verify the Signature**: Check the validity of the attestation's signature. This often involves using the public key from the signing certificate to validate the signature.
4. **Certificate Chain Verification**: Confirm that the signing certificate's chain of trust is valid and issued by a trusted root certificate.
5. **Report Body Verification**: Analyze the information in the report body to ensure it meets the expected criteria, including:
   * **MRENCLAVE Verification**: Ensure the MRENCLAVE value in the report body matches the expected value to confirm the executed code is as intended.
   * **Timestamp**: Verify the timestamp of the report to ensure it is current.
   * **User Data Verification**: If user data is included in the report body, verify that this data meets the expected standards.

### Verification fields and methods

* **Signature Verification**: Validate the signature using the public key to ensure the attestation has not been tampered with.
* **Certificate Chain Verification**: Inspect the certificate chain to ensure the signing certificate is issued by a trusted CA.
* **MRENCLAVE Verification**: Compare the MRENCLAVE value in the report body with the expected value to ensure the correct executable code is loaded (to do in version 1).
* **Timestamp**: Check the report’s generation time to ensure the information is up to date.
* **User Data**: If applicable, verify the user-defined data in the report body.

## References

{% embed url="<https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/main/SampleCode/RustQuoteVerificationSample/src/main.rshttps://github.com/intel/SGXDataCenterAttestationPrimitives/blob/main/QuoteVerification/dcap_quoteverify/sgx-dcap-quoteverify-rs/src/lib.rs>" %}

{% embed url="<https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/main/QuoteVerification/dcap_quoteverify/sgx-dcap-quoteverify-rs/src/lib.rs>" %}


# Verifier Node Sale Dynamics

<figure><img src="/files/KtcgARiUZrr1sX74F068" alt=""><figcaption><p>Verifier Node Sale Dynamic</p></figcaption></figure>


# Smart Contract Addresses

> For details on contracts other than those related to nodes, please refer to [Smart Contracts & Security](/carv-ecosystem/carv-play/smart-contracts-and-security)

## Node Mainnet Smart Contracts

**ABI:** <https://github.com/carv-protocol/contracts/tree/main/abi>

**Network:** [Arbitrum](https://arbiscan.io/)

<table><thead><tr><th width="234">Smart Contract Name</th><th>Smart Contract Address</th></tr></thead><tbody><tr><td>CARV</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>veCARV</td><td>0x2b790Dea1f6c5d72D5C60aF0F9CD6834374a964B</td></tr><tr><td>Vault</td><td>0xC34ADEDeABe92598F377cdb678Ae83fAe3D0c489</td></tr><tr><td>Settings</td><td>0x7aFC144a0c3C62e24d8f9c592feF8F65ce631C59</td></tr><tr><td>VRF</td><td>0x7CadD8a4B0Fd56154B186274ba3115E537A86e37</td></tr><tr><td>Protocol Service</td><td>0x1fab4B4B691a86bb16c296cC06E8cf0c12695B8E</td></tr><tr><td>Proxy</td><td>0xa91fF8b606BA57D8c6638Dd8CF3FC7eB15a9c634</td></tr><tr><td>Admin</td><td>0x50a521042D90280BC0DA9e701A9299605a84174a</td></tr><tr><td>NFT License</td><td>0x6584533decbcb8c05fb7eabfa93f92b7b3a85038</td></tr><tr><td>veCARV Airdrop</td><td>0x584cB7Dae5158be594AA1022Fb38017C791af2A0</td></tr></tbody></table>

**Network:** [Base](https://basescan.org/)

<table><thead><tr><th width="234">Smart Contract Name</th><th>Smart Contract Address</th></tr></thead><tbody><tr><td>CARV</td><td>0xc08Cd26474722cE93F4D0c34D16201461c10AA8C</td></tr><tr><td>Staking SBT Certification</td><td>0x2b790Dea1f6c5d72D5C60aF0F9CD6834374a964B</td></tr></tbody></table>

## Public Node Sale Smart Contract Addresses

**Network:** [Solana](https://explorer.solana.com/)

<table><thead><tr><th width="200">Sale Type</th><th>Smart Contract Addresses</th></tr></thead><tbody><tr><td>Public Sale Tier 1-10</td><td>2175hwrgv8WRt9GG1Ucu94KC16jC4v8W1Eidy5zPZ25x</td></tr></tbody></table>

## Public Sale Smart Contract Addresses

**Network:** [Arbitrum](https://arbiscan.io/)

<table><thead><tr><th width="215">Sale Type</th><th>Smart Contract Addresses</th></tr></thead><tbody><tr><td>Public Sale Tier 1</td><td>0x80adA4D9F18996c19df7d07aCfE78f9460BBC151</td></tr><tr><td>Public Sale Tier 2</td><td>0x82720570AC1847FD161b5A01Fe6440c316e5742c</td></tr><tr><td>Public Sale Tier 3</td><td>0x3F3C6DE3Bbe1F2fdFb4B43a49e599885B7Fb1a27</td></tr><tr><td>Public Sale Tier 4</td><td>0xc674BEB2f5Cd94A748589A9Dadd838b9E09AABD4</td></tr><tr><td>Public Sale Tier 5</td><td>0xF8a8A71d90f1AE2F17Aa4eE9319820B5F394f629</td></tr><tr><td>Public Sale Tier 6</td><td>0x125711d6f0AAc9DFFEd75AD2B8C51bDaF5FAEd71</td></tr><tr><td>Public Sale Tier 7</td><td>0x3371b74beC1dE3E115A4148956F94f55bEA8cD00</td></tr><tr><td>Public Sale Tier 8</td><td>0xa1D3632C9Dc73e8EcEBAe99a8Ea00F50F226A8B9</td></tr><tr><td>Public Sale Tier 9</td><td>0xD7C3E0C20Ab22f1e9A59e764B1b562E1dD7438B0</td></tr><tr><td>Public Sale Tier 10</td><td>0xc8c72AE5a74c3c0a0B2c0B0855a6f007a2C9B11A</td></tr><tr><td>Public Sale Tier 11</td><td>0xC506294beF7cffcF7e45Aa17b299516EEe76F6eE</td></tr><tr><td>Public Sale Tier 12</td><td>0xf6c0b24254E4423962f1076C5f5134e1312Aafe9</td></tr><tr><td>Public Sale Tier 13</td><td>0x4020acDB0d62AD337383b53e32f17fC629568a49</td></tr><tr><td>Public Sale Tier 14</td><td>0x1E4c63886c8F157d0aA29F0F9c1F479b60C6055E</td></tr><tr><td>Public Sale Tier 15</td><td>0xD767424230a633E790b4AE4a8A7e1E2511F3B197</td></tr><tr><td>Public Sale Tier 16</td><td>0xD7370b509ffF524E811523669bbA43b107dC40a0</td></tr><tr><td>Public Sale Tier 17</td><td>0x6B003d209A452EA51AF14E853706f98131f98e8d</td></tr><tr><td>Public Sale Tier 18</td><td>0x257A8e37fB36192Ae262A37B983d726e049C5606</td></tr><tr><td>Public Sale Tier 19</td><td>0x242F0aef35d06f3Ee12C70c355c2df9b4FbDeCDF</td></tr><tr><td>Public Sale Tier 20</td><td>0x7BAC674548C63e7CcbB17864131BDDb99C29b589</td></tr><tr><td>Public Sale Tier 21</td><td>0x9C6d5699B5AEEB2D5266AA1f2C134647386fc08b</td></tr><tr><td>Public Sale Tier 22</td><td>0x7D20f7111D93f4Eabd236B88414Bf41f4e26bd61</td></tr><tr><td>Public Sale Tier 23</td><td>0xEA67230750b5AADb8309C6e6F9A441524b15c7F3</td></tr><tr><td>Public Sale Tier 24</td><td>0xaA46f9A7b618A1e2c550Aa7f86a0eD1b5005dad3</td></tr><tr><td>Public Sale Tier 25</td><td>0x1870d4BF19F00011059f09412e0Ae105836B2b51</td></tr><tr><td>Public Sale Tier 26</td><td>0x607c6Ba612BFF0dd699DccE43cDC364C1FcBe4d5</td></tr><tr><td>Public Sale Tier 27</td><td>0xb88Bed927a5D94bfC2f12227a446Ba9b6e8c00cD</td></tr><tr><td>Public Sale Tier 28</td><td>0x4a36379c25400D94C328a9Aa3BC1FfB25fAc073a</td></tr><tr><td>Public Sale Tier 29</td><td>0x340FBD6ED6401A1bEbdea7b7644EE8bf30330c6D</td></tr><tr><td>Public Sale Tier 30</td><td>0xEE8395E4269C740931EFD427eb7027DD1114777C</td></tr><tr><td>Public Sale Tier 31</td><td>0x0a0e6B162440fdD0a2E185512E95Ec1031C258Bc</td></tr><tr><td>Public Sale Tier 32</td><td>0xDa39e9d12614Eae2F98D2dc1Cb13399d53Eef56c</td></tr><tr><td>Public Sale Tier 33</td><td>0x52875E4F5EBB92917276eaA8447cd690C1F63DDB</td></tr><tr><td>Public Sale Tier 34</td><td>0x4EfA5109b4cEEF9511107f64aDBaa5Fee49F7584</td></tr><tr><td>Public Sale Tier 35</td><td>0xca7188D8f9cE1d47B99127F7bC99eeab1781A5AB</td></tr><tr><td>Public Sale Tier 36</td><td>0xC5A35c756B3281bC9613b386fbB6603A3789340B</td></tr><tr><td>Public Sale Tier 37</td><td>0x8A4b87dfA44cC40B9654aB65557583b9793e62A6</td></tr><tr><td>Public Sale Tier 38</td><td>0x61c9A13e9690Cb8Ee5a351B67267608824A6A549</td></tr><tr><td>Public Sale Tier 39</td><td>0x60702643d1f15E0Df95C57C266AebC254f647841</td></tr><tr><td>Public Sale Tier 40</td><td>0xD7A17f51aC326c080428c7b7dF46ba9266827B94</td></tr></tbody></table>


# License Key (NFT)

Anyone can operate verifiers to validate results for their own use, but only authorized verifiers possessing a License Key are entitled to engage in on-chain consensus and earn rewards.

The purchase page is set to go live shortly.

After purchasing a node license, node licenses will be distributed as an NFT to the purchase wallet of the user. Only the wallet with the node license can then operate the node and earn tokens as rewards.

Node licenses are initially non-transferable.

### Burner Wallet

This is a hot wallet used to generate verification transactions. It must be connected to your primary wallet, which contains the License Key.


# Delegation

{% hint style="info" %}
You can now follow the [tutorial](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/delegation-tutorial) to explore and try out the delegation feature.
{% endhint %}

## **Introduction to Delegation**

Delegating enhances the network by utilizing the verifier node license key (NFT) through delegating their NFT to Nodes-as-a-Service (NaaS) providers. In exchange, Delegators earn $CARV from the reward pool. CARV is forging partnerships with leading NaaS providers, allowing you to delegate your license key for them to manage nodes on your behalf. However, it's possible to choose NaaS providers that underperform, potentially yielding lower returns on investment. Delegators are advised to thoroughly evaluate potential NaaS providers. A reputation index is available to assist delegators in comparing node operators. Additionally, the CARV Governance Council will continue to oversee NaaS providers to ensure quality and reliability.

## **How are Delegators rewarded?**

NaaS Provider Commission Rate (NPCR) is a percentage share of the rewards received by NaaS providers from serving requests to node owners. After deducting the NPCR from total rewards, the remaining rewards will be shared with delegators(node owners). NaaS providers are free to set this rate to any value they desire. A lower NPCR means that the Naas provider shares more of their rewards with their delegators.


# Node Rewards

## **Verifier Node Rewards**

Verifier node operators will receive token rewards for their contributions to the network’s operation and security (data privacy protection).&#x20;

Up to **25%** of the total supply will be provided to verifier node operators in **4 years**. Emission adopts a release model of 25% reduction every 6 months.

<figure><img src="/files/pPwCHexSwTURNndsmBmM" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
&#x20;It is expected to release about 50% token in the first year.
{% endhint %}

\
**Note: This is not a token sale. See** [**https://carv.io/node-disclaimer**](https://carv.io/node-disclaimer) **for more details.**

CARV Foundation is committed to compliance. Participants will receive $veCARV instead of receiving native token directly and convert it to $CARV through redemption, then claim the rewards.

Check [here ](/carv-token/utility)for more details about $veCARV and $CARV converting.


# Join Mainnet Verifier Nodes

The CARV test verifier is currently operational on the Arbitrum One network. Those who have purchased a Verifier License can explore and test the verifier nodes before the mainnet launch. There are two ways you can participate: either by delegating or by operating your own node:

* **Delegation**: You can delegate your node license to any active nodes listed on the explorer. Delegation is the simplest way to participate, as you don't need to manage the nodes. However, you must ensure the node you delegate to has sufficient uptime; otherwise, you will not receive any rewards. If the node maintains enough uptime, you will receive rewards minus the commission rate set by the node. Delegation can save you the costs associated with operating the node yourself.
* **Operating your own nodes**: If you prefer to operate your own node, you will be responsible for maintaining the node's uptime and handling any software upgrades. However, you will also have the opportunity to receive delegations from the community. We offer multiple ways to operate your own node; please see [more details](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node) for further information.

**Prerequisites:**

* [Creating your first wallet](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/prerequisites#create-a-wallet)
* [Buy a Verifier Node](/carv-ecosystem/verifier-nodes/how-to-purchase-nodes)

**Participation Options:**

* [Try delegation](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/delegation-tutorial)
* [Operate your own node](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node)


# Prerequisites

In this tutorial, we will guide you through creating a new test wallet. We'll use MetaMask as an example, but feel free to use any wallet of your choice.

## Create a wallet

#### **Step 1 - Install the wallet plugin of your choice.**

MetaMask: <https://metamask.io/download/>

OKX: <https://www.okx.com/help/use-the-okx-wallet-web-extension-to-easily-play-stader>

WalletConnect: <https://walletconnect.com/>

#### **Step 2 - Create a test wallet**

Follow the instruction to create a wallet

For guidance on setting up a MetaMask wallet, visit the [MetaMask Getting Started Guide](https://support.metamask.io/getting-started/getting-started-with-metamask/). Once you complete the setup, you should be able to view the details of your wallet in MetaMask.

<figure><img src="/files/rd3LLS7yIm46eBH8Vlig" alt=""><figcaption><p>Create a new MetaMask wallet</p></figcaption></figure>

## Own a Verifier License NFT

Please refer to [How to Purchase Nodes](/carv-ecosystem/verifier-nodes/how-to-purchase-nodes).


# Delegation Tutorial

## Video Tutorial

{% embed url="<https://youtu.be/RYbQ1mG8Ou8>" %}

## Quick Start

Before you begin the delegation process, please ensure that you have created a wallet and received a Verifier License NFT. If you do not have one yet, visit [this ](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/prerequisites)page to complete the necessary prerequisites.

### Delegate License&#x20;

Once you're ready, you can proceed to <https://explorer.carv.io/verifiers>. Here, you can delegate your License in one of the two ways:

1. Choose a verifier from the list and click 'Delegate' next to the verifier.

   <figure><img src="/files/BuxNV7RvQC4BHcXXThaS" alt=""><figcaption></figcaption></figure>
2. If you know the address of the Verifier Node you'd like to delegate to, click 'Delegate My License'.

   <div align="left"><figure><img src="/files/25kxWlLWVeOoee2rJM06" alt=""><figcaption></figcaption></figure></div>

   Enter the address of the Verifier.

   <div align="left"><figure><img src="/files/RKMrDGNWhiDqBzzV57N3" alt="" width="375"><figcaption></figcaption></figure></div>

Then confirm the delegate address and sign the transaction in your wallet. Note you need to pay for the gas for this transaction.

### Manage Delegation

If you'd like to revoke your delegation. You can do so in `My Delegates` and click `Revoke` next to the delegate.

<figure><img src="/files/FyuhvWEfc7iTSOWBpnzg" alt=""><figcaption></figcaption></figure>


# Operating a Verifier Node

If you prefer not to delegate your node (See [Delegation](/carv-ecosystem/verifier-nodes/delegation)), there are several ways you can operate your own CARV nodes:

1. **Verifier Client CLI**: You can run the nodes on your own machine by downloading the appropriate software for your operating system. By keeping the software running for at least 6 hours per day, you can earn your expected rewards. (See [Running in CLI](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli))
2. **Verifier Client App**: We offer a browser version of the verifier nodes. By running the verifiers in your browser and keeping it open, you can generate rewards without needing to download any software. This solution is convenient and works on any OS, including mobile devices, as long as the browser remains active. (See [Running in Desktop App](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-desktop-app))
3. **Virtual Private Servers (VPS)**: If you have difficulty keeping your node up and running on your local environment, you can use a VPS, such as AWS, Ali Cloud, or Google Cloud. A VPS provides a managed execution environment, allowing you to keep your node operational 24/7. Note that using a VPS may incur additional fees and require manual management of the installed software. (See [Running in VPS](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-vps))
4. **Node-as-a-Service (NaaS)**: NaaS providers handle everything for you, including setup, deployment, and management. Here are some official CARV NaaS partners:
   * [Animoca](https://www.animocabrands.com/)
   * [Easeflow](https://easeflow.io/)
   * [Infstones](https://infstones.com/)
   * [Nodeops](https://console.nodeops.xyz/)
   * [BwareLabs](https://blastapi.io/node-as-a-service)
   * [Knidos](https://www.knidos.xyz/)
   * [Rapidnode](https://www.rapidnode.xyz/)
   * [Lugasnode](https://luganodes.com/)
   * [Nodeterminal](https://www.nodeterminal.com/)

For more detail comparison, please see:

<table><thead><tr><th width="123">Method</th><th>Description</th><th width="179">Requirements</th><th width="180">Convenience</th><th>Cost</th></tr></thead><tbody><tr><td><a href="/pages/ZWR6KmtrzW2wcdoxlgCC"><strong>Desktop Software</strong></a></td><td>Run nodes on your own machine with downloaded software.</td><td>Download software, run for 6 hours daily.</td><td>Low: Requires continuous operation.</td><td>Low: No additional cost.</td></tr><tr><td><a href="/pages/sSg51mMw6FEThPjeoS1E"><strong>Browser Version</strong></a></td><td>Run verifier nodes in your browser.</td><td>Open and active browser.</td><td>Moderate: No download, works on any OS.</td><td>Low: No additional cost.</td></tr><tr><td><strong>Virtual Private Server (VPS)</strong></td><td>Use a VPS to keep your node running continuously.</td><td>VPS account, manage software on VPS.</td><td>Moderate: Requires setup and management.</td><td>Medium: VPS fees apply.</td></tr><tr><td><strong>Node-as-a-Service (NaaS)</strong></td><td>Third-party service handles setup, deployment, and management.</td><td>NaaS subscription.</td><td>High: Fully managed service.</td><td>Medium: NaaS subscription fees.</td></tr></tbody></table>

{% hint style="info" %}
Note that all methods mentioned above guarantee the same rewards for each license you operate. If you have multiple licenses, you can delegate all of them to a single node operated by yourself. However, the more reliable your node is, the higher the possibility of receiving delegations from the community.
{% endhint %}


# Running in VPS

{% hint style="info" %}
This content is generated by our community. CARV does not recommend using any services listed in this tutorial. Please conduct your own research as needed.
{% endhint %}

Credit to [DEPINspirationHUB](https://medium.com/@depinspirationhub?source=post_page-----31bead81ad07--------------------------------) for helping with the VPS tutorial.

{% embed url="<https://www.youtube.com/watch?v=IOfMcILu6uA>" %}
Set up CARV node on Linux VPS
{% endembed %}

Medium post: <https://medium.com/@depinspirationhub/carv-node-setup-on-linux-vps-alphanet-31bead81ad07>


# Running in CLI

## Hardware Requirements

**Minimum:**

* CPU with 1+ cores
* 2GB RAM
* 4 MBit/sec download Internet service

**Recommended:**

* Fast CPU with 2+ cores
* 4GB+ RAM
* 8+ MBit/sec download Internet service

{% hint style="info" %}
The verifier node does not need a static IP address or open ports.
{% endhint %}

{% hint style="info" %}
The verifier node does not require significant storage capacity. The minimum storage needed is merely for the software and its configuration, which should be less than 100MB.
{% endhint %}

#### **Running in Desktop App**

You can operate your nodes on any OS by using the Desktop App. Check [Running in Desktop App](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-desktop-app)for more details.

#### **Starting with Source Code**

If you prefer to start with the source code, you can choose one of the following methods:

* [Using Source Code](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-source-code)
* [Using Docker](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-docker)


# Using Source Code

{% hint style="info" %}
Note that the configuration may change while testing. Please check this page consistently for operation info.
{% endhint %}

#### Before you start

The verifier is written in Golang. Before you start, you should make sure you have Golang installed correctly. For more details check: <https://go.dev/doc/install>.

#### Clone the source code

The verifier code is open source and currently in development. You can clone the GitHub repository and build the source: <https://github.com/carv-protocol/verifier>.

<pre class="language-bash"><code class="lang-bash"><strong>git clone https://github.com/carv-protocol/verifier.git &#x26;&#x26; \
</strong><strong>cd verifier &#x26;&#x26; \
</strong><strong>make build
</strong></code></pre>

**Run via binary program**

After executing `make build` or `make all`, the verifier executable file will be compiled into the `./bin` directory. You need to switch to the `./bin` directory before executing verifier. run

```
cd bin
```

If this is your first time running verifier, you need to specify a private key. The private key will sign the verification transaction.

{% hint style="info" %}
**Never expose your main account's private key. Always generate a brand new private key for operating the node, otherwise generate a new one using the \`**&#x67;enerate-keystor&#x65;**\` command below.**
{% endhint %}

The private key can be passed to the verifier through startup parameters, or written into the configuration file.

**Through startup parameters**

If you already have a brand new private key generated, you can start your node with the command below.

{% hint style="info" %}
The private key can be any brand new private key. If the key doesn't hold the CARV node license, you need to go to <https://explorer.carv.io/verifiers> to delegate your license to this new key.
{% endhint %}

{% hint style="info" %}
Commission rate can be set between 0-10. 0 means you don't take any commission from delegators. 10 means you take 10% of the rewards from delegators.
{% endhint %}

```
# Pass the pre-generated private key in clear text
./verifier -private-key <Your Private Key> -reward-address <Your Reward Address> -commission-rate <Your Commission Rate>

# By specifying keystore
./verifier -keystore-path <Path to keystore file> -keystore-password <keystore password> -reward-address <Your Reward Address> -commission-rate <Your Commission Rate>
```

In order to facilitate user operation, verifier provides a tool to generate a new keystore, run

```
./verifier -generate-keystore -keystore-path <path to generate your keystore file>
```

After running the command, you will be prompted to enter a password for the keystore. After entering the password, the keystore file will be generated in the specified path. And then you can run the verifier with the keystore file path and password before you delegate to the keystore address.

{% hint style="info" %}
Same for Keystore. Before you run the verifier, you must delegate to the keystore address. After the delegation is successful, you can run the verifier again. Delegated address you can get from the terminal after generating the keystore. You can delegate your License through the explorer <https://explorer.carv.io/verifiers>.
{% endhint %}

**Through configuration file**

If you prefer to config your own parameters, including RPC url, private key mode, etc. you can operate your node using config file, check details below:

1. Set `wallet.mode` in the configuration file (`../configs/config.yaml`)  to `1`,
2. Write the plain text private key into `wallet.private_key`,
3. Write your reward address into `wallet.reward_claimer_addr`,
4. Write your commission rate into `wallet.commission_rate`. Then run

```
./verifier -conf ../configs/config.yaml 
```

Configure the path and password of the keystore:

1. Set `wallet.mode` in the configuration file (`../configs/config.yaml`) to `2`,
2. Write the path and password of the keystore file into `wallet.keystore_path`
3. Write the keystore password into `wallet.keystore_password`.
4. Write your reward address into `wallet.reward_claimer_addr`,
5. Write your commission rate into `wallet.commission_rate`. Then run

```
./verifier -conf ../configs/config.yaml
```


# Using Docker

{% hint style="info" %}
Note that the configuration may change while testing. Please check this page consistently for operation info.
{% endhint %}

One of the quickest ways to run verifier is by using Docker:

## Use Private Key (mode = 0)

**Update config\_docker.yaml**

Update your private\_key and run :

```
wallet:
  # wallet mode, by which way to pass the private key
  # 0: through startup parameters
  # 1: through plain text private key in config file
  # 2: through path and password of the keystore in config file
  mode: 0
  # plain text private key, needed when mode is 1
  private_key: "99a038e9d345d0b12130b3b1fb003bf8f2d3a5c27ce2a800bbb1608efff6c591"
  # path of the keystore, needed when mode is 2
  keystore_path: ""
  # password of the keystore, needed when mode is 2
  keystore_password: ""
```

```
docker run -d --name verifier -v /<Path To This Repository>/verifier/configs:/data/conf -v /<Path To Keystore direction>:/data/keystore carvprotocol/verifier:mainnet
```

## **Use Keystore (mode = 2)**

> If you want to use keystore, you need to generate a keystore file first. You can use the following command to generate a keystore file.

```
./verifier -generate-keystore -keystore-path <path to generate your keystore file>
```

After running the command, you can run verifier by following the steps below.

**update config\_docker.yaml**

Update your keystore\_path and keystore\_password and run :

```
wallet:
  # wallet mode, by which way to pass the private key
  # 0: through startup parameters
  # 1: through plain text private key in config file
  # 2: through path and password of the keystore in config file
  mode: 2
  # plain text private key, needed when mode is 1
  private_key: ""
  # path of the keystore, needed when mode is 2
  keystore_path: "/data/conf/xxxx/UTC--2021-09-29T07-00-00.000000000Z--xxxx"
  # password of the keystore, needed when mode is 2
  keystore_password: "123456"
```

```
docker run -d --name verifier -v /<Path To This Repository>/verifier/configs:/data/conf -v /<Path To Keystore direction>:/data/keystore carvprotocol/verifier:mainnet
```

#### Example Config

````
```yaml
chain:
  chain_id: 42161
  chain_name: "arbitrum"
  rpc_url: "https://arb1.arbitrum.io/rpc"
  start_block: 0
  offset_block: 14400 # arbitrum block time: 0.25 sec. An offset of 14400 starts fetching blocks from 1 hours ago.
  max_block_per_query: 500
  query_ticker: 5 # second
  report_delay: 30 # second
  enable_gas_mode: false # default: false
contract:
  addr: "0xa91fF8b606BA57D8c6638Dd8CF3FC7eB15a9c634"
  tee_addr: "0x8A5614d82187BAa01FB004D5adAcC86992543e67"
  topic1: "0x89a3b784b99180438f3b2027aa89e97c3c3ed66e8dc78a555d7013b39caf1a89"
  topic2: "0x455929120054502ca2ea8194b26e7bb3acb631d30177f6881ffa70581abd4a13"
  topic3: "0x8a0859fa4a2e331800d512db6925d210facda82733207cb9fe49e7da954fc4aa"
#wallet:
  ## wallet mode, by which way to pass the private key
  ## 0: through startup parameters
  ## 1: through plain text private key in config file
  ## 2: through path and password of the keystore in config file
#  mode: 1
#  private_key: "99a038e9d345d0b12130b3b1fb003bf8f2d3a5c27ce2a800bbb1608efff6c591"
#  keystore_path: ""
#  keystore_password: ""
#  reward_claimer_addr: "0x689d0b32Da0480095b7AE7b604f1b1997736B3F9"
#  commission_rate: 100
wallet:
  mode: 2
  private_key: ""
  keystore_path: "./keystore/UTC--2024-06-25T12-01-01.663731000Z--031cff11b035aa5f5189f163c1fc937bf0be235c"
  keystore_password: "123456"
  reward_claimer_addr: "0x689d0b32Da0480095b7AE7b604f1b1997736B3F9"
  commission_rate: 100
signature:
  domain_name: "ProtocolService"
  domain_version: "1.0.0"
  expired_time: 3600
gasless_service:
  url: "https://interface.carv.io"
  version: "1.0.0"
````


# Gasless Server API

To minimize node operating costs, CARV offers official endpoints that assist node operators in batching operations and posting them on-chain. While gasless transactions still necessitate user signatures for specific operations, CARV ensures endpoint availability. However, if you are concerned about risks, you also have the option to independently send transactions to the smart contract.

**Base URLs: <https://interface.carv.io>**

### Message Construction

To make sure the gasless server still guarantee the authorization from the original node operater, it adopts the [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) standard to proof authorization through the signature.

For more details of message structure: <https://github.com/carv-protocol/verifier/blob/main/internal/worker/signature_server.go>

Example config: [Using Docker](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-docker#example-config)

### POST ExplorerSendTxNodeEnter

`POST /explorer/send_tx_node_enter`

#### Message structure (Golang)

```json
typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeEnterData": {
				{
					Name: "replacedNode",
					Type: "address",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeEnterData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"replacedNode": replacedNode.String(),
			"expiredAt":    expiredAt,
		},
	}
```

#### Body Parameters

```json
{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "replaced_node": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}
```

#### Params

<table><thead><tr><th width="156">Name</th><th width="114">Location</th><th width="103">Type</th><th width="105">Required</th><th>Description</th></tr></thead><tbody><tr><td>Origin</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>User-Agent</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>x-app-id</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>» signer</td><td>body</td><td>string</td><td>yes</td><td></td></tr><tr><td>» replaced_node</td><td>body</td><td>string</td><td>yes</td><td>The node to replace. There are 2000 active node limit. To join the active set you have to specify a node has lower delegation than you to replace with.</td></tr><tr><td>» expired_at</td><td>body</td><td>integer</td><td>yes</td><td></td></tr><tr><td>» v</td><td>body</td><td>integer</td><td>yes</td><td></td></tr><tr><td>» r</td><td>body</td><td>string</td><td>yes</td><td></td></tr><tr><td>» s</td><td>body</td><td>string</td><td>yes</td><td></td></tr></tbody></table>

#### Response Examples

200 Response

```json
{
  "code": 0,
  "msg": "string",
  "data": {}
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description     | Data schema |
| ---------------- | ---------------------------------------------------------------- | --------------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Success         | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | ResponseForFail | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name   | Type    | Required |
| ------ | ------- | -------- |
| » code | integer | true     |
| » msg  | string  | true     |
| » data | object  | true     |

HTTP Status Code **400**

| Name    | Type   | Required |
| ------- | ------ | -------- |
| » error | string | true     |

### POST ExplorerSendTxNodeExit

`POST /explorer/send_tx_node_exit`

#### Message structure (Golang)

```json
apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeExitData": {
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeExitData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"expiredAt": expiredAt,
		},
	}

	v, r, s, err := tools.SignTypedDataAndSplit(typedData, c.verifierPrivKey)
	if err != nil {
		return
	}

}
```

#### Body Parameters

```json
{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}
```

#### Params

| Name          | Location | Type    | Required |
| ------------- | -------- | ------- | -------- |
| Origin        | header   | string  | yes      |
| User-Agent    | header   | string  | yes      |
| x-app-id      | header   | string  | yes      |
| » signer      | body     | string  | yes      |
| » expired\_at | body     | integer | yes      |
| » v           | body     | integer | yes      |
| » r           | body     | string  | yes      |
| » s           | body     | string  | yes      |
| » version     | body     | string  | yes      |

#### Response Examples

200 Response

```json
{
  "code": 0,
  "msg": "string",
  "data": {}
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description     | Data schema |
| ---------------- | ---------------------------------------------------------------- | --------------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Success         | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | ResponseForFail | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name   | Type    | Required |
| ------ | ------- | -------- |
| » code | integer | true     |
| » msg  | string  | true     |
| » data | object  | true     |

HTTP Status Code **400**

| Name    | Type   | Required |
| ------- | ------ | -------- |
| » error | string | true     |

### POST ExplorerSendTxModifyCommissionRate

`POST /explorer/send_tx_modify_commission_rate`

#### Message structure (Golang)

```json
typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeModifyCommissionRateData": {
				{
					Name: "commissionRate",
					Type: "uint32",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeModifyCommissionRateData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"commissionRate": strconv.Itoa(int(commissionRate)),
			"expiredAt":      expiredAt,
		},
	}
```

#### Body Parameters

```json
{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "commission_rate": 100,
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}
```

#### Params

| Name               | Location | Type    | Required |
| ------------------ | -------- | ------- | -------- |
| Origin             | header   | string  | yes      |
| User-Agent         | header   | string  | yes      |
| x-app-id           | header   | string  | yes      |
| » signer           | body     | string  | yes      |
| » commission\_rate | body     | integer | yes      |
| » expired\_at      | body     | integer | yes      |
| » v                | body     | integer | yes      |
| » r                | body     | string  | yes      |
| » s                | body     | string  | yes      |

#### Response Examples

200 Response

```json
{
  "code": 0,
  "msg": "string",
  "data": {}
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description     | Data schema |
| ---------------- | ---------------------------------------------------------------- | --------------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Success         | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | ResponseForFail | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name   | Type    | Required |
| ------ | ------- | -------- |
| » code | integer | true     |
| » msg  | string  | true     |
| » data | object  | true     |

HTTP Status Code **400**

| Name    | Type   | Required |
| ------- | ------ | -------- |
| » error | string | true     |

### POST ExplorerSendTxSetRewardClaimer

`POST /explorer/send_tx_set_reward_claimer`

#### Message structure (Golang)

```json
typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"NodeSetRewardClaimerData": {
				{
					Name: "claimer",
					Type: "address",
				},
				{
					Name: "expiredAt",
					Type: "uint256",
				},
			},
		},
		PrimaryType: "NodeSetRewardClaimerData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"claimer":   rewardClaimer.String(),
			"expiredAt": expiredAt,
		},
	}
```

#### Body Parameters

```json
{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "claimer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "expired_at": 1000000000,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}
```

#### Params

| Name          | Location | Type    | Required |
| ------------- | -------- | ------- | -------- |
| Origin        | header   | string  | yes      |
| User-Agent    | header   | string  | yes      |
| x-app-id      | header   | string  | yes      |
| body          | body     | object  | no       |
| » signer      | body     | string  | yes      |
| » claimer     | body     | string  | yes      |
| » expired\_at | body     | integer | yes      |
| » v           | body     | integer | yes      |
| » r           | body     | string  | yes      |
| » s           | body     | string  | yes      |

#### Response Examples

200 Response

```json
{
  "code": 0,
  "msg": "string",
  "data": {}
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description     | Data schema |
| ---------------- | ---------------------------------------------------------------- | --------------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Success         | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | ResponseForFail | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

| Name   | Type    | Required |
| ------ | ------- | -------- |
| » code | integer | true     |
| » msg  | string  | true     |
| » data | object  | true     |

HTTP Status Code **400**

| Name    | Type   | Required |
| ------- | ------ | -------- |
| » error | string | true     |

### POST ExplorerSendTxNodeReportVerification

`POST /explorer/send_tx_node_report_verification`

#### Message structure (Golang)

```json
typedData := apitypes.TypedData{
		Types: apitypes.Types{
			"EIP712Domain": {
				{
					Name: "name",
					Type: "string",
				},
				{
					Name: "version",
					Type: "string",
				},
				{
					Name: "chainId",
					Type: "uint256",
				},
			},
			"VerificationData": {
				{
					Name: "attestationID",
					Type: "bytes32",
				},
				{
					Name: "result",
					Type: "uint8",
				},
				{
					Name: "index",
					Type: "uint32",
				},
			},
		},
		PrimaryType: "VerificationData",
		Domain: apitypes.TypedDataDomain{
			Name:    c.cf.Signature.DomainName,
			Version: c.cf.Signature.DomainVersion,
			ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)),
		},
		Message: apitypes.TypedDataMessage{
			"attestationID": attestationId[:],
			"result":        strconv.Itoa(int(result)),
			"index":         strconv.Itoa(int(index)),
		},
	}
```

#### Body Parameters

```json
{
  "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B",
  "attestation_id": "0x518c1c43067238438f81546f39623c49b09a8eeeb0ee14794aafefd9fa84c7ab",
  "result": 0,
  "index": 1,
  "v": 27,
  "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67",
  "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55",
  "version": "1.0.0"
}
```

#### Params

| Name              | Location | Type    | Required |
| ----------------- | -------- | ------- | -------- |
| Origin            | header   | string  | yes      |
| User-Agent        | header   | string  | yes      |
| x-app-id          | header   | string  | yes      |
| » signer          | body     | string  | yes      |
| » attestation\_id | body     | string  | yes      |
| » result          | body     | integer | yes      |
| » index           | body     | integer | yes      |
| » v               | body     | integer | yes      |
| » r               | body     | string  | yes      |
| » s               | body     | string  | yes      |

#### Response Examples

200 Response

```json
{
  "code": 0,
  "msg": "string",
  "data": null
}
```

#### Responses

| HTTP Status Code | Meaning                                                          | Description     | Data schema |
| ---------------- | ---------------------------------------------------------------- | --------------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Success         | Inline      |
| 400              | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | ResponseForFail | Inline      |

#### Responses Data Schema

HTTP Status Code **200**

<table><thead><tr><th>Name</th><th>Type</th><th>Required</th><th data-hidden>Restrictions</th></tr></thead><tbody><tr><td>» code</td><td>integer</td><td>true</td><td>none</td></tr><tr><td>» msg</td><td>string</td><td>true</td><td>none</td></tr><tr><td>» data</td><td>null</td><td>true</td><td>none</td></tr></tbody></table>

HTTP Status Code **400**

| Name    | Type   | Required |
| ------- | ------ | -------- |
| » error | string | true     |


# Running in Desktop App

## Video Tutorial

{% embed url="<https://youtu.be/4eEtMDyRu90>" %}

## Quick Start

### Install Client App

1. Open <https://client.carv.io> in Chrome <img src="/files/XoBmF5Jdw7OlpsOYrleL" alt="" data-size="line">.
2. Click the <img src="/files/WBL5DTqN4zWhHJqri8H6" alt="" data-size="line"> icon in the address bar.&#x20;
3. Click `Install`.&#x20;
4. The App should appear in your application folder. We suggest you pin the App in Dock for quick access!

   <figure><img src="/files/QkRT5oI4yMRcBsq0tuWR" alt=""><figcaption></figcaption></figure>

### Running Verifier Client

1. Open your Verifier Client App.
2. Connect using the wallet with Verifier License NFTs.
3. Click `Start Verifier`.&#x20;

   <div align="left"><figure><img src="/files/ihGRWJ5y9V7jxIMDO29Z" alt="" width="563"><figcaption></figcaption></figure></div>
4. Follow the initialization setup.

   <div align="left"><figure><img src="/files/y7NYB2aOgiDbg42AAOXo" alt="" width="375"><figcaption></figcaption></figure></div>
5. &#x20;Hit `Launch` and sign the transaction in your wallet. Note you need to pay for the gas for this transaction.

   <div align="left"><figure><img src="/files/ukAMffIG2lqWR3ucYP4F" alt="" width="375"><figcaption></figcaption></figure></div>
6. Now your Verifier Client is up and running! Note you need to achieve a minimum uptime of 6 hours to qualify for the node rewards for the day (UTC+0).&#x20;

   <div align="left"><figure><img src="/files/nIf6DYGuQcrFC3VbhIF9" alt="" width="563"><figcaption></figcaption></figure></div>


# Explorer

The CARV protocol explorer displays all attestations and verifications across all supported blockchains. Verifier License holders are able to delegate their licenses using the explorer.

Mainnet explorer link: <https://explorer.carv.io>

<figure><img src="/files/qLWg1tTJ6Oi21w4Blmf9" alt=""><figcaption><p>CARV Protocol Explorer</p></figcaption></figure>


# FAQ

## Node Sales

#### What are the key date&#x73;**?**

Whitelist Node Sale Launch: June 3rd, 2024, at 12 PM UTC (available for 4 days), only for users with Whitelist to purchase.

Public Node Sale Launch: June 5th, 2024, at 12 PM UTC, all users can purchase.

**What is the reward for node operators?**

CARV is dedicating 25% of the total token supply to node verifiers, with a release model reducing by 25% every 6 months, it is expected that about 50% of tokens will be released in the first year alone. Learn more from: <https://medium.com/@Carv/carvs-node-sale-revolutionizing-data-ownership-in-gaming-and-ai-53fa052fa381>

#### **How many nodes will be available in total?**

There will be **100,000** nodes in total

#### **What is the whitelist (WL)?**

Whitelist is a pre-approved list of participants who are given exclusive access to certain privileges during a sale event. This system is used to reward and incentivize key contributors, partners, or early supporters of a project.

#### **What is the waitlist?**

The waitlist is a raffle pool that users can join. Based on the entries, offering users opportunities to be added to the whitelist(WL). Achieving a ranking on the referral leaderboard can qualify for whitelist eligibility as well as USDT rewards.

#### **Does entering the whitelist guarantee that I can definitely purchase a node?**

Please note, being whitelisted does not guarantee a node purchase. It's first come, first served.

#### **How to join the whitelist?**

Choose Any One of the Following Methods:

* Sign Up for the Waitlist: Just visit <https://node.carv.io/> and register to join our waitlist. This alone makes you eligible to participate in the raffle for a chance to win a whitelist spot.
* Earn Based on Contribution: If you're an OG member, you can also secure a spot based on your contributions to our community. For more details <https://medium.com/@Carv/53fa052fa381>
* Participate in Special Events: Keep an eye out for exclusive whitelist opportunities during special events on CARV Play <https://play.carv.io/> and the SOUL Drop <https://protocol.carv.io/>. Participating in these events gives you another chance to earn a whitelist spot.

#### **Can I get more whitelist through different methods?**

Yes, you can obtain more whitelists through different methods. For example, if you obtained a tier 3 whitelist by participating in CARV Play events, a tier 1 whitelist through the referral leaderboard, and a tier 4 whitelist by meeting the core contributor criteria, then you would ultimately receive three whitelists.

#### **I am an influcencer\&KOL. How can I join and collaborate with CARV on node sale?**

If you have a substantial following or network, you can secure your whitelist directly by completing our KOL form. This process is designed specifically for influencers and community leaders. Exclusive benefits for KOLs include receiving a unique referral code that enhances your rewards as you help us expand our community

👉 [Fill out the KOL form here](https://forms.gle/DJYb6HrNwps5JF4T9)

#### **Why Run a Node on CARV?**

Running a verifier node is crucial to maintaining the integrity and security of the data processing environment. Verifier nodes validate attestations produced by TEE nodes, ensuring the data processing is executed securely and as intended. The presence of a majority of honest verifiers, exceeding 50%, is vital to ensure the accurate verification and recording of attestation results on the blockchain, thus upholding the protocol's reliability and transparency.

#### **What will I receive from participating in the node sale?**

You will receive an NFT (ERC-721) which represents your Node License. The NFTs will be minted and transferred by CARV team 3 weeks after the public sale.

#### **How will the node licenses be distributed?**

After purchasing a node license, node licenses will be distributed as an NFT to the purchase wallet of the user. Only the wallet with the node license can then operate the node and earn rewards.

#### **What is the payment method for purchasing a node?**

You can purchase nodes using wETH on the Arbitrum network.

#### **How do run a node? Is it complicated?**

Not at all! Running a node can be quite straightforward and easy, typically involving just a few steps. Please check this step by step tutorial [here](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes). We will soon provide a video tutorial to guide you through the process. If you prefer not to manage the node yourself, you can delegate to other node operators with just a single click through our explorer, which will be available shortly.

#### **Will the invitation leaderboard have an anti-sybil mechanism?**

Yes. There is an anti-sybil mechanism to protect the rights of users who participate honestly in the event. If an invited account is verified to be a bot or another type of non-authentic user account, that user will face severe penalties.

#### **On the referral leaderboard, if I appear on both the overall leaderboard and the weekly leaderboard, can I receive rewards from both lists?**

Yes, for example, if you are ranked 20th on the weekly leaderboard and 50th on the overall leaderboard, you will receive ranking rewards from both leaderboards.

#### **What is the Up-to-100% Buyback Program?**

In order to empower our community to participate confidently in building the foundation of a sustainable, user-owned internet, CARV is pioneering a mechanism: the 'Up-to-100% Buyback Program',

For more information about the buyback program see [Buyback Program](/carv-ecosystem/verifier-nodes/buyback-program).

\
\
More information will be announced on this webpage. You can also follow CARV's social media and community to receive notifications.

<https://discord.com/channels/915445727600205844/1228626164361330689>

<https://t.me/carv_official_global>

<https://twitter.com/carv_official>


# Node Sale

#### What are the key date&#x73;**?**

Whitelist Node Sale Launch: June 3rd, 2024, at 12 PM UTC (available for 4 days), only for users with Whitelist to purchase.

Public Node Sale Launch: June 5th, 2024, at 12 PM UTC, all users can purchase.

**What is the reward for node operators?**

CARV is dedicating 25% of the total token supply to node verifiers, with a release model reducing by 25% every 6 months, it is expected that about 50% of tokens will be released in the first year alone. Learn more from: <https://medium.com/@Carv/carvs-node-sale-revolutionizing-data-ownership-in-gaming-and-ai-53fa052fa381>

#### **How many nodes will be available in total?**

There will be **100,000** nodes in total

#### **What is the whitelist (WL)?**

Whitelist is a pre-approved list of participants who are given exclusive access to certain privileges during a sale event. This system is used to reward and incentivize key contributors, partners, or early supporters of a project.

#### **What is the waitlist?**

The waitlist is a raffle pool that users can join. Based on the entries, offering users opportunities to be added to the whitelist(WL). Achieving a ranking on the referral leaderboard can qualify for whitelist eligibility as well as USDT rewards.

#### **Does entering the whitelist guarantee that I can definitely purchase a node?**

Please note, being whitelisted does not guarantee a node purchase. It's first come, first served.

#### **How to join the whitelist?**

Choose Any One of the Following Methods:

* Sign Up for the Waitlist: Just visit <https://node.carv.io/> and register to join our waitlist. This alone makes you eligible to participate in the raffle for a chance to win a whitelist spot.
* Earn Based on Contribution: If you're an OG member, you can also secure a spot based on your contributions to our community. For more details <https://medium.com/@Carv/53fa052fa381>
* Participate in Special Events: Keep an eye out for exclusive whitelist opportunities during special events on CARV Play <https://play.carv.io/> and the SOUL Drop <https://protocol.carv.io/>. Participating in these events gives you another chance to earn a whitelist spot.

#### **Can I get more whitelist through different methods?**

Yes, you can obtain more whitelists through different methods. For example, if you obtained a tier 3 whitelist by participating in CARV Play events, a tier 1 whitelist through the referral leaderboard, and a tier 4 whitelist by meeting the core contributor criteria, then you would ultimately receive three whitelists.

#### **I am an influcencer\&KOL. How can I join and collaborate with CARV on node sale?**

If you have a substantial following or network, you can secure your whitelist directly by completing our KOL form. This process is designed specifically for influencers and community leaders. Exclusive benefits for KOLs include receiving a unique referral code that enhances your rewards as you help us expand our community

👉 [Fill out the KOL form here](https://forms.gle/DJYb6HrNwps5JF4T9)

#### **Why Run a Node on CARV?**

Running a verifier node is crucial to maintaining the integrity and security of the data processing environment. Verifier nodes validate attestations produced by TEE nodes, ensuring the data processing is executed securely and as intended. The presence of a majority of honest verifiers, exceeding 50%, is vital to ensure the accurate verification and recording of attestation results on the blockchain, thus upholding the protocol's reliability and transparency.

#### **What will I receive from participating in the node sale?**

You will receive an NFT (ERC-721) which represents your Node License. The NFTs will be minted and transferred by CARV team 3 weeks after the public sale.

#### **How will the node licenses be distributed?**

After purchasing a node license, node licenses will be distributed as an NFT to the purchase wallet of the user. Only the wallet with the node license can then operate the node and earn rewards.

#### **What is the payment method for purchasing a node?**

You can purchase nodes using wETH on the Arbitrum network.

#### **How do run a node? Is it complicated?**

Not at all! Running a node can be quite straightforward and easy, typically involving just a few steps. Please check this step by step tutorial [here](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes). We will soon provide a video tutorial to guide you through the process. If you prefer not to manage the node yourself, you can delegate to other node operators with just a single click through our explorer, which will be available shortly.

#### **Will the invitation leaderboard have an anti-sybil mechanism?**

Yes. There is an anti-sybil mechanism to protect the rights of users who participate honestly in the event. If an invited account is verified to be a bot or another type of non-authentic user account, that user will face severe penalties.

#### **On the referral leaderboard, if I appear on both the overall leaderboard and the weekly leaderboard, can I receive rewards from both lists?**

Yes, for example, if you are ranked 20th on the weekly leaderboard and 50th on the overall leaderboard, you will receive ranking rewards from both leaderboards.

#### **What is the Up-to-100% Buyback Program?**

In order to empower our community to participate confidently in building the foundation of a sustainable, user-owned internet, CARV is pioneering a mechanism: the 'Up-to-100% Buyback Program',

For more information about the buyback program see [Buyback Program](/carv-ecosystem/verifier-nodes/buyback-program).

\
\
More information will be announced on this webpage. You can also follow CARV's social media and community to receive notifications.

<https://discord.com/channels/915445727600205844/1228626164361330689>

<https://t.me/carv_official_global>

<https://twitter.com/carv_official>


# Node Operation

#### **Is it feasible to host 100 verifier nodes within the CARV network?**

Yes, a node can receive up to 100 delegations.

#### **Can the user change the commission rate?**

The commission rate can only be changed once per week.

#### **Does having more node delegations increase the cost on node resources?**

No, the number of delegations to a node does not affect its performance.

#### If I delegate to someone, will I lose anything?

You need to pay portion of rewards as commission to the node operator. But right now there are bunch of 0% commission rate nodes so you can delegate to those. You lose nothing and don't need to keep anything running.

#### Getting error \`Failed to Launch Verifier, you verifier node does not have enough voting power. Please connect with a wallet with more License Keys or seek more delegations for your verifier address\`?

There is a 2000 cap for active node to make sure the contract is running efficiently. If you are getting above error that means there are already 2000 nodes active and you don't have enough delegation to join the validator set. You need to have more than the node has lowest delegation in the set to join. Prefer to delegate your license if you are getting this error or try to get more delegations.

#### Why did the rewards get reduced?

The rewards we previously displayed were the total sum of all delegations. We have now corrected the figures to show the rewards for each individual address. The updated numbers accurately reflect what is calculated by the smart contract. Moving forward, the rewards will be updated 30 minutes after midnight UTC every day.

#### How rewards are calculated?

1. Everyday there are 385850 alpha-veCARV in total. Same amount for mainnet. You can check the value here: <https://docs.carv.io/carv-protocol/verifier-node-explained/node-rewards>
2. Based on total number of license participate (delegated), rewards will be evenly distributed.
3. You can check the contract globalDailyActiveNodes to check how many license is delegated in total per day. For example day 1 has 5644 licenses in total, so day 1 each node should expect 385850 / 5644 = 68.36 alpha-veCARV.


# Introduction

Launched in Sept 12, 2024, CARV Labs is the innovation arm of CARV, established to accerelate ecosystem growth in and beyond CARV’s ecosystem spearheading innovation in the AI agentic infrastructure enabling data sovereignty. With a $50 million accelerator fund from top blockchain VC funds, including HashKey Capital and Consensys, CARV Labs is dedicated to incubating and supporting projects that leverage CARV’s agentic infrastructure and D.A.T.A. Framwork towards AGI. This support includes funding, infrastructure, and tailored growth strategies for developers building within the CARV ecosystem.At CARV Labs, our mission has evolved to address the intersection of AI, data sovereignty, and decentralized infrastructure. We’re building solutions that empower AI agents, redefine data ownership, and establish foundational layers for next-generation applications.

* **AI-Driven Data and Identity Layers**: Leveraging cutting-edge data aggregation and identity verification, CARV Labs has worked with projects like *Duckchain to* extend these capabilities, creating a consumer-centric layer that integrates seamlessly with AI ecosystems.
* **AI Gaming Agents**: The evolution of AI within interactive and gaming environments has been propelled by our work with *Telgather*. This initiative focuses on the development of AI gaming agents that integrate seamlessly into decentralized gaming ecosystems. These agents are designed to enhance engagement, competition, and community-driven gaming experiences, setting a new standard for intelligent interactions in virtual worlds.
* **Privacy-First Infrastructure for AI and Beyond**: Through *easeflow*, CARV Labs is building verifier nodes powered by Trusted Execution Environments (TEE). These nodes ensure data privacy and integrity, enabling AI agents to securely fetch, process, and share data. This approach not only safeguards user information but also enhances the scalability and trustworthiness of decentralized infrastructures.

CARV Labs is committed to fostering a future where AI agents, supported by secure and scalable infrastructure, unlock new dimensions of autonomy, intelligence, and collaboration, transforming industries and empowering users globally.


# Working with CARV Labs

For more information and applications to CARV Labs, follow <https://bit.ly/CARVLabsForm>.


# Utility

## **CARV Token Utility and Purpose**

{% hint style="info" %}
$CARV Token Contract Addresses:

* Ethereum: 0xc08Cd26474722cE93F4D0c34D16201461c10AA8C
* Base: 0xc08Cd26474722cE93F4D0c34D16201461c10AA8C
* Arbitrum One: 0xc08Cd26474722cE93F4D0c34D16201461c10AA8C
* Solana: AFJtnuqGMaj5jAo6Pwxo28r1f7XAXXTSA8q3rG3q8b4A
  {% endhint %}

$CARV is a governance token of CARV Ecosystem, now upgraded to Governance Token and Liquidity Token of SVM Chain, including but not limited to the following application scenarios:

* Gas Token, used to pay for the network computing costs of nodes in the blockchain;
* Liquidity Pairing, AI agent token will be paired with the $CARV token in its respective liquidity pool;
* Payment Currency
  * Retail users' premium utilities in CARV ecosystem, e.g., gas payment for multi-chains, gaming assets purchases, etc.
  * AI Agents and projects gated access to continuous utility of CARV protocol, e.g., accessing holistic and unified users' profiles, etc.
* Incentive to bootstrap CARV protocol – the modular data layer, e.g., data owners, providers, consumers
* CARV can be converted to veCARV(s) with 1:1 ratio through staking

## **veCARV Token Utility and Purpose**

veCARV stands for voting-escrow CARV, is a non-transferable token. veCARV is mainly used for:

* CARV Protocol governance (voting & delegation)
* Incentivizes node operators who secure and support the network
* veCARV can be redeemed for $CARV with varying rates and waiting periods, which is explained in more detail in The Redemption Process in whitepaper

<figure><img src="/files/WLw25Dxmp9tXbzsr1Bh8" alt=""><figcaption></figcaption></figure>

### **Redemption of veCARV into CARV**

VeCARV conversion to CARV requires an unlocking period.

The redemption rate varies for different unlocking periods, with longer unlocking periods resulting in higher redemption rates, reaching up to 100%.

Users are required to pay a network channel fee of 1$ CARV each time they initiate a Redeem.

Users can cancel redemption requests at any time without being fined, including after the unlock period is over if the redemption has not been claimed. period is over if the redemption has not been claimed.

<table data-header-hidden><thead><tr><th width="478"></th><th></th></tr></thead><tbody><tr><td>Redemption Duration (Days)</td><td>Rewards (CARV)</td></tr><tr><td>15</td><td>25%</td></tr><tr><td>90</td><td>60%</td></tr><tr><td>150</td><td>100%</td></tr></tbody></table>

***Once veCARV enters the redemption period, it will no longer be eligible to participate in governance voting.***

After the redemption process of veCARV, the remaining (if any) veCARV will be converted to CARV and enter the CARV treasury to maintain network operation or proposal to burn, which makes CARV deflationary.


# veCARV(s)

## Intro

We are excited to announce the launch of veCARV(s), a new staking token designed to empower our community with flexible staking options and enhanced reward potential. Inspired by the Curve model, veCARV(s) allows users to lock their CARV tokens for varying durations, from one month to three years, with corresponding multipliers that increase the longer the stake is held. This model not only incentivizes long-term commitment but also provides users with the flexibility to choose a staking period that best aligns with their investment strategy. The longer you stake, the higher the reward multiplier, offering up to a 9x boost for a three-year commitment. This tiered multiplier structure ensures that every participant, whether they prefer short-term or long-term staking, can benefit from the veCARV(s) system.

**Code:** <https://github.com/carv-protocol/carv-contracts-alphanet/blob/staking/contracts/staking/veCarvs.sol>

## Function Description

1. veCarv(s) is not a standard ERC20 token and does not support `transfer`, `approve`, `allowance`, or `transferFrom`.
2. The ERC20 interfaces supported by veCarv(s) are: `name`, `symbol`, `balanceOf`, and `totalSupply`.

## Staking

1. Users obtain veCarv(s) tokens by staking CARV into the veCarv(s) contract. The veCarv(s) tokens are not actually transferred to the user’s address; instead, each time a user calls `balanceOf`, a real-time balance is calculated for the user (the same applies to `totalSupply`).
2. The initial amount of veCarv(s) a user receives after staking CARV is calculated as: the amount of CARV \* staking duration \* staking coefficient (where the staking coefficient is tentatively set at 1/120D, meaning that when the staking duration is 120 days, the user initially receives veCarv(s) at a 1:1 ratio).
3. A user’s veCarv(s) balance will decay linearly over time (decaying per block, meaning that without new staking, the user’s balance will decrease with each block).
4. Each time a user stakes, a new position is created for the user, recording the amount of CARV tokens staked and the lock-up expiration time.
5. There are no restrictions on the amount of CARV a user can stake or the number of positions a user can hold. However, the lock-up duration of each position must be a multiple of the minimum period T.
6. Users can initiate staking at any time, but the start time of each position in the contract is the start time of the current period T (for example, if T is one week and a user initiates staking on Wednesday, the actual staking start time is Monday at midnight, meaning that the tokens have already decayed partially by the time the staking is initiated).
7. When a user holds multiple positions, the balance is the sum of all positions, but each position can only be redeemed upon expiration; it cannot be added to or have its duration extended.

## Redemption

1. Users can only redeem positions that have reached their expiration date. The redeemed amount will be equal to the staked amount.
2. After the user’s position expires, they can either redeem positions individually or combine them for redemption.

## Minimum Period T

1. To calculate `totalSupply` and `balanceOf`, the contract implements a special algorithm (for detailed explanation, refer to the section \[Algorithm Description] below). This algorithm introduces the concept of the minimum period T into the contract.
2. T is the smallest unit for contract settlement (settlement can be either automatic or triggered by external assistance; external assistance is optional and will not affect the contract’s functionality if absent). The recommended range for T is 1 day to 1 week.
3. If T is too short, it will increase the gas costs for users and CARV officials; if T is too long, it will reduce the flexibility of user operations (because the lock-up duration must be a multiple of T, and the start time for each position must align with the start time of a given T).

## Interface Description

*(This section only covers core function interfaces; non-core interfaces are not described here)*

<table><thead><tr><th width="370">Endpoints</th><th></th></tr></thead><tbody><tr><td><strong>balanceOf</strong>(address user)</td><td>Queries the veCarv(s) balance of a specified user.</td></tr><tr><td><strong>balanceOfAt</strong>(address user, uint256 timestamp)<br></td><td><p>Queries the veCarv(s) balance of a specified user at a specific time.</p><p>Note⚠️: This specified time can be any time in the future or past but does not support times before the contract deployment.</p></td></tr><tr><td><strong>totalSupply</strong>()</td><td>Queries the current total supply of veCarv(s).</td></tr><tr><td><strong>totalSupplyAt</strong>(uint256 timestamp)</td><td>Queries the total supply of veCarv(s) at a specific time.<br><strong>Note⚠️:</strong> The time rules are the same as for <code>balanceOfAt</code>.</td></tr><tr><td><strong>deposit</strong>(uint256 amount, uint256 duration)</td><td>The user inputs the amount to stake and the lock-up duration, and the contract creates a position.<br><strong>Note⚠️:</strong> The staked amount can be any quantity, but the lock-up duration must be a multiple of the minimum period T.</td></tr><tr><td><strong>withdraw</strong>(uint64 positionID)</td><td>The user inputs a position ID to redeem an expired position. Multiple positions can be redeemed together (via <code>multicall</code>).</td></tr><tr><td><strong>positions</strong>(uint64 positionID)</td><td>Queries the status of a position by its ID (such as the staked amount, lock-up expiration time, etc.).</td></tr></tbody></table>

## Algorithm Description

{% hint style="info" %}
**What problem does this algorithm solve?**

In the process of calculating balanceOf and totalSupply for veCarv(s), there is no actual map that records the balance of each user or the global balance. The smallest unit of storage in the contract is the position. To calculate the real-time totalSupply, the most straightforward method would be to traverse and calculate all positions, which is obviously impractical. This algorithm was developed to address this issue (by allocating a small amount of storage in exchange for reducing the number of read operations during each calculation).

This algorithm draws inspiration from parts of the Curve algorithm and has been modified to better suit the needs of veCarv(s).
{% endhint %}

**How does this algorithm calculate veCarv(s) `totalSupply`?**

1. To aid understanding, we establish a two-dimensional coordinate system, with the horizontal axis representing time and the vertical axis representing the quantity of veCarv(s).
2. First, let's consider the simplest scenario where only one user has created a single position. The relationship between the global veCarv(s) quantity and time is given by:\
   $$TotalSupply = slope \* (t - t\_{end})$$, where `slope` is the rate of decline: $$slope = \frac{0-initialSupply}{t\_{end} - t\_{begin}}$$, where ​`t` is the time variable, and its valid range is $$t\_{begin} ～ t\_{end}$$. `initialSupply` is the initial veCarv(s) quantity after the user creates the position, as shown in the figure below:<br>

   <figure><img src="/files/qngdcrMiC7F4gdTGNBfG" alt=""><figcaption></figcaption></figure>
3. At this point, we can easily calculate the `totalSupply` of veCarv(s) at any time between $$t\_{begin} ～ t\_{end}$$ using this formula.
4. However, when the system has multiple positions simultaneously, the graph will look like the one below, where each black solid line represents the decay curve of a single position.<br>

   <figure><img src="/files/VkqtlKnR8u3YqfvSIO0y" alt=""><figcaption></figcaption></figure>
5. By summing the functions of these three black solid lines, we can obtain the global decay function of `totalSupply`. It's also evident that the slope of the global decay function changes at each time point t1 to t6, which correspond to the start and end times of each position. These are the points where the slope of the global decay curve changes.
6. We can store the global curve in an array of `Point`s, where each `Point` stores three values:
   1. The horizontal coordinate `t`, which represents the time.
   2. The vertical coordinate `bias`, which represents the initial `totalSupply` at the current time.
   3. The slope, which indicates the rate of decay of the curve until the next `Point`.
7. With this `Point` array, calculating `totalSupply` at the current time or at any future time becomes very simple:
   1. Suppose we want to calculate `totalSupply` at the time $$t\_{target}$$​, and the most recent `Point` corresponds to the time $$t\_{current}$$​.
   2. If $$t\_{target} > t\_{current}$$, the slope of the curve changes as the current active positions expire, so we calculate by iterating forward.
   3. If $$t\_{target} < t\_{current}$$​, we can iterate backward through the `Point`s to find the corresponding interval and then calculate.
8. Below is an explanation of how this `Point` array is constructed:
   1. Define the minimum operation period T. The `Point`s are discrete, and the minimum interval between `Point`s is T, but the entire curve is continuous (continuity of the curve means that `totalSupply` and `balanceOf` can be calculated at any time).
   2. Initialization: The first `Point` is (0, 0), and the slope is also 0.
   3. For each subsequent position's start and end time, a new element is added to the `Point` array. The code is as follows:

```solidity
solidityCopy code// From the previous Point's t to the current t
for (uint32 epochIndex = lastRecordEpoch + 1; epochIndex <= currentEpoch; epochIndex++) {
    // Update epochPoints only if the slope changes or the current t is reached
    if (slopeChanges[epochIndex] == 0 && epochIndex < currentEpoch) {
        continue;
    }

    // Previous Point
    EpochPoint memory lastEpochPoint = epochPoints[epochPoints.length - 1];
    // New Point
    EpochPoint memory epochPoint;
    // slopeChanges records (t => slope change)
    // New slope = old slope + current slope change (the current slope change can be + or -)
    epochPoint.slope = lastEpochPoint.slope + slopeChanges[epochIndex];
    // Current initial supply = previous point's slope * time decay + new positions added at this t
    epochPoint.bias = lastEpochPoint.bias - (uint256(lastEpochPoint.slope) * (epochIndex - lastEpochPoint.epochIndex) * DURATION_PER_EPOCH);
    // Record t
    epochPoint.epochIndex = epochIndex;
    epochPoints.push(epochPoint);
}
```

9. Using the above algorithm, we can calculate `totalSupply` at any given time with relatively low cost. Similarly, we can also calculate `balanceOf` (which is the `totalSupply` at the user address level).


# Distribution & Vesting

The total supply of $CARV will be 1,000,000,000 and will become accessible over four years, starting at the time of the Token Generation Event. The initial four-year post TGE allocation of the total supply of $CARV is as follows:

* **Nodes & Community 50.000%** - through various means to reward our community for their efforts in contributing to the project's success
* **Ecosystem & Treasury 9.000%** - Treasury holding of $CARV tokens
* **Early Investors 9.246%** - seed and early strategic investors in CARV who are willing to company the project in the long run
* **Private Fundraising** **8.295%** - series A and thereafter investors in CARV that participate in private fundraising
* **Founding** **Team & Advisors 19.459%** - rewarding the core founding contributors and advisors for their full-time effort to the project's success
* **Liquidity 4.000%** - tokens allocated to provide liquidity

To align incentives of all stakeholders, CARV token's ($CARV) vesting for all shareholders is indicated below:

<figure><img src="/files/fA5bb3wJ2ufokzyNEnFW" alt=""><figcaption><p>Vesting Schedule by Stakeholders</p></figcaption></figure>


# CARV Testnet Token

### CARV Testnet Token Overview

#### Token Address

```
0xbdd15B0fec494a0234F7A13fD60D10f38F751763
```

#### Supported Testnet Blockchains

The CARV testnet token is deployed across the following test networks to support testing and integration of multi-chain functionalities:

* **BSC Testnet**
  * [**https://testnet.bscscan.com/address/0xbdd15B0fec494a0234F7A13fD60D10f38F751763**](https://testnet.bscscan.com/address/0xbdd15B0fec494a0234F7A13fD60D10f38F751763)
* **Base Testnet**
* **Ethereum Sepolia Testnet**

#### Purpose

The CARV testnet token is used for the following:

* Internal testing and QA for CARV infrastructure
* Simulating staking, reward mechanisms, and cross-chain token flow
* Developer integration testing for smart contracts and dApps using the CARV token standard
* Validating bridging and on-chain behavior in a multi-chain environment

#### Notes for Developers

* This token is strictly for **testnet usage** and has no real-world or mainnet value
* Faucet distributions or manual airdrops may be arranged upon request
* Ensure you’re connected to the correct testnet before initiating any operations with the token

#### Related Tools and Resources

* CARV Explorer (Testnet instance, if available)
* CARV Smart Contract Docs
* Faucet/Dev Support: Reach out via [Discord](https://discord.gg/carv)

#### Disclaimer

Do not attempt to trade or purchase this token on any mainnet DEX. It is a testnet-only asset used for development and simulation purposes.


# Universal Guardian Program

Interoperable Proof of Contribution and Influence Credentials Unlocking Web3 Freelancing Marketplace

*Origin*: a **community contribution and co-building program** for builders who share CARV's vision and want to contribute and be rewarded. Contributors become more integrated with CARV and eventually lead, own, and govern.&#x20;

*Becoming*: a **platform for universal proof of contribution and influence credentialing**.&#x20;

* Previous contributions and influences of an individual across various projects and platforms can be aggregated, attested to, and showcased&#x20;
* Ongoing contributions and influences are verified, recorded, and built on top of the profile, composible over time, and intraoperable across platforms.&#x20;

<div data-full-width="true"><figure><img src="/files/tkyRhCRihfsjSCmLSqId" alt=""><figcaption><p> CARV Guardian Program's Proof of Contribution and Influence - Composible Over Time </p></figcaption></figure></div>

<figure><img src="/files/MpOdAMTTVhjsZN3yNVLm" alt=""><figcaption><p>CARV Guardian Program's Proof of Contribution and Influence - Intraoperable Across Platforms</p></figcaption></figure>

**Such a credentialing system begins with gaming and progresses beyond CARV, allowing all eco-systems to leverage and build upon it.**&#x20;

After working with 250 communities in the gaming space, we have identitied the roles and skillsets brands value most. Currently, influence and credentials are tracked across four roles (with more to come). When Guardian members complete tasks by CARV / projects corresponding to certain roles, Guardians accumulate EXPs (credential points), add skill tags to their profiles, and record their tasks & review of task completion in a transparent, immutable way.&#x20;

Everyone who wants to can record and participate in tasks, the marketplace, and become a more integral part of projects.&#x20;

<table><thead><tr><th width="343.3333333333333">Roles</th><th width="396">Skills</th></tr></thead><tbody><tr><td>[Priest] Community Moderators</td><td>#conflict resolution #content moderation #event organization #community engagement #communication #translation</td></tr><tr><td>[Paladin] Content Creators</td><td>#translation #article writing #research #video creation #animation #uiux #motion graphics</td></tr><tr><td>[Hunter] BD &#x26; Partnerships</td><td>#research #leadgeneration #partnership #businessdevelopment</td></tr><tr><td>[Warrior] Developers </td><td>#programming #debugging #alphatesting #contractdevelopment</td></tr></tbody></table>

As we set our sights on a progressive future, here's a glimpse of the exciting roadmap ahead:

<figure><img src="/files/wjfTre1LeDnJzcG9clA3" alt="Roadmap for CARV&#x27;s Guardian Program"><figcaption><p>Roadmap for CARV's Guardian Program</p></figcaption></figure>

For more details of the becoming version, please check out [Guardian Program's notion page](https://carv-official.notion.site/CARV-Guardian-Program-18d11b52c1b24d96b7cff3f7454a569e).


# DAO Governance

*This is an early draft and may change based on community feedback.*

CARV DAO is a **decentralized, community-led** system where CARV token holders propose and vote on ecosystem changes. Governance power reflects **both token holdings and active contributions** to ensure fair decision-making. A **smart contract-managed treasury** funds ongoing development. CARV tokens are not just for governance but have **real utility** within the CARV ecosystem.

**Note:** Members who can’t vote actively can delegate their voting power to others ("voting delegation").

### Principles & Rules

<table data-header-hidden><thead><tr><th width="127.2552490234375">Sections</th><th>Rule</th><th></th></tr></thead><tbody><tr><td><strong>Sections</strong></td><td><strong>Rule</strong></td><td><strong>Note</strong></td></tr><tr><td>Proposers<br></td><td><ol start="1"><li>The combined total of veCARV(s) + veCARV exceeds 10M</li><li>Guardian Level 20+</li><li>Committee Members</li></ol><p>These three groups of people can meet the proposal eligibility criteria in CARV DAO.<br></p></td><td><ol start="1"><li><p>How to get the voting rights via $CARV:</p><ol><li>Operating verifier Node to get veCARV releasing</li><li>Staking $CARV on the page to generate veCARV(s)</li><li>Each 1 veCARV = 1 veCARV(s)</li></ol></li><li>Guardian: A decentralized community of participants responsible for actively engaging in public proposals and contributing to governance.</li></ol></td></tr><tr><td>Proposal content<br></td><td><p>Proposals:</p><ul><li>Abstract</li><li>Motivation</li><li>Rationale</li><li>Key Terms Definitions</li><li>Specifications</li><li>Steps to Implement</li><li>Timeline</li><li>Overall Cost</li></ul></td><td>-</td></tr><tr><td>Review and synchronization mechanism<br></td><td><ol start="1"><li><a href="https://discord.com/channels/915445727600205844/915445727600205846">Create a channel </a>where holding any veCARV(s) or veCARV allows participation in discussions. The community users in this channel can make proposal suggestions.</li><li>Committee members will draft proposals based on community feedback.</li><li>The draft will use <a href="https://tally.xyz/">Tally.xyz</a> to submit proposals and organize the necessary Community Townhall and Guardian Townhall.</li></ol></td><td>Committee Members will provide necessary assistance to Guardians and eligible veCARV(s) or veCARV holders in drafting proposals.<br></td></tr><tr><td>Voting mechanism<br></td><td><ol start="1"><li>Voting rights are obtained through staking or nodes, with each veCARV(s) or veCARV representing one vote.</li><li>These voting rights can be delegated to others.</li><li><a href="https://tally.xyz/">Tally</a> voting phase: Any user holding veCARV(s) or veCARV can vote.</li><li>If the majority (over 50%) of voters approve, the proposal will proceed to the execution phase.</li></ol></td><td>The governance contract is on Base.<br></td></tr></tbody></table>


# Community Programs & Activities

Join the Fun with Like-Minded Individuals in Our Welcoming Community!

The CARV community is one of the fundamentals of CARV, with the objective of creating a lively and engaging space for CARVers to socialize, have fun, co-build, govern a gaming hub around the world.&#x20;

As of October 2023, CARV Twitter and Discord community has grown to a family of 150K+ followers & 120K+ members respectively, with 25% second-week engagement rate.

CARV community has a variety of events exclusively happening in the CARV Discord community, recurring every week:

### [CARV Dragon Ball](https://opensea.io/collection/dragontreasure) Community Bootstrap & Power CARV Pass Seasons

Created to encourage initial bootstrapping and participation in the CARV community. Over a six-month period, the Dragon ball: CARVers Arise Project took place, resulting in a total of 24,835 CARVed Dragon ball and the distribution of 660,697 Dragon ball Fragments. To actively involve gamers, a variety of community events were organized such as casino betting, fan-art meme sharing, game nights, and more. CARV Pass Seasons are continuously ongoing within CARV community.&#x20;

### Game Nights

CARV organizes routinely fun-filled and engaging game night event that brings gamers together for a night of friendly competition and laughter. Gamers can get exclusive access to the game and compete with fellow CARVers playing Web3 and Web2 games

<figure><img src="/files/p5uL9auvP97FlzbVjwcr" alt="CARV Community Game Night"><figcaption><p>CARV Community Game Night</p></figcaption></figure>

### Beta Testing

CARV invites gamers to join beta testing for games in the closed beta test phase and asks them to provide feedback and suggestions for future game development improvement.

<figure><img src="/files/1gZNwp3Ss0t6VW50KIH7" alt="CARV Community Beta Testing"><figcaption><p>CARV Community Beta Testing</p></figcaption></figure>

### Live streaming

Streamers from and outside CARV community live stream trendy Web3 and Web2 games within CARV community.

<figure><img src="/files/RLiwNrxMqQafQcSWBh3G" alt="CARV Community Live Streaming"><figcaption><p>CARV Community Live Streaming</p></figcaption></figure>

### AMAs&#x20;

CARV community constantly invites partners to join CARV community for AMAs to introduce the projects to the community.

<figure><img src="/files/lvDJY7SLh6XacuBZdtAe" alt="CARV AMA"><figcaption><p>CARV AMA</p></figcaption></figure>

### Community Townhall

The CARV Core team is hosting bi-weekly community Townhalls to address any questions or concerns raised by community members. These townhalls provide a great opportunity to have direct conversations with the team and receive personalized assistance.

<figure><img src="/files/nZ7nKHcwQK54EuHQ77k0" alt="CARV Community Townhall"><figcaption><p>CARV Community Townhall</p></figcaption></figure>

### Pop-up Quiz & Polls:&#x20;

Pop-up quiz about CARV trivia and polls are for CARV team to get a better understanding and to engage CARV community.

### Fan-art competition:&#x20;

Fan-art competitions is a contest where CARV users create and submit their artwork to be used as memes, stickers, and mascots within the CARV community. The winning submissions will be made available for all CARV users.

<figure><img src="/files/m4BbYZVZmgcHX2eNR47f" alt=""><figcaption><p>CARV Fan-art</p></figcaption></figure>

<figure><img src="/files/jOupiEMM85vkOysQPs5x" alt=""><figcaption><p>CARV Fan-art</p></figcaption></figure>

### Gaming-generated content Forum

CARVers constantly published their insights, thoughts, tutorials, and walk-throughs about games they recommended in CARV Discord.

<figure><img src="/files/wVh69zqSvo8Yy4INVxt5" alt="Gaming-generated content Forum"><figcaption><p>Gaming-generated content Forum</p></figcaption></figure>

Join our [community](/resources/social-and-community-links) and become a CARVer today!


# Writings

* CryptoNews: on [Gaming Chains are Winning Over Developers and Players](https://crypto.news/gaming-chains-are-winning-over-developers-and-players/) by Ambero Tu, CARV CTO
* Dailyhodl: on [In AI’s Data Divide, Blockchain Finally Empowers the Have-Nots](https://dailyhodl.com/2024/12/11/in-ais-data-divide-blockchain-finally-empowers-the-have-nots/) by Ambero Tu, CARV CTO
* TheStreet: on [The Gamified Approach Helps Demystify Complex Blockchain Concepts](https://www.thestreet.com/crypto/innovation/the-gamified-approach-helps-demystify-complex-blockchain-concepts-a-chat-with-carv-co-founder-victor-yu-) with Victor Yu, CARV COO
* CryptoSlate: on [The Gaming Lesson from Off The Grid and Telegram](https://cryptoslate.com/the-gaming-lesson-from-off-the-grid-and-telegram-put-blockchain-in-the-background/) by Leo Li, CARV CGO
* CryptoNews: on [Connect People and Platforms: The Identity-First Path to Decentralization](https://crypto.news/the-identity-first-path-to-decentralization-opinion/) by Ambero Tu, CARV CTO
* Medium: [CARV Q1-Q3 2024 Revenue Report: A Year of Growth and Expansion](https://medium.com/@Carv/carv-q1-q3-2024-revenue-report-a-year-of-growth-and-expansion-38315efc7185)


# CARV in the News

* **Understanding CARV: A Comprehensive Overview**: <https://messari.io/report/understanding-carv-a-comprehensive-overview>
* **Seed Round Funding Led by Temasek's Vertex Ventures**: <https://techcrunch.com/2022/11/22/carv-funding-40-million-valuation/>
* **Approval of ERC7231**, new NFT standard for unified ID: <https://thedefiant.io/erc-7231-ethereum-community-backs-carvs-nft-standard-for-value-redistribution-to-users-in-the-ai-revolution>
* **Netmarble's Strategic Investment for Partnership on Data & AI**: <https://decrypt.co/222756/carv-and-marblex-partner-to-deliver-data-driven-web3-gaming-experiences>
* **Strategic Funding from HashKey Capital & Alibaba Group**: <https://finance.yahoo.com/news/carv-capitalizes-hashkey-led-strategic-141800863.html>
* **CARV raises $10M Series A to Help Users Monetize Their Data**: <https://techcrunch.com/2024/04/25/carv-raises-10m-series-a-to-help-gaming-and-ai-firms-monetize-data/>
* **CARV Launches $CARV Token: Empowering Data Ownership And Value Generation in Gaming and AI**: <https://www.investing.com/news/cryptocurrency-news/carv-launches-carv-token-empowering-data-ownership-and-value-generation-in-gaming-and-ai-3656948>
* **CARV Labs A $50M Accelerator backed by Consensys and HashKey Capital**: <https://cointelegraph.com/news/consensys-hashkey-50m-accelerator-launches-carv>


# Social & Community Links

Life Is Better with Friends!

[CARV Official Website](https://bit.ly/CARVWeb_forWhitePaper)

* [CARV Protocol](https://protocol.carv.io/)
  * [CARV ID, Token-locked Voting](https://protocol.carv.io/airdrop)
* [CARV Play ](https://play.carv.io/)
* [CARV TV on Twitch](https://www.twitch.tv/carv_tv)
* [CARV TV on TikTok](https://www.tiktok.com/@carv_tv)
* [CARV Coinmarketcap](https://coinmarketcap.com/currencies/carv/)

[CARV Official X Account](https://bit.ly/CARVX_forWhitePaper)

[Discord](https://discord.gg/carv)

[Telegram](https://bit.ly/CARVTelegram_forWhitePaper)

[Medium](https://bit.ly/CARVMedium_forWhitePaper)

[Newsletter](https://bit.ly/CARVNewsletter_forWhitePaper)

[Linkedin](https://bit.ly/CARVLinkedIn_forWhitePaper)

[Youtube](https://bit.ly/CARVYoutube_forWhitePaper)&#x20;

[More Regional Account Links](https://bit.ly/CARVLink3_forWhitePaper)


# Brand Guideline

Because Consistency Is the New Cool.

1. We have different variations of our logos, please use the correct logo for your purpose.&#x20;
2. You are not allowed to modify or alter our logos in any way. This includes resizing, changing colors, and adding effects.&#x20;
3. Please ensure that our logos are placed in an appropriate location where they can be easily identified. Also, ensure that our logos are not obscured or distorted in any way.

We appreciate all content related to us. If you are using our logos, we would appreciate it if you acknowledge the CARV project and provide more information about us.

### Download Branding Kit Here -&#x20;

{% file src="/files/HOMRIaM57JOudYU2kjq3" %}

### Access Figma Here -&#x20;

{% embed url="<https://www.figma.com/file/en04fNIH50z8dpNmTs8wgf/CARV%C2%A0Brand-Guideline-V1.0?mode=design&node-id=0:1&t=gtTBBSpI0ry6u1V8-1&type=design>" %}
CARV Brand Guideline
{% endembed %}


# Job Openings

Refer ongoing opportunties to build with CARV [here](<https://carv-official.notion.site/Careers-CARV-4b8f4bffb60e4bcf95551921f7ab8c86 >).&#x20;


