.js` in the terminal. In this case, the return data looks as follows by Apr. 4th, 2023.
```json theme={null}
{
"count": 593525,
"holders": [
{
"wallet_address": "0x5e3ef299fddf15eaa0432e6e66473ace8c13d908",
"amount": "3814264335.329752",
"usd_value": "4167560569.389670"
},
{
"wallet_address": "0x401f6c983ea34274ec46f84d70b31c151321188b",
"amount": "910440417.955799",
"usd_value": "994769961.668955"
},
{
"wallet_address": "0xcd6507d87f605f5e95c12f7c4b1fc3279dc944ab",
"amount": "590639315.000000",
"usd_value": "645347281.551875"
},
{
"wallet_address": "0xb316fa9fa91700d7084d377bfdc81eb9f232f5ff",
"amount": "434226114.715070",
"usd_value": "474446308.590553"
},
{
"wallet_address": "0xcbfe11b78c2e6cb25c6eda2c6ff46cd4755c8fca",
"amount": "273304816.000000",
"usd_value": "298619674.582000"
}
]
}
```
## API Reference
If you want to know more details on the endpoint and optional parameters, check out:
* [Get top token holders](/api-reference/web3-api/token/token-holders/get-top-token-holders)
## Support
If you meet any trouble following the tutorial, feel free to reach out to us in our [Discord](https://chainbase.com/discord) to get 24/7 community support.
# Chainbase Documentation
Source: https://docs.chainbase.com/getting-started/welcome
Access blockchain data from 90+ chains. Build with APIs, AI agents, or data pipelines.
Chainbase provides the data infrastructure for Web3 developers. Whether you're querying on-chain data via APIs, building AI agents with blockchain context, or streaming data into your own infrastructure β start here.
Connect AI agents to real-time Web3 data via MCP, x402 micropayments, or Claude Code skills.
Use CLI, Web3 API, SQL API, or Tops API to access token, wallet, NFT, and social data across 90+ chains.
Build custom data pipelines with Manuscript or sync chain data to your own infrastructure.
Run SQL queries against terabytes of indexed on-chain data in Chainbase Data Cloud.
***
Looking for a specific product? See [all Chainbase products](/getting-started/explore-all-products).
# Chainbase Improvement Proposals (CIPs)
Source: https://docs.chainbase.com/network/contributing/cips
Chainbase Improvement Proposals (CIPs) outline standards for the Chainbase network. These include core protocol specifications, client APIs, and contract standards. Network upgrades are discussed separately in the Chainbase CIPs repository.
## Contributing
* Review CIPs: Familiarize yourself with the process by reading CIPs.
* Clone the Repository: Start by cloning our CIPs repository.
* Submit Your CIP: Use the provided template to draft your proposal and submit a Pull Request to the CIPs repository.
## CIP Status Terms
* Idea: Preliminary concept, not yet formally tracked.
* Draft: First tracked stage, properly formatted and submitted.
* Review: Ready for peer review.
* Last: Final review stage, typically lasting 30 days.
* Final: Established as a standard, only updated for corrections.
* Stagnant: Inactive for 6+ months, can be reactivated.
* Withdrawn: Proposal has been withdrawn and cannot be reused.
* Living: Continuously updated, never final (e.g., CIP-1).
## Meta
Processes or changes affecting Chainbase development, requiring community consensus.
## Informational
Guidelines or information for the Chainbase community, not proposing new features.
For more details, visit our CIP documentation and guidelines.
# Governance
Source: https://docs.chainbase.com/network/contributing/governance
Chainbase embraces a governance model based on rough consensus and running code. Changes are driven by proposals, community buy-in, and the implementation of running code. The consensus process involves different stakeholders:
1. **Workers** - Provides blockchain data
2. **Developers** - Build and create manuscripts
3. **Consumers** - Pay \$C query data network
4. **Delegators** - Delegate \$C to worker & secure the network
This model avoids rigid structures, voting, or official roles, promoting action, diversity of viewpoints, and decentralization. Most changes follow the CIP (Chainbase Improvement Proposal) process.
# Legal Disclaimer
Source: https://docs.chainbase.com/network/contributing/legal-disclaimer
This communication does not constitute an offer to sell or the solicitation of an offer to purchase any C tokens, and should not be construed as such. It is not intended as an advertisement, solicitation, confirmation, or financial promotion to engage in any investment activity or similar endeavor. The information contained herein should not be relied upon for any form of advice, including but not limited to legal, investment, financial, or tax advice. It is imperative to seek guidance from a qualified professional in these matters.
Please be advised that, in order to comply with regulatory requirements, Chainbase DAO may be unable to support certain jurisdictions or specific individuals. This ensures that we operate within the bounds of applicable laws and regulations and helps us protect both our organization and our users. Consequently, access to our services may be restricted or denied to some users based on these regulatory compliance considerations. We strive to apply these measures fairly and transparently, and we regret any inconvenience this may cause. We appreciate your understanding and cooperation in this matter. Should you have any questions or need further assistance, please feel free to reach out to our support team.
The content of this document includes hypothetical, forward-looking, and/or projected figures, all of which are subject to change and carry no guarantee of accuracy. Actual results may vary. Chainbase DAO and its subsidiaries make no express or implied representation or warranty regarding the completeness, reliability, validity, or accuracy of the information provided herein. It is acknowledged that this content may contain errors and is subject to modification without prior notice. No oral or written information obtained from Chainbase DAO shall be deemed to create any warranty or representation not expressly stated herein.
# MiCAR White Paper
Source: https://docs.chainbase.com/network/contributing/micar_whitepaper
Download: Chainbase: MiCAR White Paper
# Overview
Source: https://docs.chainbase.com/network/contributing/overview
At Chainbase, we welcome and appreciate contributions of all sizes from the community. Thanks to the efforts of over 50 core contributors and tens of thousands of developers, our network and protocols have grown and improved significantly.
Your contributions, no matter how big or small, make a difference. Let's build something great together!
## Documentation
Welcome to the central hub for all documents. If you have any feedback, we encourage you to contribute by opening an issue or creating a pull request at [docs.chainbase.com](https://docs.chainbase.com) .
## Community
[Website](https://chainbase.com) - Official website ([https://chainbase.com](https://chainbase.com)) .
[X (Twitter)](https://x.com/ChainbaseHQ) - Any updates and announcements about Chainbase.
[Discord](https://discord.gg/chainbase) - Public chat for developer support.
[Github](https://github.com/chainbase-labs) - Code and Proposal Discussion.
# Chainbase Roadmap
Source: https://docs.chainbase.com/network/contributing/roadmap
Open blockchains promises a new era of democratized internet. We are building the next-generation data network for the AI era. Our mission is to make data accessible and useful. As the development team behind Chainbase, we are dedicated to creating and supporting networks, protocols, and dApps that unlock the intelligence and value of open data and drive human progress.
The following details Chainbase's path to interoperability, security, and sustainability.
***
## Aquamarine
π
Mar 20, 2025, 14:30:00 PM +UTC
**Summary**
In ancient lore, aquamarine was the sailorβs stone, offering protection, clarity, and guidance across uncharted waters. It symbolized transformation and renewal, much like the evolution of Chainbase as it advances into its next phase. While Zircon (Genesis) laid the bedrock for a secure and decentralized data network, Aquamarine represents the fluid expansion of this foundationβdeepening Web3βs data ecosystem, refining public data standards, and pioneering on-chain AI collaboration.
This phase is crucial as AI and Web3 begin to converge, demanding more scalable, intelligent, and interconnected data solutions. Aquamarine will establish Chainbase as a fundamental public data platform in the AGI era, equipping AI Agents with the infrastructure they need to collaborate and evolve. As the tides of decentralized intelligence rise, Aquamarine is the vessel that will navigate this new frontier.
### **Key Focus Areas for Aquamarine**
* **Chainbase Network Explorer**
Launch a dynamic interface that allows users to navigate and interact with the expanding data ecosystem, ensuring transparency and usability.
* **Manuscript Early Adoption**
Enhance Manuscript into a core AI-compatible tech stack, providing structured, verifiable, and scalable data for AI-powered Web3 applications.
* **Delegating Tokens on Testnet**
Initiate community engagement by enabling token delegation in a secure, incentivized test environment, laying the groundwork for decentralized governance.
* **Initializing Data Zone Development**
Integrate all Manuscripts within their respective Data Zones that serve as the data source for various application scenarios, much like subnets.
* **Decentralizing Data Accessibility Layer**
Transform data access by establishing a decentralized network architecture, ensuring open, secure, and universal connectivity across blockchain networks.
* **Developing AI Tooling Kit**
Create a comprehensive suite of tools designed specifically for AI Agents, facilitating seamless interaction with on-chain data and empowering automated decision-making.
* **Creating AI Agents for Vertical Scenes**
Deploy specialized AI agents tailored for industry-specific applications, enhancing the integration of AI within vertical markets and driving sector-focused innovation.
* **Chainbase Network Mainnet Launch**
Transition from testnet to a fully operational main network, solidifying Chainbaseβs position as a foundational data network in the age of decentralized intelligence.
***
## ZIRCON(Genesis)
π
May 27, 2024, 12:25:00 PM +UTC
π [chainbase.network on waybackmachine](https://web.archive.org/)
**Summary**
The βZIRCON (Genesis)β project marks the beginning of a groundbreaking chapter for Chainbase, aiming to build a unified, secure, and decentralized data network. This ambitious initiative seeks to set new standards in data protocols, decentralized computing and storage, and developer incentives. It also focuses on training sophisticated crypto-world models and empowering users with cutting-edge AI tools. As Chainbase evolves, it will support a thriving data ecosystem, enhance protocol efficiency, and serve the ever-expanding needs of Web3.
**Omnichain Data Standards**
Result: Build a standard protocol that can combine and utilize all data on the network.
**Decentralized Network**
Result: Decentralized computing, storage and validation, and providing services.
**Developer Community Economy**
Result: Rewards for developers who create data(manuscripts) value in the network.
**Crypto World Model**
Result: Training crypto-world models to go beyond knowledge and become intelligent.
**Users Empowerment**
Result: Supporting non-expert crypto users with enhanced AI models and tools.
Through efforts in these five key areas, Chainbase will lay a solid foundation for the data ecosystem in the AI era, driving innovation and development in onchain data.
# Co-processor Layer
Source: https://docs.chainbase.com/network/core-concepts/architecture/co_processor_layer
# **Introduction**
π Chainbase realized early on that with the widespread application of blockchain technology, different application scenarios would generate a large amount of diverse data. Extracting value from these isolated and varied data sets is a challenging problem.
β¨ Pre-set data sets cannot meet the customized needs of developers. We need to open up modular and composable stack capabilities to fully unleash developers' creativity. This creativity will transform into knowledge, which is why we need a Co-processor Layer. This will allow a large number of developers to collaborate around the Chainbase Network, accumulating knowledge and generating collective intelligence.
# **What is the Co-Processor Layer?**
The Co-Processor Layer of the Chainbase Network is a component designed to facilitate user collaboration in contributing data processing and AI expert knowledge. Its main functions include:
1. **Knowledge Contribution**: Users can contribute their expertise in data processing and specialized task models to the Co-Processor Layer. This collaborative environment harnesses collective intelligence to enhance the network's capabilities.
2. **Assetization of Knowledge**: Contributions in the Co-Processor Layer are transformed into assets. This layer manages the distribution, circulation, and trading of these assets, ensuring contributors are rewarded for their knowledge and efforts.
3. **\$C Token Ecosystem**: The Co-Processor Layer revolves around the \$C token, which is integral to the network's incentive structure. It facilitates payments, settlements, staking, and governance, creating a vibrant and dynamic ecosystem.
# Consensus Layer
Source: https://docs.chainbase.com/network/core-concepts/architecture/consensus_layer
The consensus layer ensures that all execution layer nodes in the network reach a consensus on data and state consistency, based on CometBFT's instant final determinacy, achieving second-level data freshness.
## **What is CometBFT**
CometBFT is a software used for securely and consistently replicating applications across multiple machines. It ensures that the system can still operate normally when less than one-third of the machines fail. The core functions of CometBFT include:
* **Security**: Tolerates any type of failure, including malicious attacks.
* **Consistency**: All normally operating machines can see the same transaction logs and calculate the same state.
## **Features of CometBFT**
* **Byzantine fault tolerance**: CometBFT can tolerate less than one-third of machine failures, which can be in any form, including malicious attacks.
* **Universal Application Interface**: Through the Application Block Chain Interface (ABCI), developers can use any programming language and development environment to build their own application logic.
* **High performance and ease of use**: CometBFT is simple in design, high in performance, and suitable for various distributed applications.
* **Modular design**: Separates the consensus engine from application state management, providing a flexible development environment.
## **Why Choose CometBFT as the Consensus Engine**
In the distributed network of Chainbase Data Network, all execution layer nodes need to reach a consensus on the status of large-scale data processing. The efficiency and resilience of consensus are key factors, so CometBFT is an ideal choice. It ensures that the system can efficiently and robustly reach consensus when processing large amounts of data, providing strong support.
## **How to Integrate CVM Consensus**
### CVM Consensus
1. **Block Proposal:** Validators take turns proposing new blocks. The proposing validator requests the latest block from CVM through the Engine API.
2. **Block Construction:** The execution layer CVM obtains the source data to be processed from the Data Accessibility Layer, runs the logic of the Manuscript data processing submitted to the network, generates the result of the Dataset record and index proof, and builds a new CVM block.
3. **Block Inclusion:** The proposed CVM block is packaged as a CometBFT transaction and added to the consensus layer block, ready for network validation.
4. **Finalizing Blocks:** If the proposed consensus layer block obtains the approval of two-thirds of the validator set, the block will be finally determined and added to the Chainbase Data Network chain. These final blocks include the index proof and state after CVM processes the data, and the final consensus block represents that this processed data can be used externally.
# Data Accessibility Layer
Source: https://docs.chainbase.com/network/core-concepts/architecture/data_accessibility_layer
# Overview
## Glossary
* Data Providers: Provide On-Chain or Off-Chain data
* Data Consumers: Consumers like LLM / Developers / Data Engineer and so on.
* SCP: Storage-Based Consensus Paradigm. This is how the dataset is being proved.
* CDC(Changelog): Change Data Capture. Data stored permanently in Arweave, like changelog which generated by CDC.
* Dataset: Data set which is stored in any database or file system. It can be accessed directly by the data consumer through API / SQL / Sync.
* Data Manifest: Data manifest is a metadata file that contains the information about the dataset.
## Data Flow
1. Data Providers collect On-Chain & Off-Chain data, then push the data with Zero-Knownledge Proof to CVM.
2. The CVM verifies the raw data provided by the Data Provider and writes the data permanently and immutably into Arweave in the form of a Changelog(CDC), while updating the data index in the Manifest.
3. The Manuscript consumes the raw data in a streaming manner using the CDC approach to extract and process high-value data.
4. The processed data can be directly stored in a database or local files, and the CVM provides direct data access services via SQL/API/Sync
# Solved Problems
## Distributed Data Lake
The raw data is stored immutably and in a decentralized manner on Arweave. The data is shared according to specific rules and uploaded to Arweave after sharding. The data shards are maintained through a Manifest and the query index is provided by the Scheduler.
The structure of the Manifest is as follows:
The data within the shards is stored in the form of a Changelog. The contents of the Changelog are as follows:
Storing data in the Changelog format has the following advantages:
1. Elegantly solves the Reorg issue in blockchain data.
2. Data is written in an Append Only manner, eliminating the need to handle conflicts, allowing for optimal data freshness.
3. The downstream CVM can continuously read upstream data in a streaming manner then process it. While benefiting from the compounding effect of upstream data, the downstream data also maintains good data freshness.
## Proof of Raw Data
Chainbase Network uses Zero-Knowledge Proof(ZKP) technology to prove the source and integrity of the data. Any network user can verify the source and validity of the data based on the ZKP.
The networkβs raw data comes from decentralized Data Providers. These Data Providers obtain data from different Web3 RPC service nodes and use consensus algorithms to determine the final data results, thereby preventing any single data provider from supplying incorrect or malicious data.
Chainbase Network also establishes an SLA(Service Level Agreement) that Data Providers must adhere to regarding data quality and service standards. If Data Providers violate the corresponding SLA, they may face penalties.
## Proof of Indexed Data
Indexed Data is verified using SCP(Storaged-Based Consensus Paradigm).
The basic principles are as follows:
All verified Raw Data is immutably and persistently stored on Arweave. Manuscript is a data processing script written in programming languages such as Python, Javascript, Rust, and SQL, which are consensus already taken in the physical world. These data processing scripts will remain open-source, allowing any Validator to verify the generated Indexed Data based on Raw Data and Manuscript, thus achieving consensus on Indexed Data in a simple and effective manner
# Summary
In summary, Chainbase Network stands out by leveraging advanced technologies like Zero-Knowledge Proof(ZKP) and a Storage-Based Consensus Paradigm(SCP) to ensure data integrity and reliability. With decentralized and immutable storage on Arweave, and Manuscript for data processing, Chainbase Network offers robust data verification, seamless data services, and unparalleled data freshness.
This decentralized data lakehouse establishes Chainbase Network as a leader in secure and efficient data management.
# Execution Layer
Source: https://docs.chainbase.com/network/core-concepts/architecture/execution_layer
# **Introduction**
### **Background Information**
With the rapid development of blockchain technology, the demand for scaled applications is increasing. To enhance performance and throughput, blockchain projects need to handle large amounts of data. This need is not only driven by technological development, but also to create user-friendly, value-driven applications, as proven by data-driven internet applications. Furthermore, the core belief of blockchain technologyβdecentralizationβrequires us to maintain system decentralization and security while improving performance. Therefore, designing an efficient parallel computation execution layer is especially important.
# **Features of the Execution Layer**
### **Parallelization**
Parallelization is one of the core features of the execution layer, including data parallelism and task parallelism:
* **Data Parallelism**: Data parallelism involves dividing a large dataset into smaller data chunks and processing them in parallel on multiple threads, significantly speeding up data processing.
* **Task Parallelism**: Task parallelism involves breaking down computational tasks into independent subtasks that are executed in parallel. This approach is suitable for complex computational tasks that can be processed in parallel, improving the system's computational capabilities and efficiency.
Through data parallelism and task parallelism, the execution layer can handle large-scale data, enhancing overall performance and throughput.
### **On-chain Database**
The next-generation on-chain database, Chainbase DB (CDB), optimizes data management and storage efficiency through state storage separation:
* **State Storage Separation**: State storage separation is a method of separating the latest state and historical data storage. This design significantly improves data access performance and reduces state bloat problems.
* **Efficient State Management**: Through state storage separation, the system can manage and access state data more efficiently, reducing bottlenecks in data access during computation and enhancing overall performance.
The optimization of the on-chain database enables the execution layer to efficiently process and store large amounts of data, providing a solid foundation for parallel computing.
### **Decentralized Environment Based on Eigenlayer AVS**
The introduction of Eigenlayer is aimed at enhancing the system's decentralization and security:
* **Decentralized Verification**: Eigenlayer provides a decentralized verification mechanism, introducing Ethereum economic incentives through Restake to ensure system security and reliability.
* **Economic Security**: By utilizing Ethereum economic security, Eigenlayer ensures high security in a decentralized environment, preventing malicious attacks and tampering.
The introduction of Eigenlayer not only enhances the system's decentralization feature but also provides additional economic security, balancing high performance and high security in the execution layer.
### **Programmable Runtime Environment**
The Manuscripts runtime environment is designed specifically for the execution of data processing computational logic, providing efficient, flexible execution support:
* **Virtual Machine Environment**: The execution layer provides an efficient virtual machine environment through the Chainbase Virtual Machine (CVM) specifically designed for executing Manuscripts. CVM supports multithreaded parallel processing, enhancing computational performance and throughput.
* **Computational Logic Execution**: The CVM environment allows developers to write and execute complex data processing logic, supporting various data transformation and processing tasks, and enhancing data processing efficiency.
* **Flexibility and Scalability**: CVM provides a flexible development environment and good scalability, supporting various programming languages and frameworks, enabling developers to easily create and deploy data processing logic.
By providing a powerful computational logic execution environment, the execution layer provides developers with an efficient, flexible platform that supports complex data processing tasks and application scenarios.
# Overview
Source: https://docs.chainbase.com/network/core-concepts/architecture/overview
# **Architecture**
# Module Introduction
### **Data Accessibility Layer**
[Data Accessibility Layer](/network/core-concepts/architecture/data_accessibility_layer) manages data access and storage in the network, is compatible with data access interfaces for both streaming and batch scenarios, and provides data validity verification. It includes:
* **Data Access Interface:** Provides access to both batch and streaming data.
* **Data Storage:** Supports various storage solutions, including Lakehouse, Arweave, S3, and IPFS.
* **Data Proof:** Implements zk-proofs and storage-based consensus paradigms to ensure data integrity and availability.
### **Consensus Layer**
[Consensus Layer](/network/core-concepts/architecture/consensus_layer) ensures that all nodes in the network reach a consensus on data and status consistency, based on CometBFT's instant finality, achieving second-level data freshness. Including:
* **Consensus Algorithm:** Based on CometBFT and DPoS (Delegated Proof of Stake) to achieve efficient and secure consensus.
* **ABCI++:** An extension of Cosmos network's ABI, responsible for converting the state of the Chainbase Virtual Machine (CVM) to a format compatible with the CometBFT consensus engine.
* **Stake Aggregator:** Aggregates staked tokens from various Cosmos ecosystem sources to ensure network security.
### **Execution Layer**
[Execution Layer](/network/core-concepts/architecture/execution_layer) is responsible for large-scale data processing and execution of Manuscripts' data transformation logic. Including:
* **Chainbase Virtual Machine (CVM):** A virtual machine that provides parallel computing capabilities to execute Manuscripts
* **Parallel Execution Engine:** Utilizes multithreading for parallel data processing, enhancing performance and throughput.
* **ChainbaseDB (CDB):** A database system that supports multiple data storage engines, including VectorDB, GraphDB, and KV storage.
* **Eigenlayer AVS (Proof Verification System):** Introducing the Ethereum economic security brought by Restake, making the CVM running environment fully decentralized
### **Co-processor Layer**
Chainbase has introduced the [Co-processor Layer](/network/core-concepts/architecture/co_processor_layer) to facilitate user collaboration in data processing and AI expertise. This layer allows users to transform their specialized knowledge into tradeable assets, managed and incentivized through the \$C token system, creating a dynamic ecosystem. This design enhances data accessibility and encourages developer collaboration, accumulating knowledge and generating collective intelligence, thereby unlocking greater potential for blockchain technology.
### **Dual Staked Security**
This module enhances the network security of the consensus layer and execution layer in the dual-chain architecture through a double staked mechanism. Including:
* Shared Staked Pool:
* Native Token Stake: \$C native token captures network value
* Eigenlayer Restake: Introduces Ethereum tokens with low volatility and deep liquidity
* Double Staked Model: By aggregating all validators' stake and their power mapping for various assets, the total cryptographic economic security is calculated.
### Manuscript
[Manuscript](/resources/manuscript/overview) defines the standard schema that different data sources need to follow when converting into datasets.
### CVM Interface
The CVM Interface provides a set of standardized interface protocols for interacting and communicating with CVM, allowing developers to write and manage Manuscripts on the network, as well as access Dataset in the data network.
# Chainbase Network AVS Design
Source: https://docs.chainbase.com/network/core-concepts/avs-design
## **Overview**
EigenLayer's AVS is a cornerstone of its high-performance execution layer. Details to be specified [here](/network/core-concepts/data-processing-based-on-avs).
## **Integration with EigenLayer Core (AVS Directory)**
To integrate with EigenLayer Core, Chainbase Network implements an instance of ECDSAServiceManagerBase or ServiceManagerBase (BLS). This integration allows operators to register by sending transactions to the AvsServiceManager, completing the registration process
## **On-Chain Verification Challenges**
Chainbase Network requires a stable and efficient group of operators to form a decentralized and trusted data processing network. The Coordinator component needs a mechanism to measure the operational quality of these operators, ensuring they meet the network's standards. This is achieved through an on-chain consensus game involving slashing for non-compliance.
The Coordinator periodically generates a challenge task, which involves calculating the block hash of a specific block within the blockchain data integrated into Chainbase Network. This task has a clear answer and expected outcome. The challenge is sent to operators' manuscript-node nodes, where they execute the task and return the signed result along with the recorded task execution time. This information is used to evaluate the operators' efficiency, and the results are verified on the AVS chain.
## **Implementation Details**
**Coordinator:**
1. Listens to the on-chain contract `ChainbaseServiceManager` events.
2. Sends tasks to `Manuscript Node` via an RPC interface.
3. Receives task responses from `Manuscript Node` via the RPC interface.
4. Aggregates responses from multiple `Manuscript Nodes` and submits the results to the on-chain contract `ChainbaseServiceManager`.
**Manuscript Node:**
1. Registers the operator by calling `RegisteryCoordinator`.
2. Receives tasks from the Coordinator via the RPC interface.
3. Executes tasks, signs the task response.
4. Sends the signed task response back to the Coordinator.
**Contracts:**
1. The `ChainbaseServiceManager` contract includes functions for `createNewTask` and `respondToTask`, facilitating the creation of tasks and the submission of task responses for verification.
# Data Processing Based on AVS
Source: https://docs.chainbase.com/network/core-concepts/data-processing-based-on-avs
## **Overview**
Chainbase Network is an hyperdata network powered by a [dual-chain](/network/core-concepts/dual-chain) architecture using Cosmos and EigenLayer, enabling trustworthy and transparent on-chain data processing. Through the [Manuscript protocol](/network/core-concepts/manuscript) on the Chainbase Virtual Machine (CVM), the network ensures seamless data interoperability. By integrating [EigenLayerβs](https://www.eigenlayer.xyz/) staking mechanism, Chainbase leverages Ethereum's economic security to build a high-performance AVS for its [Execution Layer](/network/core-concepts/architecture/execution_layer). This ensures large-scale data processing while maintaining security, decentralization, and scalability, supporting the growing demands of blockchain applications.
## Execution layer node based on AVS
The execution layer nodes of Chainbase Network are built on EigenLayer, providing users with a node network for on-chain data processing. Developers can submit Manuscript data processing programs and request the final result dataset. EigenLayer operators with computational resources can restake and register as execution layer nodes of Chainbase Network, providing the required computing resources. As Chainbase Network integrates data query fees, restakers will generate income from it.
As more and more Manuscripts run on Chainbase Network, more high-quality computing resources are needed. To achieve elastic scaling of resources while maintaining high throughput, on-chain computing tasks need to be routed to the best provider according to the running preferences of Manuscript. Key factors include node geographic location (latency), computing hardware, and network environment. EigenLayer will support Chainbase Network through diversified operators and routing strategies to meet these needs.
### **Summary**
Chainbase Network is a full-chain data network supported by the dual-chain architecture of Cosmos and EigenLayer, aiming to provide a trustworthy and transparent data processing environment. To achieve interoperability, the Manuscript protocol was developed and runs on the Chainbase Virtual Machine (CVM), designed for large-scale data processing.
By combining EigenLayer's staking mechanism, Chainbase Network enhances economic and safety guarantees and builds a high-performance execution layer. EigenLayer operators can register as nodes of Chainbase Network, provide computing resources, and profit through integrated data query fees.
With the increase of Manuscript operations, the system needs more high-quality computing resources, and EigenLayer provides diversified operators and routing strategies to support this demand.
# Dual-Chain
Source: https://docs.chainbase.com/network/core-concepts/dual-chain
### Consensus Layer + Execution Layer
Chainbase introduces an innovative dual-chain architecture that enhances the programmability and composability of cross-chain data, supporting high throughput, low latency, and finality. This architecture achieves higher network security through a dual staking model.
#### What Does the Dual-Chain Architecture Bring?
1. **Performance Optimization**: As the largest distributed data engine of the future, it needs to support high-throughput data processing. The CVM in the Execution Layer supports parallel computing capabilities, while the Consensus Layer utilizes CometBFT optimized for performance.
2. **Programmability**: Manuscripts define the standard schema that different data sources need to follow when converting into datasets. The redesigned Execution Layer provides a runtime environment for these Manuscripts.
3. **Composability**: The redesigned Execution Layer can handle data streams from multiple sources for joint processing. For example, aggregating data sources from various chain lending protocols can create a universal lending rate.
4. **Enhanced Crypto-Economic Security**: Traditional public chain projects often compromise security to optimize performance and compatibility. By introducing the dual-chain architecture of Eigenlayer and Cosmos, Chainbase incorporates a dual staking model, ensuring game-theoretic security for the hyperdata network.
#### Consensus Layer
The Consensus Layer ensures data and state consistency among all nodes in the network. Its main advantages include:
* **Instant Finality**: Using CometBFT, once data is processed and included in a block, it is considered final visible data without the need for additional confirmations or data reorganization.
* **Proven Robustness**: CometBFT is battle-tested and has successfully protected billions of dollars across various blockchain networks, proving its robustness and reliability.
#### Execution Layer
The Execution Layer excels in large-scale data processing and complex data transformation tasks. Its main advantages include:
* **Parallelization**: Through data parallelism and task parallelism, the Execution Layer can handle large-scale data, enhancing overall performance and throughput.
* **Decentralized Environment Based on Eigenlayer AVS**: The introduction of Eigenlayer not only enhances the system's decentralization but also provides additional economic security, balancing high performance and high security in the Execution Layer.
* **Programmable Runtime Environment**: By providing a powerful computational logic execution environment, the Execution Layer offers developers an efficient and flexible platform that supports complex data processing tasks and application scenarios.
### Conclusion
Through its innovative dual-chain architecture, Chainbase successfully combines the advantages of the Consensus Layer and the Execution Layer to achieve high performance, low latency, and finality. This architecture not only enhances the network's programmability and composability but also provides higher economic security through a dual staking model. With instant transaction finality and proven robustness, Chainbase sets new standards in blockchain performance and interoperability, providing a solid foundation for data processing and applications in the AI era.
# Dual-Staking
Source: https://docs.chainbase.com/network/core-concepts/dual-staking
# Why dual staking?
* Early PoS (Proof of Stake) networks can face a "death spiral" problem. If the token's value decreases, it weakens the network's security, leading to a decline in Total Value Locked (TVL), which further depresses the token price, thus creating a death spiral.
capture:[https://www.blog.eigenlayer.xyz](https://www.blog.eigenlayer.xyz)
# How it works
Protect the same PoS network using two tokens, one of which can be a low-volatility, deep-liquidity, more accessible external network token such as Ethereum (ETH). Also use network native tokens to capture network value
# Different method
**Modular Dual Staking**: Local operators and ETH-backed operators are required to reach a quorum respectively.
**Native Dual Staking**: Similar to mesh security, two sets of operators are treated as one, each operator's stake is converted into unified units based on an external oracle, and the user then validates the response based on the combined quorum.
**Veto Dual Staking**: The local operator is first individually quorate and the ETH-backed operator acts as a safeguard to check the behavior of the local operator. If the local operator makes a mistake, the ETH-supported operator has the right to veto a valid response sent by them.
### Impl architecture
1. support LST && native token stake
for supported LST please check:[https://app.eigenlayer.xyz/restake](https://app.eigenlayer.xyz/restake)
\$C is our native token, for more detail TBD
2. how to manage stake token
* for LST part, staker first stake to operator then operator register to our AVS. offline relayer watch && sync avsβs operator stake & delegations(eg.`sync(CainbaseAVS.Operator[] calldata operators`)) info with cosmos part(maybe call xxx chain ?)
* For the \$C part, stakers interact with erc20-stake contract to emit a `Stake(bytes operator_pubkey, uint256 amount)` event. The relayer then watches for this event and syncs the information with the Cosmos part.
* We choose the Native Dual Staking model where an oracle ensures fair price conversion of both `$LST` and `$C` into `$C-Stake` units.
# **Reference**
* [Eigenlayer:Dual Staking: secure a PoS network with two tokens](https://www.blog.eigenlayer.xyz/dual-staking/)
* [osmosis-labs:Mesh Security Architecture](https://github.com/osmosis-labs/mesh-security/blob/main/docs/README.md)
* [dual staking and Espresso](https://youtu.be/o9y_pZUr0Nc?t=1727)
* [You Could've Invented EigenLayer | Kydo 0x - Eigen Labs](https://youtu.be/fCl_PucMytU?si=afSo2MK5oWJPeE69)
# Glossary
Source: https://docs.chainbase.com/network/core-concepts/glossary
## Common Terms
* βοΈ**Alchemist** - a developer or technical contributor who creates, manipulates, or alters manuscripts.
* π**Manuscript** - an executable that runs on the Chainbase Virtual Machine (CVM). Manuscripts define the standard schema that different data sources need to follow when converting into datasets.
* βοΈ**Chainbase Virtual Machine (CVM)** - a virtual execution environment, complete with interface, that allows for the execution of sophisticated data queries.
* πΎ**Data Set -** a structured collection of aggregated, validated, and indexed data comprised of data tables and stored in the Chainbase Warehouse.
* π**Chainbase Warehouse** - a storeplace for all pre-built datasets on the Data Platform.
* π½**Data Network** - the intersection of CVM/Eigenlayer AVS (execution), IBC, ABCI++, and CometBFT (consensus), with a proprietary Data Availability Layer composed of roll ups/network participants.
* πΏ**Data Platform** - the suite of developer tools which allow streamlined access to information available on the Data Network.
* π€**TheiaChat** - an AI agent, based on Theia, offering streamlined access point to the data network with built-in knowledge bases.
* πΊοΈ**Theia** - the proprietary Crypto World Model which uses causal reasoning on crypto patterns to create verifiable reasoning chains on crypto data.
# Co-processor Layer Testnet
Source: https://docs.chainbase.com/network/developers/testnet
## Overview
The [Co-processor Layer](/network/core-concepts/architecture/co_processor_layer) is building a community-driven collaborative layer for data developers, aimed at continuously unlocking and enhancing the value of crypto data. Built on the advanced [OP stack](https://docs.optimism.io/stack/getting-started) architecture and integrated with the innovative [Superchain](https://app.optimism.io/superchain/) ecosystem, it ensures efficient, scalable, and secure data processing and management.
## Info
| **Parameter** | Value |
| --------------------- | ---------------------------------------------------------------------------------- |
| **Network Name** | Chainbase Network testnet |
| **Rollup Stack Type** | OP Stack |
| **Settlement Layer** | Sepolia Testnet |
| **Chain ID** | 2233 |
| **Currency Symbol** | ETH |
| **Explorer** | [https://testnet.explorer.chainbase.com/](https://testnet.explorer.chainbase.com/) |
| **Bridge** | [https://testnet.bridge.chainbase.com/](https://testnet.bridge.chainbase.com/) |
## Guide
1. Add the Chainbase Network testnet to your wallet via the [Rollup Info Page](https://rollup-info.altlayer.io/enough-fog-compact/chainbase_testnet).
2. Bridge your Sepolia Testnet ETH to the Chainbase Network testnet using the [bridge interface](https://testnet.bridge.chainbase.com/).
**Note:** Get Sepolia Testnet ETH from [sepoliafaucet.com](https://sepoliafaucet.com/) or [sepoliafaucet.io](https://www.sepoliafaucet.io/).
3. After initiating the deposit, wait about 1 minute for it to complete. Then, you can start deploying your contracts on the Chainbase Network testnet.
# Introducing Chainbase
Source: https://docs.chainbase.com/network/introduction/about
Chainbase is the world's largest **hyperdata network** designed to integrate all blockchain data into a unified ecosystem, providing an open and transparent data interoperability layer for the AI era.
It has designed a novel **dual-chain** technology architecture that bridges the programmability and composability of crypto data, which supports high throughput, low latency, and eventual determinism, as well as higher cybersecurity through a dual staking model.
Our mission is to **make data accessible and useful**. With Chainbase, people can truly enjoy the benefits of the open internet era.
# Learn
If you want to learn more, get started by diving into these concepts:
* [Network Overview](/network/introduction/networks/overview) - Get a quick overview of the Chainbase network in one panoramic view.
* [Core Concepts](/network/core-concepts/dual-chain) - Getting to know Chainbase from its dual-chain architecture.
* [Glossary](/network/core-concepts/glossary) - Some terms make it easy to understand the whole world.
* [Roadmap](/network/contributing/roadmap) - Introduce in detail how Chainbase achieves interoperability, security and sustainability.
# Use Cases
What can Chainbase be used for? Consider the following examples of potential applications that are now possible with Chainbase:
1. **Wallet**: Enables wallets to manage and view assets on multiple blockchains from a single interface, improving user convenience.
2. **Security**: Tracks attacks, provides security alerts, and performs in-depth security analysis to protect the blockchain network.
3. **AI**: Facilitates the deployment of AI models that use data from multiple blockchains, enhancing accuracy and decentralization.
4. **Social**: Builds social platforms where users from different blockchains can interact and share content seamlessly.
5. **Infrastructure**: Provides a robust infrastructure for building applications that utilize data from multiple blockchains.
6. **DeFi**: Enables DeFi platforms to support lending and borrowing across different blockchains, increasing liquidity and flexibility.
# Contributing
To learn about how to contribute to the network, including this documentation site, check out the [Contributing](/network/contributing/overview) section.
# FAQs
Source: https://docs.chainbase.com/network/introduction/faqs
## What are all the ways I can get involved?
* Use our [Data Platform](https://console.chainbase.com/register)
* Join our [Data Network](https://chainbase.mintlify.app/network/introduction/networks/overview)
* Use our AI Agent
* Write a [Manuscript](https://chainbase.mintlify.app/network/core-concepts/manuscript)
* Join our [Discord](https://chainbase.com/discord)
## When testnet? When mainnet? When token?
Soon! Be sure to follow us on [X](https://x.com/ChainbaseHQ) for latest updates.
## Is Chainbase open source?
Chainbase is in the process of open-sourcing all user-facing products and services; for the most up-to-date, you can take a look at our github repository here: [https://github.com/chainbase-labs](https://github.com/chainbase-labs)
## Will Chainbase work for smart contracts?
No! Chainbase does not execute contracts - it is specifically for making data accessible both on and off-chain. Rather than writing smart contracts, developers can execute sophisticated data processing using [manuscripts](https://chainbase.mintlify.app/network/core-concepts/manuscript#overview).
## Will I need to know Solidity to write manuscripts?
No! Most manuscripts are written in [SQL](https://chainbase.mintlify.app/network/core-concepts/manuscript#gpl). With [GPL](https://chainbase.mintlify.app/network/core-concepts/manuscript#gpl), you can write manuscripts in Typescript, Solidity, even Python.
## Who can I reach out to for more help?
For more help, Join our Discord or reach out to our DevRel, [KagemniKarimu](https://x.com/kagemnikarimu)
# Litepaper
Source: https://docs.chainbase.com/network/introduction/litepaper
Download: Chainbase: The Decentralized hyperdata network for Open AGI Economy
λ€μ΄λ‘λ: Chainbase: μ€ν AGI κ²½μ λ₯Ό μν νμ€μν μ΄λμ²΄μΈ λ°μ΄ν° λ€νΈμν¬
# Delegators
Source: https://docs.chainbase.com/network/introduction/networks/delegators
## Delegators
Delegators enhance the economic security of the network by staking their tokens to validators and operators. The Chainbase network uses a dual staking mechanism, where delegators can choose to stake `$ETH (or $LST)` and `$C`.
### Staking Tokens
Delegators can stake their tokens to support validators and operators, contributing to the network's security and stability.
1. **Choose Tokens**: Decide whether to stake `$ETH (or $LST)` or `$C`.
2. **Select Validators/Operators**: Choose the validators and operators you want to support.
3. **Stake Tokens**: Use the staking interface to delegate your tokens to the selected validators and operators.
### Earning Rewards
By staking tokens, delegators earn a share of the rewards earned by the validators and operators they support.
for details refer to [tokenomics](/network/introduction/tokenomics)
### Community and Support
Join the Chainbase delegator discord to collaborate with other delegators, share knowledge, and get support.
# Developers
Source: https://docs.chainbase.com/network/introduction/networks/developers
## Developers
Developers are both the demand and supply side of the network's data. Developers build manuscripts and publish them to the network to earn rewards, and at the same time, when they build Dapps, they query network data, becoming users of the network.
### Local Development(Coming soon)
Developers use the `chainbase-sdk` to build manuscripts locally. The SDK provides a comprehensive set of tools and libraries that simplify the process of data transformation and querying.
#### Setting Up the Development Environment
To get started, developers need to set up their local development environment. This involves installing the necessary dependencies, configuring the SDK, and setting up a local blockchain node for testing.
1. **Install Dependencies**: Ensure you have Node.js and npm installed. Then, install the `chainbase-sdk` using npm:
```bash theme={null}
npm install chainbase-sdk
```
2. **Configure the SDK**: Create a configuration file to specify the connection details for your local blockchain node and other settings.
3. **Set Up Local Node**: Run a local blockchain node to simulate the network environment. This allows you to test your manuscripts in a controlled setting.
refer to [how to run a node](xxx)
### Testing and Validation
After development, manuscripts can be deployed to our sandbox environment, where developers have the opportunity to validate their manuscripts in advance to ensure there are no indexing errors and that they work as expected.
#### Sandbox Environment
The sandbox environment mimics the main network but operates in isolation, allowing developers to test their manuscripts without affecting the live network. This environment provides tools for debugging and performance monitoring.
1. **Deploy Manuscripts**: Use the SDK to deploy your manuscripts to the sandbox environment.
2. **Run Tests**: Execute a series of tests to validate the functionality and performance of your manuscripts.
3. **Debugging Tools**: Utilize the provided debugging tools to identify and fix any issues.
### Publishing
When developers are satisfied with their manuscripts, they can publish them to the network. This is an on-chain operation that registers the manuscript so that indexers (operators) can discover it.
#### On-Chain Registration
Publishing a manuscript involves an on-chain deploy that registers the manuscript with the network. This process ensures that the manuscript is indexed and available for querying by other network participants.
1. **Prepare Manuscript**: Ensure your manuscript is finalized and thoroughly tested.
2. **Initiate deploy**: Use the SDK to initiate the on-chain deploy for publishing your manuscript.
3. **Confirmation**: Wait for the deploy to be confirmed on the blockchain. Once confirmed, your manuscript is officially published and indexed.
### Earning Rewards
By publishing manuscripts, developers can earn rewards based on the usage and value of their data transformations. The network incentivizes high-quality and frequently used manuscripts, providing a steady stream of rewards to active developers.
1. **Usage-Based Rewards**: Earn rewards based on the number of queries and the amount of data processed by your manuscripts.
2. **Quality Incentives**: High-quality manuscripts that provide valuable data transformations are eligible for additional incentives.
for details refer to [tokenomics](../tokenomics.mdx)
### Community and Support
Join the Chainbase developer discord to collaborate with other developers, share knowledge, and get support. Contribute to the documentation and SDK development get potential reward.
1. **[Discord](https://discord.gg/chainbase)**: Engage with other developers on the Chainbase Discord.
2. **Contributions**: Contribute to the SDK and documentation to help improve the tools and resources available to all developers.
# Operators
Source: https://docs.chainbase.com/network/introduction/networks/operators
## Operators
Operators play a crucial role in the network by providing the necessary computational resources for the execution layer, ensuring the smooth operation of data processing tasks. Operators are rewarded in a manner akin to proof-of-work, with greater workloads demanding higher hardware requirements.
### Becoming an Operator
To become an operator in the Chainbase network, follow these steps:
1. **Register**: Register as an operator on the Holesky testnet or the mainnet of the Eigenlayer smart contract. This will register your Ethereum public key with the Eigenlayer smart contract. Follow the instructions on [Eigenlayer](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation).
2. **Set Up Infrastructure**: Ensure you have the necessary hardware and software infrastructure to support the network's computational requirements.
3. **Run Node Software**: Install and run the Chainbase node software to start participating in the network.
### Responsibilities
Operators are responsible for maintaining and managing the computational infrastructure required for data processing tasks.
1. **Infrastructure Management**: Maintain and manage the hardware and software infrastructure to ensure efficient operation.
2. **Data Processing**: Process and execute data query requests submitted by data developers.
### Earning Rewards
Operators earn rewards based on the quality and quantity of data processing services they provide. The network incentivizes operators to maintain and optimize their computing resources.
for details refer to [tokenomics](../tokenomics.mdx).
### Community and Support
Join the Chainbase discord operators channel to collaborate with other operators, share knowledge, and get support.
# Overview
Source: https://docs.chainbase.com/network/introduction/networks/overview
The Chainbase Network is composed of Operators, Validators, Developers, and Delegators who provide services to the network and supply data to Web3 applications. Consumers utilize these applications and consume the data.
TL;DR
* developers build [manuscripts](../../network/core-concepts/manuscript.mdx)
* operators index [manuscripts](../../network/core-concepts/manuscript.mdx)
* validators maintain network consensus
* delegators delegate to operators && validators enhance the economic security
## Developers
Developers are both the demand and supply side of the network's data. Developers build manuscripts and publish them to the network to earn rewards, and at the same time, when they build Dapps, they query network data, becoming users of the network.
### Local Development
Developers use the `chainbase-sdk` to build manuscripts locally, for details refer to [developers details](xxx).
### Testing and Validation
After development, manuscripts can be deployed to our sandbox environment, where developers have the opportunity to validate their manuscripts in advance to ensure there are no indexing errors and that they work as expected.
### Publishing
When developers are satisfied with their manuscripts, they can publish them to the network. This is an on-chain operation that registers the manuscript so that indexers (operators) can discover it.
## Operators
Operators play a crucial role in the network by providing the necessary computational resources for the execution layer, ensuring the smooth operation of data processing tasks. Operators are rewarded in a manner akin to proof-of-work, with greater workloads demanding higher hardware requirements, for details refer to [operator details](xxx).
To become an Operator in the network, one must first register as an operator on the Holesky testnet or the mainnet of the Eigenlayer smart contract. This will register your Ethereum public key with the Eigenlayer smart contract. You can follow the instructions on [Eigenlayer](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation).
## Validators
Validators play a key role in maintaining the security and consensus of the network. They are responsible for ensuring data integrity and maintaining network stability. Validators in the network reach consensus through an improved cometbft and use DPOS to determine voting weight based on the size of the staked \$C data.
There are certain hardware and software requirements to become a validator in the network. If you wish to become a validator, please contact the team.
## Delegators
Delegators enhance the economic security of the network by staking their tokens to validators and operators. The Chainbase network uses a dual staking mechanism, where delegators can choose to stake `$ETH (or LST)` and `$C`.
# Validators
Source: https://docs.chainbase.com/network/introduction/networks/validators
## Validators
Validators play a key role in maintaining the security and consensus of the network. They are responsible for ensuring data integrity and maintaining network stability.
### Becoming a Validator
To become a validator in the Chainbase network, follow these steps:
1. **Contact the Team**: Reach out to the Chainbase team to express your interest in becoming a validator and to get detailed instructions.
2. **Meet Requirements**: Ensure you meet the necessary hardware and software requirements to run a validator node.
3. **Register**: Register as a validator on the network by following the provided instructions.
4. **Set Up Node**: Install and configure the validator node software to start participating in the network.
### Responsibilities
Validators are responsible for verifying transactions, maintaining network consensus, and ensuring data integrity.
1. **Transaction Verification**: Verify and confirm transactions to ensure their legality and accuracy.
2. **Consensus Maintenance**: Maintain the network's consensus mechanism, preventing malicious behavior and attacks.
3. **Data Integrity**: Ensure the integrity of the data being processed and stored on the network.
4. **Network Governance**: Participate in network governance by proposing and voting on network improvements and development directions.
### Earning Rewards
Validators earn rewards for their role in maintaining the network's security and stability. The reward structure incentivizes validators to perform their duties effectively.
for details refer to [tokenomics](../tokenomics.mdx)
### Monitoring and Performance
Validators should continuously monitor their node's performance to ensure it meets the network's standards.
1. **Performance Metrics**: Access performance metrics to evaluate your node's efficiency and reliability.
2. **Regular Monitoring**: Regularly check your node's status and performance to ensure it is operating optimally.
3. **Upgrades and Maintenance**: Perform necessary upgrades and maintenance to keep your node up-to-date and secure.
### Community and Support
Join the Chainbase validators discord channel to collaborate with other validators, share knowledge, and get support.
# Tokenomics
Source: https://docs.chainbase.com/network/introduction/tokenomics
# The Age of AI Demands a New Data Economy
Data is the foundation of artificial intelligence.
As AI grows more autonomous and deeply embedded into digital infrastructure, high-quality data has become the most valuable asset.
Yet, current data systems aren't built for intelligent machines. Blockchain data remains fragmented, unstructured, unverifiable, and lacks pricing or incentive model. There's no native mechanism to value, trade, or coordinate data effectively.
Chainbase introduces a new standard: **Hyperdata Network**. Designed for the AI-native internet, it transforms raw blockchain activity into structured, composable, and machine-consumable data. It enables autonomous agents, protocols, and humans to access and coordinate through a shared data layer.
At the heart of this ecosystem is **\$C**. It powers AI and the broader DataFi economy.
## What is \$C?
\$C is the foundational asset of DataFi ecosystem, enabling the production, exchange, and governance of structured data across AI and crypto.
### Core Utilities of \$C
#### Dataset Access
Agents, apps, and protocols use \$C to query and consume structured data.
#### Ecosystem Incentives
Distributed to developers, contributors, and users based on their activity and value to the network.
#### Decentralized Execution Security
Staked to support and validate data processing through the AVS layer.
#### Protocol Governance
Token holders vote on protocol upgrades, incentive models, and network parameters.
#### DataFi Currency
Serves as the standard unit of account and settlement across the Chainbase ecosystem.
## Token Distribution
Chainbase has allocated 65% of the total \$C supply to ecosystem growth, contributor rewards, and user incentives. This reflects Chainbase's commitment to open participation and long-term alignment.
### Token Distribution Breakdown
* **Ecosystem + Community (40%)**: Reserved for grants, integrations, developer incentives, campaign rewards, and long-term community growth. This allocation supports open access and sustained participation in the Chainbase network.
* **Airdrop Incentives (13%)**: Distributed over three seasons to reward strategic partners (e.g: Season 1 allocates 3.5%, including 2% native community incentives and an additional 1.5% Binance Alpha), developers, users, project teams, and contributors who actively support ecosystem growth.
* **Worker Incentives (12%)**: Allocated to participants who operate data nodes and support Chainbase's decentralized infrastructure.
* **Early Backers (17%)**: For initial investors who provided early support and guidance to the project.
* **Core Contributors (15%)**: Reward for founding team members and core builders, with allocations optimally aligned with long-term protocol success.
* **Liquidity (3%)**: Reserved for exchange support and healthy market dynamics.
**Total supply**: 1,000,000,000 \$C
**Initial Unlocked Supply**: 16%
## Unlock Schedule
The \$C release model is structured to ensure long-term stability and meaningful participation.
### Core Team & Early Backers
Tokens vest over 3 years, with a 12-month cliff followed by linear distribution over 24 monthsβdesigned to incentivize long-term contribution.
### Sustained Incentives for Infrastructure Operators
Worker Incentives, distributed to participants operating data nodes, vest linearly over 60 months, ensuring consistent support for the decentralized infrastructure that powers the Chainbase network.
### Ecosystem-Aligned Emissions
Tokens allocated to ecosystem development unlock linearly over 36 months, aligned with developer growth, incentive programs, and platform adoption milestones.
This phased rollout model allows \$C supply to expand in parallel with real usage, mitigates short-term speculation pressure, and reinforces sustainable participation in the DataFi economy.
## Launching on Base and BNB Chain
\$C will launch primarily on Base, with additional liquidity provided on BNB Smart Chain (BSC). This dual-chain approach enables the Chainbase ecosystem to:
* Leverage Base's performance, low fees, and strong developer ecosystem
* Provide access to broader liquidity and user base through BSC
* Cross-chain utility and trading
This approach ensures a smooth launch and positions Chainbase for long-term interoperability across Web3 ecosystems.
## Why \$C Matters
Data is no longer passive infrastructure. **It is capital**.
\$C turns raw data into an economic asset. It facilitates autonomous coordination, rewards real contributions, and enables an open, AI-ready data economy.
Chainbase provides the infrastructure. \$C brings it to life by making the infrastructure liquid, scalable, and usable to everyone.
## About Chainbase
Chainbase is building the Hyperdata Network for AI β a foundational layer for the DataFi era.
Built as a Hyperdata Network, Chainbase turns onchain signals into structured, verifiable, and AI-ready data that can be directly processed by AI models and decentralized applications. Its core stack includes:
* **Manuscript**: a programmable layer for building data assets
* **AVS layer**: decentralized data execution and verification
* **C Token**: the native currency for AGI
This structured data layer supports a new generation of crypto applications that are autonomous, composable, and economically aligned with their users and contributors.
### Key Achievements
To date, Chainbase has:
* Indexed over 200 blockchains
* Processed more than 500 billion data calls
* Supports a community of more than 35,000 developers
* Over 10,000 projects actively use Chainbase across a wide range of use cases, including MEV infrastructure, L2 explorers, agent protocols, and onchain analytics
### Team & Backing
The founding team brings deep experience in blockchain infrastructure, data engineering, and protocol security. Chainbase is backed by top-tier investors and works closely with ecosystems across modular infrastructure, large language models, and onchain AI.
As the need for machine-readable and economically aligned data continues to grow, Chainbase provides the foundational layer for a programmable data economyβone where information moves freely between agents, protocols, and people.
### Links
[Website](https://chainbase.com) | [Twitter](https://twitter.com/chainbase) | [Telegram](https://t.me/chainbase) | [Blog](https://blog.chainbase.com) | [Docs](https://docs.chainbase.com) | [Github](https://github.com/chainbase)
# Configuration
Source: https://docs.chainbase.com/network/node/configuration
## Coming soon
# Introduction
Source: https://docs.chainbase.com/network/node/introduction
As the Chainbase Network enters the testnet phase, network nodes will be open for participation
## What is a Chainbase Network Node?
A Chainbase Network node is an operator running the Chainbase Network node software and playing an active role in the network. The nodes in the Chainbase Network are divided into two roles: Operator and Validator.
### 1. Operator
Operators play a crucial role in the network by providing the necessary computational resources for the execution layer, ensuring the smooth operation of data processing tasks. The Operator Node constructs the Eigenlayer AVS. As the Chainbase Network testnet phase prepares to launch, we will open up participation for Operators, inviting interested users to join.
### 2. Validator
Validators play a key role in maintaining the security and consensus of the network. They are responsible for ensuring data integrity and maintaining network stability. The Validator Node is constructed based on the Cosmos SDK, using the CometBFT and DPoS consensus mechanisms. As the Chainbase Network testnet phase prepares to launch, we will open up participation for Validators, inviting interested users to join.
## How to Participate as a Chainbase Network Node?
If you are interested in becoming an Operator or Validator for the Chainbase Network, please contact the Chainbase Network team for more information and guidance. We look forward to your participation in advancing the Chainbase Network.
# Run a Chainbase AVS Operator
Source: https://docs.chainbase.com/network/node/operator
## Overview
This guide will walk you through the process of setting up and running a Chainbase AVS (Actively Validated Service) operator node.
## Requirements
Recommended Hardware Specifications
| Class | vCPUs (10th gen+) | Memory | Networking Capacity |
| ----------------------- | ----------------- | ------ | ------------------- |
| General Purpose - large | 2 | 8 GB | 5 Mbps |
| General Purpose - xl | 4 | 16 GB | 25 Mbps |
| General Purpose - 4xl | 16 | 64 GB | 5 Gbps |
Before you begin, ensure you have the following prerequisites installed:
β[Docker](https://docs.docker.com/get-docker/): Docker is a requirement for AVS operator node.
β[Docker Compose](https://docs.docker.com/compose/install/): Docker Compose is used alongside Docker for executing operator node.
β **Linux Environment**: Eigenlayerβs CLI only runs in a Linux environment.
β[Go](https://go.dev/doc/install): Two out of three installation routes require the use of Go. Itβs safer to go with Go than go without. π
## Installation Process
### Migration From Previous Version
If you've previously run a Chainbase AVS operator node:
1. You can delete old version `chainbase-avs-setup` directory on your server, but need to back up your encrypted **ECDSA** and **BLS** keys.
2. Skip the **EigenLayer Registration** step and only start from **Chainbase AVS Setup** step.
### EigenLayer Registration
Ensure you've registered with EigenLayer before proceeding. For guidance, refer to the [EigenLayer Operator Installation Guide](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation).
### Chainbase AVS Setup
1. Clone the Chainbase AVS setup repository:
```
git clone https://github.com/chainbase-labs/chainbase-avs-setup
```
run a Chainbase AVS operator node on mainnet (**invited and whitelisted**):
```
cd chainbase-avs-setup/mainnet
```
**OR** run a Chainbase AVS operator node on testnet (**no restrictions**):
```
cd chainbase-avs-setup/holesky
```
2. Set up the environment file:
```
cp .env.example .env
```
Configure all fields in the `.env` file with your specific information:
```
NODE_ECDSA_KEY_FILE_PATH=/your/ecdsa/key/path
NODE_BLS_KEY_FILE_PATH=/your/bls/key/path
OPERATOR_ECDSA_KEY_PASSWORD=yourECDSAKeyPassword
OPERATOR_BLS_KEY_PASSWORD=yourBlsKeyPassword
OPERATOR_ADDRESS=yourECDSAKeyAddress
NODE_SOCKET=yourNodeSocket
OPERATOR_NAME=yourOperatorName
```
Use the command `eigenlayer operator keys list` to retrieve information about your **ECDSA** and **BLS** key paths and operator address.
* **OPERATOR\_ADDRESS**: Set to your operator address (must match your ECDSA key address).
* **NODE\_SOCKET**: Set to your server's public IP address (format: `:8011`).
Important:
* Ensure your server's public IP is internet-accessible.
* Verify that port 8011 is open and properly configured in your firewall settings.
3. Set execution permissions for the script:
```shell theme={null}
chmod +x ./chainbase-avs.sh
```
## Operating the Chainbase AVS
### Register as an Operator
Run the following command to register as an operator:
```shell theme={null}
./chainbase-avs.sh register
```
### Run Node
Run the following command to startup node:
```shell theme={null}
./chainbase-avs.sh run
```
### Test Node
Run the following command to test node:
```shell theme={null}
./chainbase-avs.sh test
```
If you see the output `All systems are working for your manuscript node` in the command line output, it indicates that your node is running correctly.
### Update Node socket
If your server's public IP address is changed after you register as an operator, you need to update the node socket.
Configure `NODE_SOCKET` in `.env` file, then run the following command:
```shell theme={null}
./chainbase-avs.sh socket
```
### Update Node version
Run the following command to update node version:
```shell theme={null}
./chainbase-avs.sh stop
./chainbase-avs.sh update
./chainbase-avs.sh run
```
### Monitor Logs
View container logs using any of these commands:
```shell theme={null}
docker compose logs -f
docker compose logs -f
docker logs -f
```
### Dashboard
You can visit `:3010` on browser to view the dashboard to confirm the status of your node.If you are unable to access the page in your browser, please verify that port 3010 on your server is open and properly configured in firewall settings.
## Troubleshooting
If you encounter any issues during setup or operation, please contact our support team on [Discord](https://discord.com/channels/933995010158907422/1268125787546980403).
## Additional Resources
* [EigenLayer Documentation](https://docs.eigenlayer.xyz/)
# Join Testnet
Source: https://docs.chainbase.com/network/node/testnet
## Coming soon
# Run a Validator
Source: https://docs.chainbase.com/network/node/validator
## Coming soon
# Decentralized DORA Tuning
Source: https://docs.chainbase.com/network/theia/Developers/Glossary/D2ORA
### Abstract
$D^2ORA$ (Decentralized Weight-Decomposed Low-Rank Adaptation) extends the DoRA algorithm to a decentralized environment, enabling distributed training across multiple servers.
### $D^2ORA$ Algorithm
#### Step 1: Initialization
We first initialize the parameter matrices of Theia and the low-rank matrices.
* **Magnitude Vector Initialization**:
Initialize the magnitude vector $m$ using the column-wise norm of the pre-trained weight matrix $W_0$:
$$
m = ||W_0||_c
$$
* **Directional Matrix Initialization**:
Set the directional matrix $V$ to the pre-trained weight matrix $W_0$:
$$
V = W_0
$$
* **Low-Rank Matrices Initialization**:
Initialize the low-rank matrices $B$ and $A$ for the LoRA method.
#### Step 2: Decomposition
Decompose the pre-trained weight matrix $W_0$ into its magnitude and direction components. The pre-trained weight is directly derived from the NLP model.
* **Magnitude Decomposition**:
$$
m = ||W_0||_c
$$
* **Directional Decomposition**:
$$
V = W_0 / ||W_0||_c
$$
#### Step 3: Distributed Training
For each server in the decentralized network, perform the following:
* **Distribution**:
Distribute the initialized $m$, $V$, $B$, and $A$ to all servers.
* **Iterations**:
For each iteration $t$ from 1 to $T$:
* **Weight Update Calculation**:
Compute the weight update $\Delta W$ using the low-rank adaptation method:
$$
\Delta W = BA
$$
* **Magnitude Vector Update**:
Update the magnitude vector $m$:
$$
m = m - \eta \nabla_m L(m, V)
$$
* **Directional Matrix Update**:
Update the low-rank matrices $B$ and $A$ with gradient descent:
$$
B = B - \eta \nabla_B L(B, A)
$$
$$
A = A - \eta \nabla_A L(B, A)
$$
#### Step 4: Aggregation
After all iterations are completed, collect updates from all servers and aggregate them:
* **Magnitude Vector Aggregation**:
$$
m' = \text{aggregate}(m)
$$
* **Directional Matrix Aggregation**:
$$
V' = \text{aggregate}(V)
$$
* **Low-Rank Matrices Aggregation**:
$$
B' = \text{aggregate}(B)
$$
$$
A' = \text{aggregate}(A)
$$
#### Step 5: Merging
Merge the updated components to form the final weight matrix:
* **Final Weights Calculation**:
$$
W' = m' \frac{V'}{||V'||_c} + B'A'
$$
#### Step 6: Return Updated Weights
Return the updated weights $W'$ as the final output of the algorithm. We use it as the weight parameters of Theia.
### Summary
D^2ORA enhances the capabilities of DoRA by enabling decentralized training across multiple servers. This approach leverages blockchain technology to ensure trustworthiness, making it suitable for training AI models in a distributed and secure environment.
# Generate to Defend (G2D)
Source: https://docs.chainbase.com/network/theia/Developers/Glossary/G2D
## Necessity
For any AI models, adversarial attacks occur because attackers exploit vulnerabilities in the model's parameters by crafting inputs that cause the model to make incorrect predictions. These attacks are particularly effective when the model parameters remain static, allowing attackers ample time to probe and understand the model's weaknesses. The necessity of the Generate to Defend (G2D) algorithm arises from the need to counteract these attacks by periodically regenerating model parameters, thereby preventing attackers from gaining prolonged access to a consistent set of parameters. By continually altering the model parameters while maintaining performance, G2D disrupts the attackers' ability to reliably exploit the model, thus enhancing its robustness against adversarial threats, similar to frequently changing passwords to increase security.
### Generate to Defend (G2D) Algorithm
The G2D algorithm periodically generates new model parameters to prevent adversarial attacks by ensuring that the model parameters are not exposed for extended periods. The key idea is to tailor a diffusion model to create new parameters that maintain the model's performance while being sufficiently different from the original parameters. This is achieved by adding a regularizer to the diffusion process that maximizes the L1 distance between the generated parameters and the original parameters.
**1. Preliminaries of Diffusion Models:**
Diffusion models consist of forward and reverse processes indexed by timesteps. We summarize these processes below:
**Forward Process:**
Given a sample $x_0 \sim q(x)$, Gaussian noise is progressively added for $T$ steps to obtain $x_1, x_2, \ldots, x_T$. This process is described by:
$$
q(x_t | x_{t-1}) = \mathcal{N}(x_t; \sqrt{1 - \beta_t} x_{t-1}, \beta_t I)
$$
**Reverse Process:**
The reverse process aims to train a denoising network to remove the noise from $x_t$, moving backward from $x_T$ to $x_0$:
$$
p_\theta(x_{t-1} | x_t) = \mathcal{N}(x_{t-1}; \mu_\theta(x_t, t), \Sigma_\theta(x_t, t))
$$
The denoising network is optimized using the negative log-likelihood:
$$
L_{dm} = \text{KL}(q(x_{t-1} | x_t, x_0) \parallel p_\theta(x_{t-1} | x_t))
$$
**2. Embedding Model into Compact Space:**
To prepare the data, we train an autoencoder to extract latent representations of the model parameters. The encoding and decoding processes are formulated as:
$$
Z = f_{\text{encoder}}(V + \xi_V, \sigma)
V' = f_{\text{decoder}}(Z + \xi_Z, \rho)
$$
where $V$ is the set of model parameters, $Z$ is the latent representation, $\xi_V$ and $\xi_Z$ are added Gaussian noise, and $\sigma$ and $\rho$ are parameters of the encoder and decoder, respectively. The autoencoder is trained by minimizing the mean square error (MSE) loss:
$$
L_{MSE} = \frac{1}{K} \sum_{k=1}^K \| v_k - v'_k \|^2
$$
**3. Training Diffusion Models with Regularizer:**
We modify the diffusion process to include a regularizer that maximizes the L1 distance between the generated parameters and the original parameters. The training objective for the diffusion model with the additional regularizer is given by:
$$
\theta \leftarrow \theta - \nabla_\theta \left( \| \epsilon - \epsilon_\theta (\sqrt{\bar{\alpha}_t} z_k^0 + \sqrt{1 - \bar{\alpha}_t} \epsilon, t) \|^2 + \lambda \| \theta_{\text{gen}} - \theta_{\text{orig}} \|_1 \right)
$$
where $\lambda$ is a hyperparameter that controls the importance of the regularizer, $\theta_{\text{gen}}$ are the generated parameters, and $\theta_{\text{orig}}$ are the original parameters.
**4. Model Generation:**
During inference, random noise is fed into the trained diffusion model and decoder to generate new sets of model parameters:
$$
\theta_{\text{gen}} = f_{\text{decoder}}( \text{ReverseProcess}(\text{Random Noise}))
$$
These generated parameters are then used to replace the existing model parameters, ensuring the model's resilience against adversarial attacks by frequently updating its parameters. This modified diffusion process ensures that the new parameters are significantly different from the original ones, thereby enhancing the model's defense against adversarial attacks while maintaining its performance.
After the model is trained, the Step 4 is executed periodically to randomize AI model parameters, so that the cost of attack is significantly increased. The more frequent we generate, the safer our AI model become. To generate a new parameter, only a diffusion process is inferenced in a cost-effective manner.
# Open APIs
Source: https://docs.chainbase.com/network/theia/Developers/Open-APIs
*This model is currently in its early stages and is not yet open to the public. If you want to experience it, please [click here](https://chainbase.com/contact) to apply and contact us.*
# FAQs
Source: https://docs.chainbase.com/network/theia/Resources/FAQs
## Coming soon
# Roadmap
Source: https://docs.chainbase.com/network/theia/Resources/Roadmap
Theia is the next-generation crypto world model that provides foundation knowledge and AI capability for the web3 era. To achieve this goal, the roadmap details the path to more intelligent, secure and transparent Theia model.
## Phase 1: Theia Demo Online
π
June 20, 2024, 12:25:00 PM +UTC
To let every crypto participator touch the crypto intelligence of Theia, we first open the interactive demo for Theia. It connects users with crypto knowledge in an exciting way - talk to Theia and get what you want.
## Phase 2: Theia Agent Ecosystem
π
August 1, 2024, 12:25:00 PM +UTC
**1. Knowledge Construction and Theia Expert Model (Agent)**
We will create and expand the "Crypto Patterns" (i.e., expert and AI knowledge database) with community contributions and provide an interface to build Theia Agent Expert and any users can upload their own prompts (expert experiences) through this interface. Once reviewed by us, the agent can run on our model and interact with the Chainbase Network.
**2. Marketplace**
Open the marketplace for the agents built in Phase Two, allowing any Chainbase user to select specific agents from the marketplace to serve specific goals.
## Phase 3: Continuous Model Tuning and Patterns Accumulation
To continuously increase the Theia intelligence, we will fine-tune our model periodically, and encourage the community to enrich the "crypto patterns".
# Thesis
Source: https://docs.chainbase.com/network/theia/Resources/Whitepaper
## Coming soon
# How to Create Task Models
Source: https://docs.chainbase.com/network/theia/TheiaChat/create-task-models
## Methodology
Theia Task Models is constructed using prompt and data engineering. We introduce these novel concepts including prompt engineering, RAG, and model self-tuning, which is used to build Theia Task Models.
### 1. Prompt Engineering
Prompt engineering refers to a series of instruction for Theia. It can trigger Theia to wake up specific capability in some field and work as a task model as instructed. The instruction should be clear and the output format can be defined. To build a good task model, we normally tell Theia three important messages: role, hint for reasoning and generation, and goal.
For example, to build a crypto investment advisor, we can write the prompt including the three messages:
* **Role:** Theia, you are an investment advisor.
* **Hint:** Whenever I provide you a whitepaper of a project, please analyze the whitepaper and search the news of this project.
* **Goal:** Then generate an investment advisory report.
Thus, the complete prompt is "Theia, you are an investment advisor. Whenever I provide you a whitepaper of a project, please analyze the whitepaper and news of this project. Then generate an investment advisory report."
### 2. Retrieval-Augmented Generation (RAG)
RAG is a method to integrates retrieval-based models with AI models, utilizing the intelligence of AI to analyze data and generate results according to specific objectives. It mainly consists of three steps:
* **Data Retrieval:** Retrieve relevant information from external datasets, e.g., the price variation of BTC in the past 3 months.
* **Task Objective:** Define the objective of RAG by prompt engineering, e.g., "find the buying and selling signals according to the MACD".
* **Augmented Generation:** Input the retrieved data into the Theia Task Model to get the augmented results.
Note that the data quality is one of the keys that decides the success of RAG. However, to obtain high-quality on-chain data, developers usually spent lots of time on extracting and aggregating data from blockchain. In Theia ecosystem, we are supported by Chainbase omnichain datanetwork, therefore providing massive high-quality data for users to build Theia task model in a cost-ffective and efficient fashion.
### 3. Model Self-Tuning
Though prompt engineering and RAG can utilize the capabilities of Theia, the intelligence of Theia is actually not improved in the parameter level, e.g., the intrinsic IQ of Theia. To really increase the IQ of Theia for higher-level task, model self-tuning is proposed. As our community uses Theia and its task models, many dialogues data are generated. They are the new "courses and books" Theia needs to read and learn. Furthermore, the developers are encouraged to upload manually labelled data that is also valuable to increase the Theia intelligence. The more data Theia sees, the higher intelligence it has.
The model self-tuning is based on the **Decentralized Weight-Decomposed Low-Rank Adaptation ($D^2ORA$)** algorithm that fine-tunes Theia periodically. The $D^2ORA$ algorithm focuses on updating the crypto-specific parameter matrix, ensuring that Theia Task Models continually enhance their expertise in the crypto domain as more and more users build task models upon Theia.
## How to create Theia Task Models in Theia?
Coming soon (Phase 3)
# Overview
Source: https://docs.chainbase.com/network/theia/TheiaChat/overview
TheiaChat is an AI agent built by Chainabse Labs based on Theia, the first crypto world model. TheiaChat provides an interface through which non-expert users can interact with the Chainbase Network, opening up the ability to obtain on-chain data intelligence to everyone for the first time.
Users can enhance the Chainabse Network when interacting with TheiaChat and benefit from it. This mainly involves two types of users:
1. **Non-Expert Users:** people without blockchain knowledge and skills, such as blockchain beginners. They can enhance the Chainbase Network by having conversations with TheiaChat and providing feedback on the results of the conversations, and the network rewards serious and honest users.
2. **Expert Users:** People with blockchain knowledge and skills, such as professional traders and security experts. They can enhance the Chainbase Network by building Theia Task Models in TheiaChat, and the network will reward Task Model builders with high adoption.
Chainbase Labs built the **Theia Security Model (TSM)** as an example to show the ability to build a Task Model based on the crypto world model Theia in TheiaChat. It is a security expert to offer advice in the crypto world, e.g., how to protect my wallet and money. It is constructed by training Theia with security books and community advice.
## How do interactions with TheiaChat enhance the Chainbase Network?
Every user interaction with TheiaChat and every task model built are enhancements to the under hood chainbase network. The basic logic is that these actions will directly trigger **Change Data Captures (CDCs, aka Changelog)**, and these contents are permanently stored on Arweave.
These are powerful complement to the Chainbase Network. It is also the first time that users can contribute data to enhance the Chainbase Network. Before this, only developers could enhance the network by building Manuscripts in the network. **This is the historical transformation of Chainbase Network from targeting 300,000 developers to targeting 30 million to 300 million users.**
In addition, every Changelog is a transaction on the Chainbase Network, which is permanently recorded on the Chainbase Network, and is public, censorship-resistant and cannot be manipulated. Its traceability guarantees the data income rights of every data producer.
# Task Models
Source: https://docs.chainbase.com/network/theia/TheiaChat/task-models
To trigger the versatile capabilities of Theia in the crypto world, we propose Theia Task Model built upon Theia model. Theia Task Model is designed to serve various needs within the crypto world, and is open to developer community that maximizes its value. Briefly speaking, developers can leverage prompt engineering, Retrieval-Augmented Generation (RAG) and real-time on-chain data, to provide specialized functions such as trading Task Model, security Task Model, and public opinion monitoring Task Model. Moreover, integrated with Chainbase hyperdata network, Theia Task Models are capable of interpreting these complex data and offering actionable insights, making them invaluable tools for users navigating the crypto ecosystem.
## Potential Applications of Theia Task Model
### 1. Theia Security Task Model
Theia Security Task Model could be focused on enhancing the security of wallets, projects, and overall blockchain infrastructure. Possible capabilities include:
* **Vulnerability Assessment:** Conduct thorough security assessments of wallets and blockchain projects, identifying potential vulnerabilities and recommending mitigation strategies.
* **Real-Time Threat Monitoring:** Utilize real-time data to detect and respond to security threats, ensuring timely intervention and protection against attacks.
* **Compliance and Audits:** Assist in ensuring compliance with security standards and conducting regular security audits to maintain robust security postures.
### 2. Theia Trading Task Model
Theia Trading Task Model could be developed to assist users in creating and optimizing trading strategies. Potential features include:
* **Market Trend Analysis:** Monitor and analyze market movements, historical data, and emerging trends to provide actionable insights.
* **Strategy Optimization:** Suggest and optimize trading strategies based on the latest data and patterns, improving decision-making and potential returns.
* **Risk Management:** Evaluate and manage trading risks by assessing market volatility and other risk factors, offering tailored advice to mitigate potential losses.
### 3. Theia Opinion Task Model
Theia Opinion Task Model could specialize in monitoring and analyzing public opinions across social networks and other platforms. Key functionalities might include:
* **Sentiment Analysis:** Track and analyze sentiment around specific topics, projects, or cryptocurrencies, providing valuable insights into public perception.
* **Trend Detection:** Identify emerging trends and shifts in public opinion, helping users stay ahead of market sentiment and community dynamics.
* **Influence Measurement:** Evaluate the impact of key influencers and events on public opinion, offering insights into how these factors shape market and community behavior.
## Summary
Theia Task Model is a powerful and adaptable system designed to meet the diverse needs of the crypto world. By leveraging advanced technologies like RAG and real-time on-chain data, Theia Task Models provide users with actionable insights and specialized functions. Potential applications such as trading strategy development, security analysis, and public opinion monitoring illustrate the wide-ranging capabilities of Theia Task Model, making it an invaluable partner in navigating the complex and rapidly evolving crypto ecosystem.
# Features
Source: https://docs.chainbase.com/network/theia/World_model/features
In Web3, Theia excels with its native high performance, robust security measures, and transparent reasoning, making it a next-generation Crypto World Model tailored for the Web3 community.
#### 1. Crypto Native with High Performance
Theia is a native World Model for the crypto ecosystem, trained using the on-chain data from Chainbase hyperdata network and off-chain data from the Internet. It leverages a unique **Decentralized Weight-Decomposed Low-Rank Adaptation ($D^2ORA$) algorithm**, which allows for training a specialized crypto parameter matrix without modifying the parameters of the base natural language processing (NLP) model. By combining these parameters, Theia integrates the robust natural language capabilities of large language models (LLMs) with expert-level knowledge of both on-chain and off-chain crypto data. This results in superior Web3 attributes and performance compared to models like ChatGPT.
#### 2. Security
To enhance security, Theia employs generative AI to periodically update its digital persona. AI models are susceptible to attacks where adversaries can exploit model parameters to induce errors or generate targeted results. This vulnerability arises from the ability to reverse-engineer gradients from the model's parameters. Theia addresses this issue with an innovative **Generate to Defend (G2D)** algorithm, which uses generative diffusion models to capture and randomize the parameter space. This approach periodically refreshes Theia's parameters, preventing exhaustive attacks and model leaks with minimal cost.
#### 3. Transparency
Theia is built to be transparent through the extensive learning and summarization of crypto patterns from both on-chain and off-chain data. These patterns represent explicit rules inherent in the Web3 world. When users interact with Theia, they can transparently observe its reasoning process, ensuring reliability. Additionally, users have the ability to manually modify or add new patterns, allowing them to contribute their own crypto insights and perspectives, further enhancing Theia's intelligence.
$D^2ORA$ extends the DoRA algorithm to a decentralized environment, enabling distributed training across multiple servers.
G2D disrupts the attackers' ability to reliably exploit the model, thus enhancing its robustness against adversarial threats
# Theia
Source: https://docs.chainbase.com/network/theia/World_model/theia
We have developed a foundational **Crypto World Model (Theia)** on the Chainbase hyperdata network. Theia aims to transform vast amounts of on-chain dark knowledge into comprehensive intelligence for humans in a trustworthy manner. This is accomplished by distilling knowledge from both language models and the Chainbase hyperdata network through model training.
## How do we build Theia?
We propose a model tuning algorithm for Theia, **Decentralized Weight-Decomposed Low-Rank Adaptation ($D^2ORA$)** technique by revamping the [$DORA$ by NVIDIA](https://research.nvidia.com/publication/2024-07_dora-weight-decomposed-low-rank-adaptation), which decomposes a large language model into magnitude and direction components in a trustworthy manner. By feeding the model with on-chain data, we derive the crypto magnitude vector ($M_c$) and the directional matrix ($D_c$). The product of these components represents a crypto-oriented parameter matrix that encapsulates the extensive knowledge within the crypto space. The decentralized training approach ensures data security, model robustness, and result transparency. Consequently, the crypto knowledge is condensed into the crypto-oriented matrix, independent of the large language model (LLM), allowing it to be enhanced with future data or on-chain activities, thus evolving into an all-in-one expert in crypto.
## Capabilities of Theia
Unlike existing crypto AI projects, Theia offers a complete reasoning chain for question answering, providing transparent and trustworthy results. It learns crypto patterns from extensive on-chain and off-chain data and spatial-temporal activities, and its responses are based on causal reasoning with these crypto patterns. Ultimately, Theia consists of a powerful LLM parameter matrix operating with the crypto-oriented parameter matrix and crypto patterns. To ensure up-to-date intelligence with reliable arguments, we integrate Theia with the real-time hyperdata network and an Internet AI reader via Retrieval-Augmented Generation (RAG). Leveraging Theia's intelligence, users can also build task-specific AI models on top of it.
## Summary
Theia represents the next generation of Crypto World Models, derived from model training using the novel $D^2ORA$ algorithm and crypto patterns identified by machine intelligence. It offers transparent and trustworthy knowledge to the web3 community, illuminating the hidden knowledge within the crypto world.
# Welcome
Source: https://docs.chainbase.com/network/theia/World_model/welcome
Chainbase is building an crypto world model, Theia, which is designed to learn blockchain data and realize simulation and reasoning of the native blockchain environment. Agents built based on it can effectively understand, predict and interact with the blockchain.
Chainbase assembled a team led by a professor in the field of AI to build the model to support native crypto applications, including AI crypto games, DeFi, security, social, asset management, and more.
## What is Crypto World Model?
The crypto world is built on massive and rapidly growing blockchain data, which contains an abundance of knowledge and underlying opportunities. Chainbase continually extracts, records, and organizes this data, summarizing it for downstream users. However, a significant and persistent challenge is that the vast "dark knowledge" within crypto data cannot be effectively organized solely through traditional databases and limited human effort. Accessing and interpreting this knowledge easily and conveniently remains a challenge for crypto participants.
# CLI
Source: https://docs.chainbase.com/resources/ai/cli
Command-line interface for querying Web3 data, designed for both developers and AI agents
## Overview
The **Chainbase CLI** is a command-line tool for accessing [Chainbase Web3 API](/api-reference/overview) data directly from your terminal. It outputs JSON by default, making it ideal for scripting, automation, and AI agent integration.
* Query tokens, balances, transactions, and more across 8+ EVM chains
* JSON output by default for machine-parseable results
* Async SQL queries against Chainbase's on-chain data warehouse
* Smart contract read calls without writing code
## Installation
```bash theme={null}
# Global install
npm install -g chainbase-cli
# Or run directly with npx (no install needed)
npx chainbase-cli --help
```
Requires Node.js >= 18.
## Configuration
### Set API Key
Get your API key from the [Chainbase Console](https://console.chainbase.com/), then configure:
```bash theme={null}
# Option 1: Save to config file (~/.chainbase/config.json)
chainbase config set api-key YOUR_API_KEY
# Option 2: Use environment variable
export CHAINBASE_API_KEY=YOUR_API_KEY
```
### Set Default Chain
```bash theme={null}
# Set default chain to Ethereum (default)
chainbase config set default-chain 1
# View current config
chainbase config list
```
### Supported Chains
Supports all EVM-compatible chains available on Chainbase. See the full list at [Supported Networks](/resources/platform/supported-networks/supported-networks).
## Global Options
Every command supports these options:
| Option | Description | Default |
| -------------- | --------------------------------- | ----------------------------- |
| `--chain ` | Chain ID to query | `1` (or your `default-chain`) |
| `--pretty` | Human-readable formatted output | `false` |
| `--page ` | Page number for paginated results | `1` |
| `--limit ` | Results per page | `20` |
## Commands
### `block` β Block Queries
```bash theme={null}
# Get latest block number
chainbase block latest
# Get block details
chainbase block detail 17000000
```
### `tx` β Transaction Queries
```bash theme={null}
# Get transaction by hash
chainbase tx detail 0x...
# List transactions for an address
chainbase tx list 0x... --from-block 17000000 --to-block 17001000
```
### `token` β Token Queries
```bash theme={null}
# Get token metadata
chainbase token metadata 0xdAC17F958D2ee523a2206206994597C13D831ec7
# Get current price
chainbase token price 0xdAC17F958D2ee523a2206206994597C13D831ec7
# Get price history
chainbase token price-history 0xdAC17F958D2ee523a2206206994597C13D831ec7 \
--from 1700000000 --to 1700086400
# Get top holders
chainbase token top-holders 0xdAC17F958D2ee523a2206206994597C13D831ec7
# Get token transfers
chainbase token transfers --contract 0x... --from-block 17000000
```
### `balance` β Balance & Portfolio
```bash theme={null}
# Native token balance (ETH, BNB, etc.)
chainbase balance native 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# ERC-20 token balances
chainbase balance tokens 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
```
### `domain` β ENS & Space ID
```bash theme={null}
# Get ENS domains held by address
chainbase domain ens 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# Resolve ENS domain to address
chainbase domain ens-resolve vitalik.eth
# Reverse resolve address to ENS
chainbase domain ens-reverse 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# Space ID (BSC) resolution
chainbase domain spaceid-resolve example.bnb
chainbase domain spaceid-reverse 0x...
```
### `address` β Address Labels
```bash theme={null}
# Get labels for an address (exchange, whale, contract, etc.)
chainbase address labels 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
```
### `contract` β Smart Contract Calls
```bash theme={null}
# Call a contract read function
chainbase contract call \
--address 0xdAC17F958D2ee523a2206206994597C13D831ec7 \
--function "balanceOf" \
--abi '[{"inputs":[{"name":"account","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"}]' \
--params '["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"]'
```
### `sql` β SQL Queries
Execute SQL queries against Chainbase's on-chain data warehouse. Queries run asynchronously β submit, check status, then retrieve results.
```bash theme={null}
# Execute a query
chainbase sql execute "SELECT * FROM ethereum.blocks LIMIT 5"
# Check execution status
chainbase sql status
# Get results
chainbase sql results
```
### `tops` β Crypto Social Intelligence
Query crypto social signals from [Tops](https://tops.chainbase.com). **No API key required.** Free to use.
**Rate limits:** 10 req/s Β· 60 req/min Β· 600 req/hour (per client IP)
```bash theme={null}
# List trending crypto topics (default: English)
chainbase tops trending
chainbase tops trending --language zh # Chinese
chainbase tops trending --language ko # Korean
# Get structured details for a topic
chainbase tops topic
# Get Twitter/X posts under a topic
chainbase tops posts
# Search narrative candidate topics by keyword
chainbase tops search "RWA"
chainbase tops search "AI Agent"
# Search recent Twitter/X mentions
chainbase tops mentions "Ethereum ETF"
```
| Subcommand | Description |
| ------------------------------ | --------------------------------------------------------------------- |
| `trending [--language ]` | List trending crypto narratives ranked by heat score (`zh`/`en`/`ko`) |
| `topic ` | Structured details (summary, score, representative posts) for a topic |
| `posts ` | Raw Twitter/X posts under a topic |
| `search ` | Find narrative candidate topics by keyword |
| `mentions ` | Search recent Twitter/X mentions for a keyword |
The `topic_id` values come from `trending` or `search` results. Use `--json` to get machine-parseable output when piping into other tools.
## AI Agent Integration
The CLI is designed for AI agent automation with predictable, machine-parseable output:
* **JSON by default** β no colors or formatting unless `--pretty` is used
* **Consistent error format** β errors output as `{"error":"message"}` to stderr
* **Discoverable** β run `--help` on any command for usage info
* **Predictable pattern** β `chainbase [args] [options]`
```bash theme={null}
# Parse output with jq
PRICE=$(chainbase token price 0xdAC17F958D2ee523a2206206994597C13D831ec7 | jq '.data.price')
# Use in scripts
if chainbase balance native 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 2>/dev/null; then
echo "Query succeeded"
fi
```
## Learn More
* [Chainbase API Reference](/api-reference/overview) β Full API documentation
* [Supported Networks](/resources/platform/supported-networks/supported-networks) β Complete list of supported chains
* [GitHub Repository](https://github.com/chainbase-labs/cli) β Source code and contributions
* [npm Package](https://www.npmjs.com/package/chainbase-cli) β Package details and versions
# Web3 Data MCP
Source: https://docs.chainbase.com/resources/ai/mcp
Connect Chainbase Web3 data to any MCP-compatible AI client
## What is MCP?
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard that enables AI applications to connect with external data sources and tools through a unified interface. It provides a standardized way for LLMs to access real-time data, execute actions, and interact with APIs β without custom integrations for each client.
## Chainbase MCP Server
The Chainbase MCP Server allows any MCP-compatible AI client (such as Claude Desktop, Cursor, Windsurf, and others) to directly access Chainbase's Web3 data β enabling queries like token balances, NFT ownership, transaction history, and on-chain analytics through natural language.
## Capabilities
* **Token Data** β Query token prices, holders, metadata, and transfers
* **Wallet Analytics** β Check balances, transaction history, and portfolio analysis
* **NFT Exploration** β Browse collections, ownership, rarity, and transfer history
* **Block/Tx Detail** β Get block details, and transaction information
Base Endpoint:
```
https://api.chainbase.com/v1/mcp
```
Authentication:
```
X-API-KEY:
```
## Transport
Chainbase MCP uses standard HTTP transport.
* Method: `POST`
* Content-Type: `application/json`
* Auth Header: `X-API-KEY`
Example raw request:
```bash theme={null}
curl https://api.chainbase.com/v1/mcp \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{ "jsonrpc":"2.0", "id":1, "method":"tools/list" }'
```
## Manual Setup
```bash theme={null}
claude mcp add --transport http chainbase https://api.chainbase.com/v1/mcp --header "X-API-KEY: your-actual-api-key"
```
edit Claude Desktop config file:
```bash theme={null}
# On MacOS:
vim ~/Library/Application Support/Claude/claude_desktop_config.json
# On Windows:
notepad "%APPDATA%\Claude\claude_desktop_config.json"
# On Linux:
vim ~/.config/Claude/claude_desktop_config.json
```
add the MCP server configuration:
```json theme={null}
{
"mcpServers": {
"chainbase": {
"command": "npx",
"args": [
"mcp-remote",
"https://api.chainbase.com/v1/mcp",
"--header",
"X-API-KEY:${API_KEY}",
"--transport",
"http-only"
],
"env": {
"API_KEY": "your-actual-api-key"
}
}
}
}
```
add MCP server information to \~/.codex/config.toml:
```toml theme={null}
[mcp_servers.chainbase]
url = "https://api.chainbase.com/v1/mcp"
http_headers = { "X-API-KEY" = "" }
```
Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
```bash theme={null}
{
"mcpServers": {
"chainbase": {
"url": "https://api.chainbase.com/v1/mcp",
"headers": {
"X-API-KEY": "your-actual-api-key"
}
}
}
}
```
Configure your MCP client to connect to `https://api.chainbase.com/v1/mcp` and include your API key in the X-API-KEY request header.
Most MCP clients support HTTP transport with custom headers. Ensure the base URL is set to the endpoint above and add: `X-API-KEY: `
Refer to your specific MCP client documentation for instructions on configuring HTTP transport and custom headers.
Donβt have an API key?
Go to console.chainbase.com to create an account and a new API key.
For demo purposes, you can use the key βdemoβ to test out the API.
## Explorer Tools
| Tool | Description |
| ------------------ | ----------------------------------------------------------------------- |
| GetLastBlockNumber | get the latest block number |
| GetBlock | get block details by number |
| GetTx | get transaction details by hash or block number and index |
| GetAccountBalance | get account native balance or contract token balance |
| GetAccountNFTs | get account nfts |
| GetAccountTokens | get account token balances |
| GetAccountTxs | get account transactions |
| GetTokenHolders | get token holders addresses |
| GetTokenMeta | get token metadata |
| GetTokenPrice | get token price |
| GetTokenTopHolders | get token top holders addresses, returns original balance and usd value |
| GetTokenTransfers | get token transfers |
| GetNFTMeta | get nft metadata |
| GetNFTOwner | get nft owner by contract and token id |
| GetNFTOwnerHistory | get nft owner histories by contract and token id |
| GetNFTOwners | list nft owners by contract address |
| GetNFTTransfers | get nft transfers |
## Stay Updated
* Follow [Chainbase on X](https://twitter.com/chainbaseHQ) for release announcements
* Join the [Chainbase Discord](https://chainbase.com/discord) community
* Star the [GitHub repo](https://github.com/chainbase-labs) to get notified
# Tops Data MCP
Source: https://docs.chainbase.com/resources/ai/mcp-tops
Connect Tops crypto social data to any MCP-compatible AI client
## Overview
The Tops Data MCP Server exposes Chainbase's [Tops](https://tops.chainbase.com) social signal data
as standardized MCP Tools, making it accessible to any MCP-compatible AI client β
Claude Desktop, Cursor, Windsurf, and others.
Unlike the Chainbase Web3 MCP Server (which covers on-chain data), Tops Data MCP focuses
exclusively on **crypto social intelligence**: trending narratives, topic discovery, and
Twitter/X social mentions. No API key required β it's free to use.
## Endpoint
```
https://api.chainbase.com/tops/v1/mcp
```
**Authentication:** None required. Free to call.
## Transport
Tops Data MCP uses standard HTTP transport.
* **Content-Type:** `application/json`
* **Method:** `POST`
Example raw request:
```
curl https://api.chainbase.com/tops/v1/mcp \
-H "Content-Type: application/json" \
-d '{ "jsonrpc":"2.0", "id":1, "method":"tools/list" }'
```
## Setup
### Claude Code
```
claude mcp add --transport http tops https://api.chainbase.com/tops/v1/mcp
```
### Claude Desktop
Settings β Connectors β Add custom connector
Then enter the name: `Chainbase Tops Data` and Endpoint: `https://api.chainbase.com/tops/v1/mcp`
### Cursor
Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
```
{
"mcpServers": {
"tops": {
"url": "https://api.chainbase.com/tops/v1/mcp"
}
}
}
```
### Other Clients
Configure your MCP client to connect to `https://api.chainbase.com/tops/v1/mcp`.
No authentication header is needed.
## Available Tools
| Tool | Description |
| ----------------------------- | ------------------------------------------------------------------------------------------- |
| `list_trending_topics` | Returns a ranked list of currently trending crypto narratives/topics with heat scores |
| `get_topic` | Fetches structured details (description, keywords, representative posts) for a single topic |
| `get_topic_posts` | Returns raw posts under a topic for sentiment analysis and timeline building |
| `search_narrative_candidates` | Reverse-maps a keyword to candidate topics in the Tops taxonomy |
| `search_mentions` | Searches recent Twitter/X posts mentioning a keyword |
For command-line usage and detailed parameter documentation, see the
[CLI Reference](/resources/ai/cli#tops--crypto-social-intelligence) and [Web3 Data Skill](/resources/ai/web3-data-skill).
## Rate Limits
| Window | Limit |
| ---------- | ------------ |
| Per second | 10 requests |
| Per minute | 60 requests |
| Per hour | 600 requests |
## Usage Examples
Once connected, use natural language in your AI client:
What are the top trending crypto narratives right now?
Find all topics related to "AI Agent" and summarize the key themes.
Show me what people on Twitter are saying about Chainbase.
Which narratives have been heating up over the past week?
## Difference from Chainbase Web3 MCP
| | Tops Data MCP | Chainbase Web3 MCP |
| ------------- | --------------------------------------------- | ----------------------------------------------- |
| Data source | Twitter/X social signals | On-chain blockchain data |
| Auth required | None (free) | API key (`X-API-KEY`) |
| Endpoint | `https://api.chainbase.com/tops/v1/mcp` | `https://api.chainbase.com/v1/mcp` |
| Best for | Narrative discovery, sentiment, social trends | Token data, wallet analysis, NFTs, transactions |
## Stay Updated
* Follow [Chainbase on X](https://twitter.com/chainbaseHQ) for release announcements
* Join the [Chainbase Discord](https://chainbase.com/discord) community
* Star the [GitHub repo](https://github.com/chainbase-labs) to get notified
# Overview
Source: https://docs.chainbase.com/resources/ai/overview
Empower AI Agents with real-time Web3 data and crypto social intelligence
Chainbase AI provides a suite of tools and protocols that enable AI Agents to seamlessly access, query, and pay for on-chain data and crypto social signals. Whether you're building autonomous agents, integrating LLMs with blockchain data, or creating AI-powered Web3 applications, Chainbase AI has you covered.
## Why Chainbase AI?
* **Real-time On-chain Data**: Access data from 90+ blockchains through a unified interface
* **Crypto Social Intelligence**: Discover trending narratives, monitor Twitter/X mentions, and track KOL signals via [Tops](https://tops.chainbase.com) β free, no API key required
* **AI-native Protocols**: Built-in support for machine-to-machine payment (x402) and agent skill frameworks
* **Developer Friendly**: Simple integrations for popular AI frameworks and tools
## Get Started
Enable AI Agents to autonomously pay for API calls using stablecoins via the HTTP 402 standard.
A Claude Code skill for on-chain data and crypto social intelligence via natural language.
Command-line interface for Web3 data and Tops social queries, designed for developers and AI agents.
Connect Chainbase on-chain data to any MCP-compatible AI client.
Connect Tops crypto social intelligence to any MCP-compatible AI client. Free, no API key needed.
# Web3 Data Skill
Source: https://docs.chainbase.com/resources/ai/web3-data-skill
Query on-chain data and crypto social intelligence using natural language in Claude Code
## Overview
The **Web3 Data Skill** is a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) skill that covers two Chainbase services:
* **On-chain data** β query token holders, wallet balances, NFT ownership, ENS domains, address labels, transactions, and more across multiple EVM chains via the Chainbase API.
* **Crypto social intelligence** β discover trending crypto narratives, search topics, retrieve Twitter/X mentions, and monitor social signals via [Tops](https://tops.chainbase.com). No API key required.
## Installation
Install the skill via [skills.sh](https://skills.sh):
```bash theme={null}
npx skills add https://github.com/lxcong/web3-data-skill --skill web3-data
```
Or install via [ClawHub](https://clawhub.ai):
```bash theme={null}
npm i -g clawhub
clawhub install lxcong/web3-data
```
You can also clone the repository and install manually:
```bash theme={null}
git clone https://github.com/lxcong/web3-data-skill.git
cd web3-data-skill
claude skill install ./skills.sh
```
## Configuration
Set your Chainbase API key as an environment variable (required for on-chain data):
```bash theme={null}
export CHAINBASE_API_KEY="your_api_key_here"
```
You can obtain an API key from the [Chainbase Console](https://console.chainbase.com/).
The Tops social intelligence commands do not require an API key and are free to use.
## On-Chain Data Queries
| Category | Examples |
| -------------------- | ------------------------------------------------------------------------ |
| **Token Analysis** | Top holders, token price, price history, token metadata, token transfers |
| **Wallet & Balance** | ERC-20 balances, native token balances, NFTs owned by address |
| **NFT** | NFT metadata, collection owners, rarity scores, transfer history |
| **Address Labels** | Exchange, contract, whale, and other address tags |
| **ENS Domains** | Resolve domains, reverse resolve, list domains by address |
| **Transactions** | Transaction details, account transaction history |
Supports all EVM-compatible chains available on Chainbase. See [Supported Networks](/resources/platform/supported-networks/supported-networks).
## Crypto Social Intelligence (Tops)
| Category | Examples |
| -------------------- | ---------------------------------------------------------------- |
| **Trending Topics** | What's trending in crypto right now, ranked by heat score |
| **Topic Details** | Summary, authors, representative tweets for a specific narrative |
| **Topic Posts** | Raw Twitter/X posts under a topic for sentiment analysis |
| **Narrative Search** | Find candidate topics by keyword (e.g. "RWA", "AI Agent") |
| **Mention Search** | Recent Twitter/X mentions for any project or keyword |
## Usage Examples
Once installed, use natural language in Claude Code:
```
# On-chain data
> /web3-data top 10 holders of USDT on Ethereum
> /web3-data what is the price of ETH?
> /web3-data show NFTs owned by vitalik.eth
> /web3-data label the address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
# Crypto social intelligence
> /web3-data what are the top trending crypto narratives right now?
> /web3-data find topics related to "AI Agent" and summarize the key themes
> /web3-data show me what people on Twitter are saying about Chainbase
> /web3-data search narrative candidates for "Restaking"
```
## Learn More
* [Chainbase API Reference](/api-reference/overview) β Full API documentation
* [Supported Networks](/resources/platform/supported-networks/supported-networks) β Complete list of supported chains
* [CLI Reference](/resources/ai/cli) β Full command reference for on-chain and Tops commands
* [GitHub Repository](https://github.com/lxcong/web3-data-skill) β Source code and contributions
# x402 Integration
Source: https://docs.chainbase.com/resources/ai/x402
Pay-per-call API access for AI Agents via the HTTP 402 protocol
## What is x402?
x402 is an open standard introduced by Coinbase. It uses the HTTP `402 Payment Required` status code to allow machines (such as AI Agents) to automatically complete on-chain micropayments when initiating API requests. Payments are made using stablecoins (like USDC), with instant, transparent settlement and no need for trusted intermediaries.
## Pricing
All Chainbase Web3 API endpoints accessed via x402 are charged at a flat rate:
| | Price |
| ---------------- | ---------------- |
| **Per API Call** | **\$0.002 USDC** |
No subscriptions, no monthly fees β just pay per request with your wallet.
## Supported Endpoints
All [Chainbase Web3 API](/api-reference/overview) endpoints support x402 access. See the [API Reference](/api-reference/overview) for the complete list of available endpoints.
## Integration Steps (Python Example)
### Install Dependencies
```bash theme={null}
pip install eth_account x402
```
### Prepare Your Private Key
Please ensure you have an Ethereum wallet with sufficient USDC (it is recommended to use a testnet or mainnet cold wallet). **Never expose your real private key in public code!**
```python theme={null}
from eth_account import Account
# For production, please read from environment variables or a key management service
PRIVATE_KEY = "your_0x_private_key_here" # Example: 0x123...abc
account = Account.from_key(PRIVATE_KEY)
```
### Initialize x402 Session
```python theme={null}
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
client = x402ClientSync()
register_exact_evm_client(client, EthAccountSigner(account))
session = x402_requests(client)
```
### Call Chainbase API
For all Chainbase Web3 API endpoints, simply add `x-api-key: x402` to the request header. The rest of the usage is consistent with the standard API.
```python theme={null}
from pprint import pprint
# Example: Query Ethereum Mainnet USDT holder addresses ($0.002 per call)
api_url = "https://api.chainbase.com/v1/token/holders?chain_id=1&contract_address=0xdac17f958d2ee523a2206206994597c13d831ec7"
headers = {
"x-api-key": "x402", # Enable x402 payment
"Accept": "application/json"
}
response = session.get(api_url, headers=headers)
if response.status_code == 200:
pprint(response.json())
else:
print(f"Payment failed or request error: {response.status_code} - {response.text}")
```
## Use Cases
* **AI Agent automatically monitors token address changes**: Query once per hour, pay per request, no monthly fee required.
* **One-time data fetching**: Analyze a specific Token project, call only once, and pay just \$0.002.
* **Experimental development**: No need to register an enterprise account, pay directly with a wallet to test interfaces.
## Next Steps
* [API Reference](/api-reference/overview) β Full interactive API documentation
* [Supported Networks](/resources/platform/supported-networks/supported-networks) β Complete list of supported chains
# 4. Advanced Options
Source: https://docs.chainbase.com/resources/manuscript/QuickStart/advanced_options
# Overview
The datasets in the Chainbase Network is like base metals, and the alchemists (developers) can use Manuscripts to process this data, extracting greater value from the existing data.
# Protocol
Chainbase Network is committed to making data (on-chain & off-chain) more accessible, so Manuscripts allow users and developers to query and process data using SQL.
Manuscripts mainly consist of two parts.
* Schema: The definition of dataset.
* Operators: The extract, transform, and load methods which being used to extract greater value from the existing data.
## Schema
Schema can be defined like this.
```sql theme={null}
CREATE TABLE ethereum.blocks (
block_number bigint NOT NULL COMMENT 'Block number uniquely identifying the block',
hash varchar(66) NOT NULL COMMENT 'Hash value representing the unique identity of the block(with bloom filter)',
parent_hash varchar(66) NOT NULL COMMENT 'Hash value of the parent block(with bloom filter)',
nonce varchar(78) COMMENT 'Nonce value associated with the block',
sha3_uncles varchar(66) NOT NULL COMMENT 'SHA3 hash of the blocks uncle data(with bloom filter)',
logs_bloom varchar COMMENT 'Logs bloom filter for events emitted in transactions',
transactions_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for transactions(with bloom filter)',
state_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for the state(with bloom filter)',
receipts_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for receipts(with bloom filter)',
miner varchar(42) NOT NULL COMMENT 'Address of the miner who mined the block(with bloom filter)',
difficulty varchar(78) NOT NULL COMMENT 'Difficulty value representing the mining difficulty',
total_difficulty varchar(78) COMMENT 'Total accumulated difficulty of the blockchain',
size bigint COMMENT 'Size of the block in bytes',
extra_data varchar NOT NULL COMMENT 'Extra data included in the block',
gas_limit varchar(78) COMMENT 'Maximum gas limit allowed for transactions in the block',
gas_used varchar(78) COMMENT 'Total gas used by transactions in the block',
block_timestamp timestamp(3) NOT NULL COMMENT 'Timestamp of when the block was mined',
transaction_count bigint COMMENT 'Number of transactions included in the block',
base_fee_per_gas varchar(78) COMMENT 'Base fee per gas unit for transactions in the block',
withdrawals_root varchar(66) COMMENT 'Root hash of the Merkle Patricia Trie for withdrawals',
parent_beacon_block_root varchar COMMENT 'The hash tree root of the parent beacon block for the given execution block',
excess_blob_gas bigint COMMENT 'The blob gas pricing.',
blob_gas_used bigint COMMENT 'The total amount of blob gas consumed by transactions in the block'
);
```
Developers need to define the schema of the result table, including field names, field types, and field descriptions.
## Data Types
| Data Type | Remarks for Data Type |
| --------------- | ----------------------------------- |
| `CHAR` | |
| `VARCHAR` | |
| `STRING` | |
| `BOOLEAN` | |
| `BINARY` | |
| `VARBINARY` | |
| `BYTES` | |
| `DECIMAL` | Supports fixed precision and scale. |
| `TINYINT` | |
| `SMALLINT` | |
| `INTEGER` | |
| `BIGINT` | |
| `FLOAT` | |
| `DOUBLE` | |
| `DATE` | |
| `TIMESTAMP` | |
| `TIMESTAMP_LTZ` | |
## Operators
### SELECT & WHERE clause
The general syntax of the `SELECT` statement is:
```sql theme={null}
select select_list from table_expression [where boolean_expression]
```
The `table_expression` refers to any data set in Chainbase Network. It could be an existing table, or VALUES clause, the joined results of multiple existing tables, or a subquery. The following would read all rows from `blocks`.
```sql theme={null}
select * from blocks;
```
The `select_list` specification `*` means the query will resolve all columns.
Instead, a `select_list` can specify a subset of available columns or make calculations using said columns. For example, if `token_transfers` has columns name `token_id`, `token_value` and `token_decimal` you could write the following query:
```sql theme={null}
select token_id, token_value / token_decimal from token_transfers;
```
Rows can be filtered based on a `WHERE` clause:
```sql theme={null}
select * from ethereum.blocks where block_number = 19938860;
```
### ORDER BY clause
The `ORDER BY` clause causes the result rows to be sorted according to the specified expression(s). If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order.
```sql theme={null}
select * from blocks order by block_timestamp, block_number;
```
### LIMIT clause
`LIMIT` clause constrains the number of rows returned by the `SELECT` statement. In general, this clause is used in conjunction with `ORDER BY` to ensure that the results are deterministic.
The following example selects the latest 10 blocks on blocks table.
```sql theme={null}
select * from blocks order by block_timestamp limit 10;
```
### SELECT DISTINCT
If `SELECT DISTINCT` is specified, all duplicate rows are removed from the result set (one row is kept from each group of duplicates).
```sql theme={null}
select distinct contract_address from token_transfer;
```
### Group Aggregation
An aggregate function computes a single result from multiple input rows. For example, there are aggregates to compute the `COUNT`, `SUM`, `AVG(average)`, `MAX(maximum)` and `MIN(minimum)` over a set of rows.
```sql theme={null}
select count(1) from blocks
```
The standard `GROUP BY` clause is also supported for aggregating data.
```sql theme={null}
select count(*) from token_transfer group by contract_address
```
### Joins
INNER Equi-JOIN:
```sql theme={null}
select *
, token_metas.token_decimal
from token_transfer
inner join token_metas
on token_transfer.contract_address = token_metas.contract_address
```
OUTER Equi-JOIN:
```sql theme={null}
select *
, token_metas.token_decimal
from token_transfer
left join token_metas
on token_transfer.contract_address = token_metas.contract_address
```
### INSERT Statement
`INSERT` statements are used to add rows to a dataset.
Syntax:
```sql theme={null}
insert into table_name select_statement
```
Examples:
```sql theme={null}
create table latest_10_blocks (
block_number bigint NOT NULL COMMENT 'Block number uniquely identifying the block',
hash varchar(66) NOT NULL COMMENT 'Hash value representing the unique identity of the block(with bloom filter)',
parent_hash varchar(66) NOT NULL COMMENT 'Hash value of the parent block(with bloom filter)',
nonce varchar(78) COMMENT 'Nonce value associated with the block',
sha3_uncles varchar(66) NOT NULL COMMENT 'SHA3 hash of the blocks uncle data(with bloom filter)',
logs_bloom varchar COMMENT 'Logs bloom filter for events emitted in transactions',
transactions_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for transactions(with bloom filter)',
state_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for the state(with bloom filter)',
receipts_root varchar(66) NOT NULL COMMENT 'Root hash of the Merkle Patricia Trie for receipts(with bloom filter)',
miner varchar(42) NOT NULL COMMENT 'Address of the miner who mined the block(with bloom filter)',
difficulty varchar(78) NOT NULL COMMENT 'Difficulty value representing the mining difficulty',
total_difficulty varchar(78) COMMENT 'Total accumulated difficulty of the blockchain',
size bigint COMMENT 'Size of the block in bytes',
extra_data varchar NOT NULL COMMENT 'Extra data included in the block',
gas_limit varchar(78) COMMENT 'Maximum gas limit allowed for transactions in the block',
gas_used varchar(78) COMMENT 'Total gas used by transactions in the block',
block_timestamp timestamp(3) NOT NULL COMMENT 'Timestamp of when the block was mined',
transaction_count bigint COMMENT 'Number of transactions included in the block',
base_fee_per_gas varchar(78) COMMENT 'Base fee per gas unit for transactions in the block',
withdrawals_root varchar(66) COMMENT 'Root hash of the Merkle Patricia Trie for withdrawals',
parent_beacon_block_root varchar COMMENT 'The hash tree root of the parent beacon block for the given execution block',
excess_blob_gas bigint COMMENT 'The blob gas pricing.',
blob_gas_used bigint COMMENT 'The total amount of blob gas consumed by transactions in the block'
);
insert into latest_10_blocks
select * from blocks order by block_number desc limit 10;
```
## GPL
For experienced alchemists, a General-perpose Programming Language (GPL), such as Python or JavaScript, can be used to extract and process data. GPL will provides the most flexible and powerful data extraction capabilities
**Coming Soonβ¦**
# 2. Create a manuscript
Source: https://docs.chainbase.com/resources/manuscript/QuickStart/create_manuscript
## 1. ππΌ Getting Started
Great news! Youβve decided to create your first Manuscript. π
To make it easier for developers to get started with Manuscript, we've introduced a [GUI](https://github.com/chainbase-labs/manuscript-core) tool.
Built on top of the existing CLI, this tool provides intuitive graphical interfaces to explore the extensive blockchain data available on the Chainbase network.
After installing the GUI tool, you can run the binary file locally straight away.
```
β ~ ./manuscript
```
## 2. π΄πΌββοΈ Selecting Data
Once the tool has loaded, youβll be greeted with the GUI interface shown below.
The left-hand panel allows you to select your desired blockchain.
The Chainbase networkβs DA layer data is displayed here, and over time, even more valuable datasets will be added. Itβs worth noting that much of this data has been developed using Manuscript.
Youβre encouraged to create your own datasets or share your data requirements and suggestions with the community.
## 3. π€½πΌ Choosing Table
A dataset refers to either a raw data table or an abstract table.
## 4. ππΌββοΈ Creating a Manuscript
You can use the `c` shortcut key to create your Manuscript YAML file.
* **Data Sources**
Here, youβll define your data source, which can include various options. In this demonstration, weβve used the DA layer from Chainbase, though custom RPC endpoints and other sources are equally supported.
* **Data Transformation**
For data transformations, this demonstration uses SQL queries, a familiar and widely-used method. The tool is compatible with standard SQL syntax as well as popular Flink SQL functions.
* **Data Slink**
In this example, the data is exported to a local PostgreSQL database, complete with support for GraphQL queries.
## 5. π£πΌββοΈ Debugging and Deployment
Once youβve finished editing, you can run the debug environment to verify that the Manuscript works as expected and outputs the required format.
After confirming the results, youβll be able to deploy the Manuscript locally or to the Chainbase network.
Congratulations! Youβve successfully created your first Manuscript. ππ
# 1. Install GUI
Source: https://docs.chainbase.com/resources/manuscript/QuickStart/prerequisites
# 1. Mansucript GUI Installation
Download GUI binary for latest release, run:
```
curl -fsSL https://github.com/chainbase-labs/manuscript-core/raw/main/install-gui.sh | bash
```
# 2. Mansucript Requirements
### Docker
Ensure that Docker is properly installed and functional on your system, as it is essential for the Manuscript environment setup. Docker enables deployment and management of isolated containers required by Manuscript's ecosystem. For detailed installation instructions, please refer to the [Docker documentation](https://docs.docker.com/get-started/get-docker/).
### Docker Compose
Alongside Docker, Docker Compose is required and should be correctly installed and configured. Docker Compose enables the orchestration of multi-container applications, making it easier to deploy and manage Manuscript's dependencies. For setup guidance, refer to the [Docker Compose documentation](https://docs.docker.com/compose/install/).
### Linux Environment
Manuscript is designed for compatibility with Linux environments only. Ensure that you have access to a Linux-compatible system, such as macOS, CentOS, or Fedora. either directly or through a Linux-based container setup in Docker, to proceed with the installation and operation of Manuscript.
# 3. Checking for Requirements
On a native Linux system, you can use the `uname -a` command to obtain information about your Linux distribution.
If you are not using a native Linux system and need a Linux environment through Docker, you can check if Docker is installed by following these steps:
1.Open a terminal or command prompt.
2.Run the following command to verify that Docker is installed and operational:
```
docker --version
docker compose version
```
# 3. Run a manuscript
Source: https://docs.chainbase.com/resources/manuscript/QuickStart/run_manuscript
## Deploy Target
### 1. π Local
You can use our GUI tool to quickly deploy Manuscript locally.
### 2. π Network
We are about to launch the Chainbase network Manuscript environment, allowing users to deploy Manuscript directly to the Chainbase network.
## Deployment Options
There are three ways to deploy your Manuscript:
### 1. π Using the GUI Tool
Edit and deploy your Manuscript directly within the GUI. This is the most straightforward and efficient method.
### 2. π Using Docker Compose
Copy the docker-compose file from the [Manuscript-Core](https://github.com/chainbase-labs/manuscript-core/tree/main/examples) repository to deploy it locally.
### 3. π
Using Manuscript-Lib (Coming Soon)
Deploy your Manuscript with a single click through the Manuscript-Lib browser.
# Overview
Source: https://docs.chainbase.com/resources/manuscript/overview
# Manuscript
ππ [https://github.com/chainbase-labs/manuscript-core](https://github.com/chainbase-labs/manuscript-core)
# What is Manuscript?
Manuscript is a revolutionary blockchain data streaming framework. With Manuscript, you can seamlessly integrate on-chain and off-chain data into target data storage for unrestricted querying and analysis.
# Vision of Manuscript
The vision of Manuscript is to realize "data trade" within the Chainbase network, establishing a Chainbase ecosystem component that allows users to access any data through any means, across any service, using any language. This grand vision can be broken down into the following key aspects:
* Any language: We hope users can use scripts in any mainstream programming language to customize data, including but not limited to: Golang, Rust, Python, Node.js, Java, C/C++, Zig, WebAssembly (WASM)
* Any method: Different users are familiar with different forms of data access, we hope users can access data through various means, including but not limited to: SQL, DataFrames, HTTPS, gRPC, FTP, WebDAV, FUSE
* Any data: Users should be able to access data in any format, such as: JSON, CSV, ORC, XML, XLSX, BLOB
* Across any service: Users' expected data storage services also vary, we hope users can access, transfer, and control data in any service, such as: RPC, S3, IPFS, Azblob, HDFS, Google Drive, BigQuery, WebDAV, MySQL, PostgreSQL
In the Chainbase ecosystem, on-chain data can be tagged, categorized, and processed, transforming complex data into easily understandable and usable forms. Artificial intelligence algorithms can automatically analyze massive blockchain data, discovering hidden patterns, trends, and anomalies, helping users gain insights from the data. Manuscript provides rich tools and resources for this process, making data processing more efficient and transparent. Through these technical means, Manuscript not only makes access to on-chain data more free and flexible but also greatly enhances the value of data, allowing more people to easily use and apply this on-chain data.
# Value of Manuscript
1. Programmability:
Manuscript provides powerful programmable interfaces that allow developers to customize data processing workflows according to their needs. This flexibility means that Manuscript can be used not only for simple data queries but also for building complex data analysis pipelines and applications. Through programmability, Manuscript opens up infinite possibilities for innovative applications of blockchain data.
2. Interoperability:
With the booming development of blockchain technology, it's becoming increasingly difficult for different blockchains to understand and process each other's data. Manuscript can solve the interoperability problem of multi-chain and off-chain data aggregation in any dimension. By providing unified interfaces and data processing methods, Manuscript enables seamless integration of data from different blockchains, greatly improving the development efficiency and feasibility of cross-chain applications.
3. Monetization:
Leveraging the data capabilities provided by Manuscript, combined with the dual-chain architecture CometBFT + DPoS high-performance instant transaction finality and proof-of-stake consensus features, Chainbase offers a fair and transparent data value exchange ecosystem. Creators can monetize their processed data through Manuscript, while data users can conveniently consume the data they need. This mechanism not only incentivizes the production of high-quality data but also promotes the positive development of the entire blockchain ecosystem.
# Design of Manuscript
As the data access layer in the Chainbase network, Manuscript needs to interface with a large number of existing data protocols. Its core design philosophy revolves around modularity and scalability, consisting of the following key components:
1. Accessor (Data Source):
* As the lowest-level interface, all services need to implement this interface, responsible for translating upper-layer calls into lower-level requests
* For example, translating a read request into corresponding service API calls
* Provides a unified data access abstraction, shielding the differences in underlying storage and services
2. Processor (Data Method):
* High-level methods oriented towards users, allowing them to conveniently create read and write requests
* Provides operations such as SQL syntax, initializing Datasets, etc.
* Encapsulates complex data interoperation underlying logic, providing a concise user interface
3. Handler (Data Target):
* Handles specific read and write requests, manages the lifecycle of data objects, implements data serialization and deserialization
* Deals with data consistency and concurrency issues
* For example, writing user-processed data to local relational databases like MySQL, PostgreSQL, etc.
4. Signer (Proof of Stake):
* Allows users to pre-generate signed URLs, supporting temporary authorized access, enhancing the security of data access
* Implements permission management and stake allocation proof interfaces based on smart contracts
# Manuscript Community
The Chainbase Network provides an open, trustless, and permissionless data ecosystem network, encouraging data democratization and monetization, where both users and data providers can participate without authorization from any governing body. Through Manuscript, participants can produce high-quality data and profit from it.
The success and development of Manuscript rely on active community support. It is not an isolated service, but an open ecosystem. Only with the power of the community can Manuscript fully realize its potential and achieve flourishing development. We encourage community members to:
* Contribute new Accessor implementations to support more data sources and services
* Develop innovative data and applications based on Manuscript
* Participate in documentation writing and tutorial creation to help more people understand and use Manuscript
* Propose improvement suggestions and report issues to drive the continuous improvement of Manuscript
* Organize online and offline exchange activities to share user experiences and best practices
Through the power of the community, we believe Manuscript will become an important data component in the Chainbase data world, bringing more innovation and value to the entire industry.
# Manuscript Zone
Source: https://docs.chainbase.com/resources/manuscript/zone
## Overview
A Chainbase Zone is a specialized data processing domain within the Manuscript framework that focuses on parsing and analyzing blockchain data for specific sectors or use cases. Zones are collections of Manuscript implementations that work together to provide comprehensive data solutions for particular blockchain domains.
Zones in Chainbase provide several key capabilities:
1. **Data Specialization**: Focus on specific blockchain domains (DeFi, NFTs, Gaming, etc.)
2. **Custom Processing**: Define specialized data processing workflows for your domain
3. **Interoperability**: Connect with multiple data sources and output formats
4. **Monetization**: Earn rewards by providing valuable processed data to the network
## Zone Roles and Workflow
The Chainbase Zone ecosystem consists of multiple key roles that work together to ensure efficient and high-quality data processing.
### Core Roles
1. Zone Owner
* Responsible for creating and managing domain-specific data processing scenarios
* Defines the business scope and technical specifications of the Zone
* Reviews and updates Manuscripts within the Zone
* Manages the Zone's economic model and reward mechanisms
2. Alchemist (Developer)
* Develops Manuscripts based on Zone specifications
* Implements and optimizes data processing logic
* Provides technical support and maintenance
* Participates in Zone technical upgrade discussions
3. Operator
* Selects and runs specific Zones
* Provides computational resources and infrastructure support
* Ensures stable operation of all Manuscripts within the Zone
* Monitors system performance and handles exceptions
## Workflow Process
```mermaid theme={null}
flowchart LR
subgraph Zone Creation Flow
direction LR
ZoneOwner((Zone Owner)) --> ZoneCreation[Create Scenario]
ZoneCreation --> Specs[Define Specs]
Specs --> Alchemist((Alchemist))
Alchemist --> Manuscript[Deploy]
Manuscript --> Review[Review]
Review --> Update[Update]
Update --> Operator((Operator))
Operator --> Operation[Run]
Operation --> Reward[Distribute]
end
style ZoneOwner fill:#f96,stroke:#333
style Alchemist fill:#9cf,stroke:#333
style Operator fill:#9f9,stroke:#333
```
# Create a Chainbase Zone
## Recommended Flow for Deploying Your Zone
Before deploying your first zone on the mainnet, we strongly recommend following this order:
1. **Local Development**: Create and test your zone locally with sample data processing workflows
2. **Testnet Deployment**: Deploy your zone on Chainbase testnet to validate your data processing pipelines
3. **Mainnet Launch**: After thorough testing, deploy your zone on the Chainbase mainnet
## Prerequisites
To create a zone, ensure you have:
* Installed Chainbase Manuscript framework
* Created a emv wallet
## Creating a Local Zone
### Step 1. Set up Local Development Environment
```bash theme={null}
# Install Manuscript core dependencies
git clone https://github.com/chainbase-labs/manuscript-core
cd manuscript-core
make install gui # or cli
```
### Step 2. Configure Zone (Coming soon..)
## Zone Lifecycle Management
### Performance Monitoring
Zones are evaluated based on:
* Data processing throughput
* Query response times
* Data accuracy and completeness
* Network utilization
### Deregistration
Poor-performing zones may be deregistered if they:
* Consistently fail to meet performance metrics
* Process invalid or corrupted data
* Violate network policies
## Best Practices
1. **Testing**: Thoroughly test your zone's data processing pipelines before mainnet deployment
2. **Documentation**: Maintain clear documentation for your zone's capabilities and usage
3. **Monitoring**: Implement robust monitoring for your zone's performance
4. **Updates**: Regularly update your zone's components to maintain compatibility and security
## Community Contribution
The success of Chainbase Zones depends on community participation. Contributors can:
* Develop new specialized zones for different blockchain sectors
* Improve existing zone implementations
* Share zone templates and best practices
* Participate in zone governance decisions
For more information about contributing to the Chainbase ecosystem, visit our [community guidelines](https://docs.chainbase.com/network/contributing/overview).
# Developer Resources
Source: https://docs.chainbase.com/resources/overview
Complete reference documentation for all Chainbase products and tools
Detailed documentation for every Chainbase product. For scenario-based guides, see [Getting Started](/getting-started/welcome).
## Chainbase AI
Tools and protocols for AI agent integration with Web3 data.
## Data Platform
APIs and infrastructure for accessing and processing chain data.
## Manuscript
## CLI
# Credit Cost
Source: https://docs.chainbase.com/resources/platform/credit/methods
Credit cost per Web3 API method and SQL API call.
This page lists the credit cost for every metered API method. Costs are uniform across all supported chains. Billing semantics differ by product:
* **Web3 API** β charged only on a successful response; failed requests (4xx/5xx) are free.
* **SQL API** β charged at submission, regardless of whether the query later succeeds, fails at runtime, or is cancelled.
For full details on credits, plans, and billing cycles, see the [Credit Overview](/resources/platform/credit/overview).
## SQL API
| Method | Endpoint | Credits |
| ------------------------------------------------------------------------ | -------- | ------- |
| [SQL Query Execution](/resources/platform/features/api/sql-api/overview) | SQL API | 100 |
A flat 100 credits are deducted the moment a query is submitted and accepted for execution, regardless of query complexity, scanned bytes, or runtime β and regardless of the query's eventual outcome.
## Web3 API
### Basic
| Method | Endpoint | Credits |
| ---------------------------------------------------------------------------------------------------- | ------------------------- | ------- |
| [Get Latest Block Number](/api-reference/web3-api/basic/block/get-latest-block-number) | `/v1/block/number/latest` | 1 |
| [Get Block by Number](/api-reference/web3-api/basic/block/get-block-by-number) | `/v1/block/detail` | 3 |
| [Get Transaction](/api-reference/web3-api/basic/transaction/get-transaction) | `/v1/tx/detail` | 3 |
| [Get Transactions by Account](/api-reference/web3-api/basic/transaction/get-transactions-by-account) | `/v1/account/txs` | 3 |
| [Contract Call](/api-reference/web3-api/basic/contract/contract-call) | `/v1/contract/call` | 3 |
### Balance
| Method | Endpoint | Credits |
| ---------------------------------------------------------------------------------------------------- | --------------------- | ------- |
| [Get Native Token Balance](/api-reference/web3-api/balance/token-balances/get-native-token-balances) | `/v1/account/balance` | 1 |
| [Get ERC20 Token Balances](/api-reference/web3-api/balance/token-balances/get-erc20-token-balances) | `/v1/account/tokens` | 3 |
| [Get NFTs Owned by Address](/api-reference/web3-api/balance/nft-balances/get-nfts-owned-by-address) | `/v1/account/nfts` | 3 |
### Token
| Method | Endpoint | Credits |
| ---------------------------------------------------------------------------------------------------------------- | ------------------------- | ------- |
| [Get Token Metadata](/api-reference/web3-api/token/token-metadata/get-token-metadata) | `/v1/token/metadata` | 1 |
| [Get Token Price](/api-reference/web3-api/token/market-data/get-token-price) | `/v1/token/price` | 1 |
| [Get Token Price History](/api-reference/web3-api/token/market-data/get-token-price-history) | `/v1/token/price/history` | 3 |
| [Get Token Holders](/api-reference/web3-api/token/token-holders/get-token-holders) | `/v1/token/holders` | 3 |
| [Get Top Token Holders](/api-reference/web3-api/token/token-holders/get-top-token-holders) | `/v1/token/top-holders` | 3 |
| [Get Token Transfers by Contract](/api-reference/web3-api/token/token-transfers/get-token-transfers-by-contract) | `/v1/token/transfers` | 5 |
### NFT
| Method | Endpoint | Credits |
| ------------------------------------------------------------------------------------------------------------ | -------------------------- | ------- |
| [Get NFT Metadata](/api-reference/web3-api/nft/nft-metadata/get-nft-metadata) | `/v1/nft/metadata` | 1 |
| [Get NFT Rarity](/api-reference/web3-api/nft/nft-metadata/get-nft-rarity) | `/v1/nft/rarity` | 1 |
| [Get NFT Collection Metadata](/api-reference/web3-api/nft/nft-collections/get-nft-collection-metadata) | `/v1/nft/collection` | 1 |
| [Get NFT Collection Items](/api-reference/web3-api/nft/nft-collections/get-nft-collection-items) | `/v1/nft/collection/items` | 3 |
| [Get NFT Owner by Token](/api-reference/web3-api/nft/nft-ownership/get-nft-owner-by-token) | `/v1/nft/owner` | 3 |
| [Get NFT Owners by Collection](/api-reference/web3-api/nft/nft-ownership/get-nft-owners-by-collection) | `/v1/nft/owners` | 3 |
| [Get NFT Owner History by Token](/api-reference/web3-api/nft/nft-ownership/get-nft-owner-history-by-token) | `/v1/nft/owner/history` | 3 |
| [Get NFT Transfers by Collection](/api-reference/web3-api/nft/nft-transfers/get-nft-transfers-by-collection) | `/v1/nft/transfers` | 3 |
### Domain
| Method | Endpoint | Credits |
| ------------------------------------------------------------------------------------------------------------ | ----------------- | ------- |
| [Resolve ENS Domain](/api-reference/web3-api/domain/ens-domain-endpoints/resolve-ens-domain) | `/v1/ens/records` | 1 |
| [Reverse Resolve ENS Domain](/api-reference/web3-api/domain/ens-domain-endpoints/reverse-resolve-ens-domain) | `/v1/ens/reverse` | 3 |
| [Get ENS Domains by Address](/api-reference/web3-api/domain/ens-domain-endpoints/get-ens-domains) | `/v1/account/ens` | 3 |
## Notes
* **When credits are deducted.** Web3 API charges only on a successful response (4xx/5xx are free). SQL API charges at submission and the deduction is final, regardless of query outcome.
* **No per-chain variation.** The same method costs the same number of credits on every supported chain.
* **Pagination.** Each page request is a separate billable call.
* **Subject to change.** Credit costs may be adjusted as we add capacity or new methods. Material changes will be announced in advance.
To monitor your usage, visit [console.chainbase.com/settings/billing?tab=credit](https://console.chainbase.com/settings/billing?tab=credit).
# Overview
Source: https://docs.chainbase.com/resources/platform/credit/overview
How Chainbase meters API usage with credits.
Chainbase meters paid API usage with **credits**. Every successful request to a metered API consumes a fixed number of credits, and your monthly plan grants a credit allowance that resets on a regular cycle.
## Which APIs consume credits
| Product | How it's metered |
| ------------ | -------------------------------------------------------------------------------------- |
| **Web3 API** | Per request, varying by method. See [Credit Cost](/resources/platform/credit/methods). |
| **SQL API** | Flat **100 credits** per query execution. |
Other Chainbase products are billed separately and are not covered by this credit system.
## Plans & monthly allowance
| Plan | Monthly credits | Billing cycle |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Free** | 200,000 | Calendar month β resets on the **1st of each month (UTC)**. |
| **Developer** | 10,000,000 | Anchored to your **subscription day** β resets on the same day-of-month each cycle. If your anchor day exceeds the days in a given month (e.g. day 31 in February), the cycle ends on that month's last day. |
| **Enterprise** | Custom | Custom billing cycle, agreed in your contract. Contact sales for details. |
Unused credits do not roll over to the next cycle.
Credit usage is tracked at the **account** level. All API keys, apps, and projects under the same account share a single monthly allowance β there is no per-key quota.
### Cost example
A workload running 5,000 native balance lookups, 1,000 NFT metadata calls, and 100 SQL queries per day:
| Calls / day | Method | Unit cost | Daily credits |
| ----------- | ------------------------ | --------- | ---------------------------------- |
| 5,000 | Get Native Token Balance | 1 | 5,000 |
| 1,000 | Get NFT Metadata | 1 | 1,000 |
| 100 | SQL Query Execution | 100 | 10,000 |
| | | **Total** | **16,000 / day β 480,000 / month** |
That workload exceeds the Free plan (200,000 credits/month) and fits comfortably within the Developer plan (10,000,000 credits/month).
## Extra Credits Usage
When your monthly plan allowance is fully consumed, requests can continue to be served by **extra credits** purchased on top of your plan. Extra credits give you a one-off, non-expiring buffer for traffic spikes without forcing a plan upgrade.
### How they're priced
The base rate is **\$1 = 100,000 credits**, with volume bonuses applied automatically at checkout:
| Single purchase amount | Bonus | Effective credits |
| ---------------------- | ----- | ----------------- |
| $1 β $49 | β | 100,000 / \$ |
| $50 β $249 | +5% | 105,000 / \$ |
| $250 β $999 | +10% | 110,000 / \$ |
| $1,000 β $10,000 | +20% | 120,000 / \$ |
Each purchase must be between **$1 and $10,000** USD. The discount is determined by each individual purchase amount, not by your cumulative spend.
### How they're consumed
1. Every billable request is charged to your **plan allowance** first.
2. Once the plan allowance for the current cycle is exhausted, additional requests draw from your extra credit balance β provided extra credit consumption is **enabled** for your account.
3. If extra credit consumption is **disabled**, requests are rejected after the plan allowance is used up, even if you have unused extra credits. This lets you hard-cap your monthly spend.
4. Extra credits **do not expire** and are not reset when the plan cycle resets. Multiple purchases stack into a single balance.
5. Unused plan allowance never converts into extra credits.
You can enable or disable extra credit consumption at any time in the console, and you can buy additional packs whenever needed.
Enterprise plans do not use the extra credit mechanism β usage limits and overage handling are governed by the contract.
## Monitoring usage
Track your live credit consumption, current cycle window, and remaining balance in the console:
[console.chainbase.com/settings/billing?tab=credit](https://console.chainbase.com/settings/billing?tab=credit)
The dashboard breaks usage down by product (Web3 API, SQL API) and by day, so you can identify which methods drive your spend.
## How a request is charged
1. The gateway authenticates the request and looks up the method's credit cost.
2. **Web3 API** β credits are recorded only on a successful response. Failed requests (4xx/5xx returned by Chainbase) are **not** charged.
3. **SQL API** β credits are deducted **immediately on submission**, as soon as the query is accepted for execution. The 100-credit cost is charged regardless of whether the query ultimately succeeds, fails at runtime, or is cancelled, because the underlying compute resources are committed at submission time.
4. When your plan allowance is exhausted, requests fall back to extra credits (if enabled). Without extra credits β or once the extra credit balance is also depleted β further requests are rejected with **HTTP 429 Too Many Requests** until the cycle resets or additional extra credits are purchased.
For the per-method credit table, see [Credit Cost](/resources/platform/credit/methods).
## Rate limits
The monthly credit allowance governs total volume. Independently, **Web3 API** traffic is also subject to a **per-second rate limit** measured in credits per second. During the current rollout period, both controls may apply to your Web3 API traffic and are evaluated independently β exceeding either one will result in an HTTP 429 response.
| Plan | Web3 API per-second rate limit |
| -------------- | ------------------------------ |
| **Free** | 3 credits / second |
| **Developer** | 30 credits / second |
| **Enterprise** | Custom |
Because the limit is measured in credits rather than raw requests, the effective request rate depends on each method's cost. For example, on the Free plan you can sustain 3 calls/second to a 1-credit method (e.g. Get Native Token Balance) but only 1 call/second to a 3-credit method (e.g. Get ERC20 Token Balances).
The per-second limit does **not** apply to SQL API β SQL queries are governed only by the monthly credit allowance and any concurrency limits described in the SQL API documentation.
## FAQ
Yes. Credit consumption is tracked at the account level. All keys, apps, and projects under your account draw from the same monthly allowance β there is no per-key budget.
Web3 API charges only on a successful response. Network timeouts and 4xx/5xx responses returned by Chainbase are not charged. If your client retries the request, each retry that reaches Chainbase and succeeds is billed independently.
SQL API charges at submission. Once a query has been accepted by the gateway, the 100 credits are final β including for client-side timeouts that result in a retry, since each accepted submission is billed.
No. Each Web3 API call is one request and consumes the listed credits for that method, regardless of how many records the response contains.
Yes. Each page request is a separate billable call.
Both limit types return **HTTP 429 Too Many Requests**:
* **Monthly credits exhausted** β your plan allowance (and any extra credits, if enabled) is depleted for the current cycle.
* **Per-second credit limit exceeded (Web3 API only)** β momentary Web3 API burst exceeds your plan's per-second credit limit (3 on Free, 30 on Developer).
Check the response body and the [billing dashboard](https://console.chainbase.com/settings/billing?tab=credit) to determine which one was triggered. A short retry with backoff usually clears per-second throttling; a monthly-quota 429 will persist until the cycle resets or extra credits are added.
Your current cycle window and the new plan's allowance take effect according to the rules in the [Plans & monthly allowance](#plans--monthly-allowance) section. The console always shows your live cycle window and remaining balance β refer to it after any plan change.
Yes. Toggle off extra credit consumption in the console. With it off, requests are rejected with HTTP 429 once your plan allowance is used up, even if you have unused extra credits.
# Data Catalog
Source: https://docs.chainbase.com/resources/platform/datasets/data-catalog
# Inscription & Rune Data Support
Source: https://docs.chainbase.com/resources/platform/datasets/inscription-and-rune
## Inscription & Rune Overview
Chainbase is built on the Streaming Warehouse prepared for the blockchain, constructing datasets in various fields. We hope to contribute to the Data field for BTC ecology under Inscription & Rune, making it easier and more efficient for developers to join the BTC ecosystem.
## Why Inscription & Rune is a Challenge from a Data Perspective in the Future
* Theoretically, all blockchains can run the Inscription protocol. Due to their low barrier to entry, throughput and storage will become challenges.
* The protocol is in its early stages, some indexers are still in the paper stage and have not been implemented. This requires infrastructure capabilities.
* The current implementation of indexers is more to solve the asset rights of Inscription & Rune off-chain, while the mining of blockchain data requires more capabilities.
## What has Chainbase done?
### Integrating Community Indexer
At present, Inscription & Rune generally open source protocol indexer, to ensure the legitimacy of off-chain asset verification and provide simple query services. Chainbase hopes to stay integrated with the community, continuously ingesting data into the Chainbase data platform to facilitate the re-mining of data value and create more data applications. At the same time, it can contribute code to the community's indexer.

### Unify Data Abstraction Capability
Due to the lack of standardization in the Inscription & Rune's indexer, different indexer protocols use different languages and repeatedly build with different business logic. For example, all indexers will implement balance calculations related to the tick. The platform-based capability of chainbase can unify this part of data abstraction logic, integrating more inscription protocols at a lower cost.

### Make Developers Better Use Inscription & Rune Data
With the data platform capability based on chainbase, developers can explore more data value. For example
* Insight into investment opportunities on Inscription & Rune based on the product features of datacloud, such as the excavation of smart money
* The ability to actively push based on sync, develop robots based on message flow
* Integrate Inscription & Rune asset data into wallet applications and more based on web3 APIs

## Dataset Supported
* [brc20.token\_balances](/catalog/Bitcoin/Abstracted/brc20_token_balances)
* [brc20.token\_activities](/catalog/Bitcoin/Abstracted/brc20_token_activities)
* [brc20.token\_info](/catalog/Bitcoin/Abstracted/brc20_token_info)
* [pipe.token\_balances](/catalog/Bitcoin/Abstracted/pipe_token_balances)
* [pipe.token\_activities](/catalog/Bitcoin/Abstracted/pipe_token_activities)
* [pipe.token\_info](/catalog/Bitcoin/Abstracted/pipe_token_info)
# Overview
Source: https://docs.chainbase.com/resources/platform/datasets/overview
## What is Dataset
A Dataset refers to a structured collection of data stored on the Chainbase Warehouse, which providing a clear and organized way to **Store, Access, and Manage** Web3 data in efficient way.
These datasets go through a strict process of **aggregation, validation, and indexing** to ensure they are accurate and real-time. They serve as the **Backbone** of our platform, enabling users to interact with **Web3 data** in a more intuitive and efficient way.

Datasets on Chainbase comprise of various **Data Tables**, which can be utilized through different user-interfaces such as **DataCloud, Sync, and API**, catering to diverse user requirements and scenarios.
## Data Layers
**Datasets** are structured in three primary layers to provide varying degrees of data abstraction, namely **Raw, Decoded Contract, and Abstracted**. These layers aid users in quickly accessing the desired dataset based on their specific needs and use-cases.

* **Raw**: This layer houses the Raw Data of the blockchain including **Blocks, Transactions, Traces, and Logs**, serving as the fundamental basis for higher-level data interpretations.
* **Decoded Contract**: Utilizing smart contract ABIs, this layer auto-decodes contract data into a more comprehensible format. It mainly comprises **Call Tables and Event Logs**.
* **Abstracted**: This layer is **highly-abstracted** based on Real-world business requirements. It includes tables like `nft_assets, nft_burns, token_metas` etc., catering to various domains like **NFTs, Tokens, and DeFi**.
## Chains Supported
The Chainbase platform is dedicated to building a powerful **Multi-Chain** ecosystem to enable **interoperability** and diversity of blockchain technology. thus facilitating the flow of data between different chains and networks.
By supporting multiple **Layers(L1/L2) and Chain types**, including **EVM, Non-EVM** to ensure that Chainbase platform can cover a wide range of blockchain networks and scenarios, providing users with a **All in One** data workstation.
### EVM-Compatible
**EVM-compatible** Chains like **Ethereum, Polygon, BSC, Avalanche, Fantom, Arbitrum, and Optimism** now are supported in Chainbase, allowing a broad dApps and services to seamlessly on our platform. Additionally, our continual updates and enhancements ensure that we stay in sync with the evolving **EVM specifications and community standards**, thereby ensuring our platform remains at the forefront of the blockchain technology landscape.

### Non-EVM
We also support **Non-EVM** chains like **Bitcoin, Sui, and Aptos**, By integrating them, we bridge the technological gaps between different blockchains, offering users a broader landscape for data exploration and application development.

## Data Sources
Chainbase not only provides **built-in datasets** but also facilitates the acquisition and processing of datasets from other ways.
Users have the flexibility to harness additional data by submitting Smart-Contract **ABI (Application Binary Interface)** to decode the corresponded contracts.
### ABI Auto Decode
Users can submit the "**Contract Address**" along with the corresponding **ABI** to parse the data of the contract they are interested in. This feature significantly simplifies the process of decoding contract data, making it a straightforward task for users to obtain the precise contract data they need.
Through **ABI Auto Decode**, Chainbase empowers users to effortlessly access and interpret **contract data**, further enriching the datasets available on the platform and expanding the scope of data analytics and insights that can be derived from blockchain data.
While it was still in developing. and it will be released in next few versions.
> π§ Coming soon...
# FAQs
Source: https://docs.chainbase.com/resources/platform/faqs/faq
## Account
### 1. How to get API key?
### 2. What is the QPS in the Chainbase Console?
You can find more information in [pricing](https://chainbase.com/pricing)
## APIs
### 1. What is Custom API, and how can I get access to Custom API? Are there any difference with Task API?
* [Task API](/resources/platform/features/api/sql-api/datacloud-task-api): Asynchronous real-time requests with high data freshness (less concurrency scenarios).
* [Custom API](/resources/platform/features/api/sql-api/datacloud-custom-api): High concurrency and low latency (with slightly reduced data freshness, at least 5 minutes).
Custom API is not available for all users. Please contact us for more information.
# Data Cloud API (Deprecated)
Source: https://docs.chainbase.com/resources/platform/features/api/sql-api/datacloud-api-classic
βοΈ Warning
The feature will be discontinued and no longer available on \[ 2024-12-31 ]
Recommend using our latest version of the [DataCloud API.](/resources/platform/features/api/sql-api/datacloud-task-api)
π Donβt have an API key?
Go to [console.chainbase.com](https://console.chainbase.com/) to create an account and a new API key.
## What is Data Cloud?
The Chainbase Data Cloud lets you run your low-latency queries through an endpoint to leverage all our indexed datasets for your custom needs. Chainbase's [Data Cloud](/resources/platform/datasets/overview) is a fully managed online data warehouse service for Web3 developers. Developers can query the data warehouse through the **API** to access our datasets with zero infra cost. And the **Data Cloud**'s scalable, distributed analytical data engine and intelligent data modeling allow you to query terabytes of data **in seconds**.
## Quickstart
Query the hashes of the last 3,000 blocks in Ethereum and the number of transactions in each block:
```bash theme={null}
curl -X "POST" "https://api.chainbase.online/v1/dw/query" \
-H 'X-API-KEY: YOUR-API-KEY ' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"query": "select number, transactions_count from ethereum.blocks order by number desc limit 3000;"
}'
```
If there are more than 1000 rows, you need to paginate through the`task_id` and `page` to get all the results:
```bash theme={null}
curl -X "POST" "https://api.chainbase.online/v1/dw/query" \
-H 'X-API-KEY: YOUR-API-KEY ' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"task_id": "xxxxxxxxxxxxxxxxxxxxx",
"page": 2
}'
```
## API Reference
If you want to know more details on the endpoint and optional parameters, check out:
* [SQL API (Classic)](/api-reference/sql-api/data-cloud-sql-query)
# Data Cloud Custom API (Alpha)
Source: https://docs.chainbase.com/resources/platform/features/api/sql-api/datacloud-custom-api
A data request method supporting high-concurrency scenarios.
The Custom API functionality is designed to offer an efficient and reliable data processing solution, by automatically updating and persistently storing users' SQL query results according to a predetermined schedule in a relational database engineered to handle high concurrency and high throughput demands. This strategy, by sacrificing a certain degree of data real-time accuracy, achieves optimization in reducing response time and enhancing the number of requests processed. Compared to our Task API, the distinctiveness of the Custom API functionality lies in its less stringent requirement for data immediacy.
* **Task API**: Asynchronous real-time requests with high data freshness (less concurrency scenarios).
* **Custom API**: High concurrency and low latency (with slightly reduced data freshness,at least 5 minutes).







# Data Cloud Task API (Alpha)
Source: https://docs.chainbase.com/resources/platform/features/api/sql-api/datacloud-task-api
**Unified Datasets**
Users can now explore and query across three layers of datasets - Raw, Decoded, and Abstracted - within DataCloud.
**Parameterized Queries**
With our new Parameterized Queries feature, users can now craft more dynamic and customized SQL queries.
**Task API**
Our Task API enable seamless integration with a wide range of applications, ensuring continuous access to the latest data.
## API Reference
If you want to know more details on the endpoint and optional parameters, check out:
* [SQL API (Alpha)](/api-reference/sql-api/execute-queries)
# Overview
Source: https://docs.chainbase.com/resources/platform/features/api/sql-api/overview
π Donβt have an API key?
Go to [console.chainbase.com](https://console.chainbase.com/) to create an account and a new API key.
## What is SQL API?
The Chainbase SQL API lets you run your low-latency queries through an endpoint to leverage all our indexed datasets for your custom needs.
The SQL API is powered by Chainbase's [Data Cloud](/resources/platform/features/datacloud/overview), a fully managed online data warehouse service for Web3 developers. Developers can query the data warehouse through the **SQL API** to access our datasets with zero infra cost. And the **Data Cloud**'s scalable, distributed analytical data engine and intelligent data modeling allow you to query terabytes of data **in seconds**.
# Web3 API
Source: https://docs.chainbase.com/resources/platform/features/api/web3-api
π **Donβt have an API key?**
Go to [console.chainbase.com](https://console.chainbase.com/) to create an account and a new API key.
Simplifies your web3 development process with seamless access to on-chain and off-chain data.
## What is Web3 API?
The Chainbase Web3 API is an API suite that simplifies your web3 development process with seamless access to on- and off-chain data. No matter what you're building, our Web3 API will provide the necessary data support, including balance, transaction history, ownership, and price information.
## Web3 API Features
Chainbase lets you easily and instantly look up multi-chain, multi-asset balances, transfer history, prices, etc. No indexing is required!
## Built for Web3 Use Cases
The advanced feature set of our Web3 APIs means it can support use case, including:
* NFT Marketplaces
* Wallets
* Block Explorers
* DeFi portfolio Trackers
* Analytics & Reporting
* DAO Governance Tools
* Gaming
## Supported Chains
We will continue to add support for new blockchains for Web3 API. If there is a chain that you wish to support but we do not, please let us know by [reaching us](http://chainbase.com/help).
| Chain |
Network ID |
| Ethereum |
1 |
| Polygon |
137 |
| BSC |
56 |
| Avalanche |
43114 |
| Arbitrum One |
42161 |
| Optimism |
10 |
| Base |
8453 |
| zkSync |
324 |
| Merlin |
4200 |
# Overview
Source: https://docs.chainbase.com/resources/platform/features/datacloud/overview
## What is Data Cloud
* DataCloud is a powerful online platform designed for on-chain data processing. It is tailored to provide extensive capabilities in data querying, analysis, and processing. This platform enables developers to swiftly and effectively analyze on-chain data, facilitating the creation of high-performance, low-latency APIs for streamlined Web3 application development.
* This platform significantly simplifies the process from analyzing on-chain data to building high-performance APIs, especially suitable for applications requiring real-time data monitoring and dynamic data analysis.
* DataCloud supports a wide range of users, from exchanges and DeFi application operators to market analysts, offering powerful tools to focus more on innovation and optimizing Web3 application features.
## Features
* **Unified Datasets (Raw / Decoded / Abstracted)**: The datasets have been unified, providing a more streamlined and efficient data handling experience.
* **Parameterized Queries**: Introducing parameterized templates for more flexible and efficient data querying.
* **File Explorer**: A new tool to explore and manage saved queries.
* **Task API**: Replacing the SQL API, this new feature allows for more advanced and customizable data handling tasks.
## QuickStart
**Enter Data Cloud**: Access the [Data Cloud](https://console.chainbase.com/dataCloud) interface to start your data exploration.
**Input a Simple SQL Query**: Use the following SQL query in the Data Cloud to extract information from Ethereum transaction data, focusing on a specific block number:
```sql theme={null}
select
block_timestamp,
block_number,
_value,
_from,
_to
FROM ethereum.erc20_transfer
WHERE block_number = 17089970
```
This query retrieves details such as the timestamp of the block, block number, originating address, transaction value, and the transaction hash, specifically targeting transactions in block number 17089970 on the Ethereum blockchain.
**Execute the Query**: Run this query within Data Cloud to pull the specified data from the Ethereum blockchain.

**Introduction to Custom Parameters**: In Data Cloud, you have the ability to use a dedicated parameter input box, which allows for the customization of query parameters. This feature enhances the flexibility and user-friendliness of SQL queries.
**Setting Up a Query with Custom Parameters**: Hereβs an example of how you can structure an SQL query using a custom parameter for the block number:

```sql theme={null}
SELECT
block_timestamp,
block_number,
from_address,
value,
gas,
hash
FROM ethereum.transactions
WHERE block_number = {blocknumber}
```
**Using the Custom Parameter Box**: When you run this query, use the custom parameter box to input or select the desired block number. This input will replace the placeholder in the query, allowing you to retrieve data for that specific block on the Ethereum blockchain with ease.

**Save your query to File ExplorerοΌ**
After saving your SQL query, it will be visible and accessible at any time within the "File Explorer" on the left side. This tool is meticulously designed to simplify your navigation and management of saved queries. With easy access to these entries in the file management panel, complemented by the search functionality at the top, you can quickly locate and retrieve previously saved queries, significantly enhancing the efficiency of your development workflow in data analysis and database management. The "File Explorer" serves as a centralized platform for viewing and organizing SQL queries, further enabling developers to manage and execute data operations with great efficiency.
Finally, by clicking on "Generate API," you can create an API endpoint that allows you to invoke the data seen in Data Cloud within your own programs, offering a 'what you see is what you get' convenience. Additionally, you have the flexibility to select from different programming languages according to your tech stack, ensuring seamless integration into your development environment.
```typescript theme={null}
const apiKey = "your-api-key";
const queryId = "424242";
const headers = {
"API-KEY": apiKey,
"CONTENT-TYPE": "application/json",
};
async function executeQuery(queryId) {
return await fetch(
`https://api.chainbasehq.com/v1/query/${queryId}/execute`,
{ method: "POST", headers }
)
.then((response) => response.json())
.then((data) => data.data[0].executionId);
}
async function checkStatus(executionId) {
return await fetch(
`https://api.chainbasehq.com/v1/execution/${executionId}/status`,
{ headers }
)
.then((response) => response.json())
.then((data) => data.data[0].status);
}
async function getResults(executionId) {
return await fetch(
`https://api.chainbasehq.com/v1/execution/${executionId}/results`,
{ headers }
).then((response) => response.json());
}
async function main() {
const executionId = await executeQuery(queryId);
let status;
do {
status = await checkStatus(executionId);
await new Promise((resolve) => setTimeout(resolve, 1000));
} while (status !== "FINISHED" && status !== "FAILED");
return await getResults(executionId);
}
main().then(console.log);
```

## SQL Example
**Query the total cross-chain amount for a user:**
```sql theme={null}
SELECT
'out' as type,
project,
token,
from_chain,
to_chain,
sum(cast(amount as decimal(38, 0))) as total
FROM
bridge_ethereum.transfers
WHERE
"from" = '0xf99d58e463a2e07e5692127302c20a191861b4d6'
group by
project,
token,
from_chain,
to_chain
UNION ALL
SELECT
'in' as type,
project,
token,
from_chain,
to_chain,
sum(cast(amount as decimal(38, 0))) as total
FROM
bridge_ethereum.transfers
WHERE
"to" = '0xf99d58e463a2e07e5692127302c20a191861b4d6'
group by
project,
token,
from_chain,
to_chain
```
This query consists of two parts: one part calculates the total amount of funds sent from a specific address (marked as 'out'), and the other part calculates the total amount of funds sent to that address (marked as 'in'). The two parts are combined using UNION ALL to provide a complete view of the total cross-chain transfer amount.
**Query the total liquidity provided by the user for each liquidity pool.**
```sql theme={null}
select
project,
pool,
token_address,
sum(cast(amount as decimal(38, 0)))
from
dex_ethereum.liquidity
where
"from" = '{{UserAddress}}'
or "to" = '{{UserAddress}}'
group by
project,
pool,
token_address
```
**Query for token holdings**
```sql theme={null}
select
*
from
ethereum.erc20_balances b
left join ethereum.token_metas t on t.contract_address = b.contract_address
where
wallet_address = '0x2e12979da9ad061ccc204c00d0e3a477a8cc4aea'
limit
10
```
**Query the total amount of loans and collateral for a user.**
```sql theme={null}
with
lending_raw as (
select
project,
asset,
category,
sum(cast(amount as decimal(38, 0))) as total_amount
from
lending_ethereum.feeds
where
account = '{{UserAddress}}'
group by
project,
asset,
category
)
select
project,
asset,
category,
total_amount / t.decimals as volume,
t.name
from
lending_raw l
left join ethereum.token_metas t on t.contract_address = l.asset
```
DataCloud fundamentally transforms how we interact with blockchain data, offering unprecedented flexibility and efficiency for all Web3 developers. As you embark on this journey of exploration and innovation, Chainbase will be your ultimate partner, guiding you through the ever-evolving realm of Web3 development.
# Write Efficient Queries
Source: https://docs.chainbase.com/resources/platform/features/datacloud/write-efficient-queries
## Tips for writing efficient queries
When you write a query, you want to make sure it runs as efficiently as possible. Here are some tips to help you write efficient queries:
1. **Limit the columns in the `SELECT` clause**: Only request the columns you need, as it reduces the amount of data the query engine needs to process.
2. **Use the `LIMIT` clause**: If you are only interested in a specific number of rows, use the `LIMIT` clause to avoid processing more data than necessary.
3. **Filter early and use predicate pushdown**: Apply filters as early as possible in the query to reduce the amount of data being processed. This takes advantage of predicate pushdown, which pushes filter conditions down to the storage layer, reducing the amount of data read from storage. For example, if you only need data from a specific date range, filter on the date column as early as possible.
4. **Use `UNION ALL` instead of `UNION`**: If youβre combining the results of multiple queries, use `UNION ALL` instead of `UNION` to avoid the overhead of removing duplicate rows.
5. **Only order when necessary**: Ordering results can be computationally expensive. If you donβt need ordered results, avoid using `ORDER BY`.
6. **Always use the actual data while filtering**: Do not use functions on the filter columns: For example, if you want to filter on a date, do not use date\_trunc('day', block\_timestamp) > '2022-01-01'. Instead, use block\_timestamp > '2022-01-01'. The first example will not be able to use the min/max values of the block\_time column to skip entire parquet files or row groups within files while scanning through a table, while the second example will. The same goes for other functions, such as substr, lower, upper etc.
7. **Use `UNION ALL` instead of `OR`**: If you need to combine the results of multiple queries, use `UNION ALL` instead of `OR` to avoid the overhead of removing duplicate rows. For example, instead of using `SELECT * FROM table WHERE column = 'value1' OR column = 'value2'`, use `SELECT * FROM table WHERE column = 'value1' UNION ALL SELECT * FROM table WHERE column = 'value2'`.
8. **User lower-case address directly in SQL**: If you are filtering on an address, use the lower-case address directly in the SQL query. For example, instead of using `SELECT * FROM transactions WHERE from_address = lower('0x1234567890ABCDEF')`, use `SELECT * FROM transactions WHERE from_address = '0x1234567890abcdef'`. This allows the query engine to use the min/max values of the from\_address column to skip entire ORC files or row groups within files while scanning through a table.
# Overview
Source: https://docs.chainbase.com/resources/platform/features/sync/overview
## Introduction

Welcome to our Chainbase Sync service tutorial. This service is designed to offer:
1. **Complete and Accurate Historical Data**: Sync-Service ensures full consistency with the tables in DataCloud, providing complete and precise historical data.
2. **Rapid Historical Data Synchronization**: Our service enables quick synchronization of historical data without relying on RPC, streamlining the process significantly.
3. **Up-to-Date Incremental Blockchain Data**: After synchronizing historical data, Sync-Service continuously updates with real-time incremental blockchain data, tailored to your specific needs.
This guide will help you utilize these features to their fullest potential.
## Before You Begin
* Ensure you have a registered Chainbase account.
* Make sure you have a data source and a target data storage system that you wish to synchronize.
## Step 1: Selecting Your Data Source
* Access the Chainbase Sync-Service interface.
* Choose your data source (e.g., PostgreSQL, MySQL, S3, etc.).
* Enter the details and credentials for your data source.

## Step 2: Configuring Data Flow
* Select the type of data to synchronize (raw data, decoded data, or abstracted data).

* Identify the target system, such as a database or object storage system.

* Set the synchronization frequency and specific data sync options.

## Step 3: Syncing and Monitoring
* Start the data synchronization process.
* Monitor the progress and logs using tools provided by Chainbase.
* Verify the data in the target system to ensure successful synchronization.

## Step 4: Managing and Maintenance
* In the 'Jobs' section of the integration interface, users can observe the current status of each sync job.
* The interface provides controls to pause and restart sync jobs as needed.

## Conclusion
The Chainbase Sync service streamlines the data synchronization process, enabling users to efficiently set up and maintain their data workflows within just two interface pages. With continuous synchronization, users can receive ongoing data updates after the initial sync is complete. The system's flexibility, scalability, and ease of use are evident in the variety of data sources and tables users can choose from, tailored to their specific needs. Furthermore, the conformity of table data formats with DataCloud standards ensures seamless integration and consistency across platforms. This comprehensive service package empowers users to harness real-time data insights effectively.
## Frequently Asked Questions (FAQs)
1. **Is the data synchronized with Chainbase Sync-Service in real-time?**
Yes, Chainbase Sync service supports real-time data synchronization. As changes occur in your data source, they are immediately captured and updated in your target system, ensuring that the data you access is always current.
2. **How is the pricing for synchronization calculated?**
The pricing for synchronization with Chainbase Sync-Service is based on several factors, including the volume of data being synchronized, the frequency of sync jobs, and the number of data sources and destinations configured. For detailed pricing information, please refer to our pricing page or contact our [sales team](https://chainbase.com/contact).
3. **Can I choose to start synchronization from a specific block?**
Currently, the ability to begin synchronization from a specific block index is a feature exclusive to our enterprise users. If you require this level of synchronization control, please reach out to our [sales team](https://chainbase.com/contact) for assistance and information on our enterprise solutions.
# Overview
Source: https://docs.chainbase.com/resources/platform/overview
Welcome to Chainbase Data Platform docs. All-in-one web3 data infrastructure for indexing, transforming, and utilizing large-scale on-chain data.
## What is Chainbase Data Platform?
Chainbase Data Platform is an all-in-one data infrastructure for Web3 that allows you to index, transform, and utilize large-scale on-chain data. It is a platform that provides a suite of tools and services to help you build, manage, and scale your Web3 applications.
By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase Data Platform automates the indexing and querying of blockchain data, enabling developers to accomplish complex data tasks with ease.
## Products & Features
### API - Indexed Data
Chainbase Data Platform provides a powerful API that allows you to access indexed data from the blockchain. The API is designed to be easy to use and provides a wide range of features to help you get the data you need.
### Datasets
Chainbase Data Platform supports a wide range of raw, decoded, and abstracted datasets for you to build next-level apps with cutting-edge protocols today and tomorrow.
### Data Cloud
Data Cloud lets you run your low-latency queries through an endpoint to leverage all our indexed datasets for your custom needs.
### Data Sync - Stream data to your backend
With Data Sync, you can stream the data you need into your own infrastructure in real-time, and then use it to build powerful applications.
# Pricing
Source: https://docs.chainbase.com/resources/platform/pricing/pricing
# Support
Source: https://docs.chainbase.com/resources/platform/support
# Supported Networks
Source: https://docs.chainbase.com/resources/platform/supported-networks/supported-networks
We support the following networks in real-time across multiple data types. More chains and types are being onboarded and will coming soon.
| **Ecosystem** | **Blockchains Supported** | **Raw** | **Decoded** | **Abstracted** | **Web3 API** |
| ------------- | ------------------------- | ------- | ----------- | -------------- | ------------ |
| **EVM** | Ethereum | β | β | β | β |
| | Binance Smart Chain (BSC) | β | β | β | β |
| | Polygon | β | β | β | β |
| | Avalanche (C-Chain) | β | β | β | β |
| | Fantom | β | β | | |
| | Arbitrum | β | β | β | β |
| | Optimism | β | β | β | β |
| | Base | β | β | β | β |
| | Blast | β | β | β | |
| | ZkSync | β | β | β | β |
| | Merlin | β | | | β |
| **Non EVM** | Bitcoin | \* | | β | |
| | Sui | | | β | |
| | Ton | β | β | β | |
| | Tron | β | | | |
| | *Solana\** | \* | \* | \* | \* |