QANTO Developer Documentation
Everything you need to build on the QANTO Layer-0 quantum-resistant blockchain. Explore the architecture, connect to the network, deploy smart contracts, and interact with the JSON-RPC API.
What is QANTO?
QANTO is a Layer-0 blockchain protocol engineered for a post-quantum world. It features a Directed Acyclic Graph (DAG) architecture with dynamic sharding, a hybrid PoW+PoS consensus mechanism augmented by the SAGA-AI governance layer, and the ΛΣ-ΩMEGA™ post-quantum cryptographic framework using CRYSTALS-Dilithium signatures.
Core Concepts
| Concept | Description |
|---|---|
| QantoDAG | Directed Acyclic Graph where each block references multiple parents, enabling parallel processing and >50,000 TPS sustained throughput. |
| SAGA-AI | Systematic AI Governance Architecture — the on-chain intelligence layer that dynamically adjusts PoW difficulty, manages the Saga Credit Score, and governs the network autonomously. |
| ΛΣ-ΩMEGA™ | Modular post-quantum cryptographic suite: CRYSTALS-Dilithium (signatures), Kyber (key encapsulation), with hybrid classical+PQC support during transition. |
| QNTO |
The native currency. 21 billion total supply with 6
decimals. Disinflationary emission (12.5% reduction every
3 months). Chain ID: 0x1234
|
| Qanhash PoW | Memory-hard, ASIC-resistant proof-of-work algorithm based on a dynamically-generated Q-DAG dataset. GPU-accelerated via CUDA/OpenCL kernels. |
Quick Start
Connect to the QANTO Testnet and make your first RPC call in under 5 minutes.
1. Add QANTO to MetaMask
Open MetaMask → Networks → Add a network manually:
| Field | Value |
|---|---|
| Network Name | Qanto Testnet |
| New RPC URL | https://api.qanto.org/api |
| Chain ID | 4660 (hex: 0x1234) |
| Currency Symbol | QNTO |
| Block Explorer URL | https://qanto.org/explorer/ |
2. Test RPC Connectivity
# Check chain ID
curl -s -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
# Expected response:
# {"jsonrpc":"2.0","id":1,"result":"0x1234"}
# Get latest block number
curl -s -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
3. Install the JavaScript SDK
npm install @qanto/sdk
import { QantoClient, DEFAULT_ENDPOINTS, NETWORKS } from "@qanto/sdk";
const client = new QantoClient({
endpoint: DEFAULT_ENDPOINTS[NETWORKS.TESTNET].http,
});
const blockNumber = await client.provider.getBlockNumber();
console.log(`Latest block: ${blockNumber}`);
DAG Architecture
QANTO uses a Directed Acyclic Graph (DAG) structure where blocks can have multiple parents, enabling massively parallel transaction processing without the sequential bottleneck of linear chains.
QantoDAG — The Core Data Structure
Unlike a traditional blockchain where each block has exactly one parent, a QantoBlock can reference and confirm multiple parent blocks. This creates a multi-dimensional interwoven mesh that scales naturally with network participation.
/-- (B5) --\
(T1) --(B1) -- (B3) -- (B6) -- [C1: Checkpoint] --> Finalized
\-- (B2) --/ /
\-- (B4) --/
B1-B6: Parallel QantoBlocks C1: Validator Checkpoint (finalizes all prior blocks)
Dynamic Sharding
The network automatically creates new DAG shards when load on any shard exceeds a threshold multiple (α) of the network-wide average:
If ∃i ∈ [0,N-1] such that L_i > α · (1/N) · Σ L_j → initiate_shard_creation()
L_i = load on shard i
N = current number of active shards
α = SHARD_THRESHOLD constant
| Property | Value |
|---|---|
| Peak Throughput | 320,000 tx/block (80 MB blocks) |
| Sustained TPS | 50,000+ transactions/second |
| Finality | <100ms average |
| Cross-shard Settlement | 2–5 seconds |
| Sharding Model | Dynamic (auto-scales on load) |
State Model: UTXO
QANTO uses the UTXO model for state transitions. A transaction is valid when the sum of its inputs is greater than or equal to the sum of its outputs:
Σ value(u ∈ Inputs) ≥ Σ value(v ∈ Outputs)
This provides advantages over account-based models: better privacy, no global state contention, and natural support for parallel processing.
Hybrid Consensus
QANTO uses a three-layer consensus mechanism: PoW for permissionless block proposal, PoS as a finality helper, and SAGA-AI's PoSe for intelligent reputation-weighted difficulty.
The Three Layers
| Layer | Mechanism | Role |
|---|---|---|
| Primary Finality | Proof-of-Work (PoW) | Permissionless block proposal. Computationally expensive to rewrite history. Uses the quantum-resistant Qanhash algorithm. |
| Finality Helper | Proof-of-Stake (PoS) | Validator overlay signals economic confidence in blocks. Low-stake validators get "low confidence" warnings. Also called PoW². |
| Intelligence Layer | Proof-of-Stake/Effort (PoSe) | SAGA-AI adjusts PoW difficulty per miner based on their Saga Credit Score. Higher SCS = lower effective difficulty. |
SAGA Credit Score (SCS)
Every validator has a dynamic SCS from 0.0 to 1.0 based on:
- AI Trust Score — BehaviorNet model analysis of block validity and contributions
- Long-term Karma — Positive ecosystem contributions and governance track record
- Staked QNTO — Economic skin-in-the-game
- Environmental Score — Proof-of-Carbon-Offset (PoCO) participation
| SCS Range | Reward Multiplier |
|---|---|
| 0.8 – 1.0 | >1.0× (amplified rewards for honest high-performance nodes) |
| 0.5 – 0.8 | ~1.0× (standard rewards) |
| <0.5 | <1.0× (penalized — suspect or poor-performing) |
PoW Validity Semantics
D_decl).
SAGA's effective difficulty (D_eff) is diagnostic
only — it never affects acceptance. This ensures nodes with
different local SAGA states produce identical validity outcomes.
1. Block is VALID iff H(block) meets target derived from D_decl
2. D_eff (SAGA-computed) only triggers WARN logs when D_eff ≠ D_decl
3. If D_decl ≤ 0.0 → block REJECTED with consensus error
ΛΣ-ΩMEGA™ Cryptography
A modular post-quantum cryptographic framework providing quantum-resistant signatures, key encapsulation, and a hybrid transition path from classical to post-quantum primitives.
Cryptographic Suite
| Primitive | Algorithm | Purpose |
|---|---|---|
| Digital Signatures | CRYSTALS-Dilithium (NIST PQC) | Validator attestations, P2P authentication |
| Key Encapsulation | Kyber (NIST PQC) | Session key exchange |
| Hashing | Qanhash32x (Keccak-f[1600]) | Block hashing, Merkle trees, tx IDs |
| Proof-of-Work | Qanhash (memory-hard Q-DAG) | Block proposal, ASIC resistance |
| Privacy (optional) | ZK-SNARKs (Groth16/Bellman) | Shielded transactions |
P2P Authentication
Node-to-node connections use HMAC-SHA256 with a shared
HMAC_SECRET for network-level authentication.
Validator attestations use CRYSTALS-Dilithium lattice signatures
to ensure quantum-resistant P2P security even against a
Shor-algorithm-capable adversary.
HMAC_SECRET or validator keys. Store secrets in
environment variables, not in source code or config files
checked into version control.
Network Endpoints
QANTO operates a resilient multi-region endpoint infrastructure. The primary API is edge-routed via Hugging Face Spaces with Cloudflare Pages serving the frontend.
Primary Endpoints
RPC Failover Matrix
The SDK implements automatic failover across endpoints. Configure multiple RPC URLs for maximum resilience:
import { QantoClient } from "@qanto/sdk";
const client = new QantoClient({
endpoint: "https://api.qanto.org/api",
fallbackEndpoints: [
"https://api.qanto.org/api", // Primary (Hugging Face, US-East)
"https://api.qanto.org/api", // Secondary (auto-routed via CF)
],
timeout: 10000, // 10s per request
retries: 3,
});
WebSocket Subscriptions
import { QantoWebSocket } from "@qanto/sdk";
const ws = new QantoWebSocket({ url: "wss://ws.qanto.org" });
await ws.connect();
// Subscribe to new blocks
ws.on("block", (block) => {
console.log(`New block #${block.height} on chain ${block.chainId}`);
});
// Subscribe to pending transactions
ws.on("transaction", (tx) => {
console.log(`Pending tx: ${tx.hash}`);
});
Chain Configuration
Complete network parameters for integrating QANTO Testnet into wallets, dApps, and infrastructure.
Testnet Parameters
| Parameter | Value |
|---|---|
| Network Name | Qanto Testnet |
| Chain ID (hex) | 0x1234 |
| Chain ID (decimal) | 4660 |
| Currency Name | QNTO |
| Currency Symbol | QNTO |
| Decimals | 18 |
| RPC URL | https://api.qanto.org/api |
| WebSocket URL | wss://ws.qanto.org |
| Block Explorer | https://qanto.org/explorer/ |
Add to MetaMask (Programmatic)
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: "0x1234",
chainName: "Qanto Testnet",
nativeCurrency: {
name: "QNTO",
symbol: "QNTO",
decimals: 18,
},
rpcUrls: ["https://api.qanto.org/api"],
blockExplorerUrls: ["https://qanto.org/explorer/"],
}],
});
Economic Parameters
| Parameter | Value |
|---|---|
| Total Supply | 21,000,000,000 QNTO |
| Initial Block Reward | 2.5 QNTO/checkpoint |
| Reduction Period | Every 3 months (7,776,000 seconds) |
| Reduction Factor | 12.5% per period (×0.875) |
| Developer Fee | 10% of block reward (configurable) |
RPC Overview
QANTO exposes a JSON-RPC 2.0 API at
https://api.qanto.org/api. All requests use HTTP
POST with Content-Type: application/json.
Request Format
{
"jsonrpc": "2.0",
"method": "<method_name>",
"params": [/* ordered parameters */],
"id": 1
}
Available Methods
| Method | Type | Description |
|---|---|---|
eth_chainId |
Standard | Returns 0x1234 |
eth_blockNumber |
Standard | Latest block height |
eth_getBalance |
Standard | QNTO balance for address |
eth_getTransactionReceipt |
Standard | Transaction receipt by hash |
eth_call |
Standard | Read-only contract call |
eth_sendRawTransaction |
Standard | Broadcast signed transaction |
qanto_deployContract |
Native | Deploy EVM bytecode to QANTO chain |
qanto_callContract |
Native | Write-mode contract call with gas |
qanto_getContractCreationTx |
Native | Get deployment tx hash for a contract address |
qanto_networkStatus |
Native | Full network telemetry snapshot |
Error Codes
| Code | Meaning |
|---|---|
-32700 |
Parse error — invalid JSON |
-32600 |
Invalid request |
-32601 |
Method not found |
-32602 |
Invalid params |
-32000 |
Server error (insufficient gas, invalid bytecode, etc.) |
qanto_deployContract
Deploy EVM-compiled bytecode to the QANTO chain. Returns a transaction hash that can be monitored for receipt confirmation.
from address must be unlocked or the transaction
pre-signed. Returns the transaction hash of the deployment
transaction.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 0 | from |
string | Yes | Deployer address (hex, 20 bytes) |
| 1 | bytecode |
string | Yes | Hex-encoded EVM bytecode (0x-prefixed). Max 49,152 bytes. |
| 2 | constructorArgs |
array | No |
ABI-encoded constructor arguments (usually
[])
|
| 3 | gasLimit |
number | No | Gas limit. Range: 21,000–10,000,000. Default: 5,000,000. |
| 4 | vmType |
string | No | VM type. Currently only "evm". |
Request Example
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "qanto_deployContract",
"params": [
"0xYourAddressHere",
"0x608060405234801561001057600080fd5b50...",
[],
5000000,
"evm"
],
"id": 1
}'
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xabc123...def456" // Transaction hash
}
SDK Usage
import { QantoProvider, Wallet } from "@qanto/sdk";
const provider = new QantoProvider({ url: "https://api.qanto.org/api" });
const wallet = new Wallet({ address: "0xYourAddress" });
const txHash = await wallet.deployContract(provider, "0x608060...");
// Wait for confirmation (polls every 2s, 120s timeout)
const receipt = await provider.waitForTransactionReceipt(txHash);
console.log("Contract deployed at:", receipt.contractAddress);
qanto_callContract
Execute a state-mutating call to an existing contract on-chain.
Unlike eth_call, this writes to state and costs
gas.
data field should be the ABI-encoded function
selector + arguments.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 0 | from |
string | Yes | Caller address (hex, 20 bytes) |
| 1 | to |
string | Yes | Contract address (hex, 20 bytes) |
| 2 | data |
string | No |
ABI-encoded calldata (0x-prefixed). Max 131,072 bytes.
Use 0x for QNTO transfer.
|
| 3 | gasLimit |
number | No | Gas limit. Range: 21,000–5,000,000. Default: 500,000. |
Request Example
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "qanto_callContract",
"params": [
"0xYourAddress",
"0xContractAddress",
"0xa9059cbb000000000000000000000000RecipientAddr000000000000000000000000000001",
500000
],
"id": 1
}'
SDK Usage
// Call a transfer(address,uint256) function
const selector = "0xa9059cbb"; // keccak256("transfer(address,uint256)")[0:4]
const calldata = selector + encodedArgs;
const txHash = await wallet.callContract(
provider,
"0xContractAddress",
calldata,
500000 // gasLimit
);
const receipt = await provider.waitForTransactionReceipt(txHash);
Standard eth_* Methods
QANTO supports the standard EVM JSON-RPC methods used by MetaMask, ethers.js, viem, and other Ethereum tooling.
eth_chainId
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
# → {"jsonrpc":"2.0","id":1,"result":"0x1234"}
eth_getBalance
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getBalance",
"params":["0xYourAddress","latest"],
"id":1
}'
# → {"jsonrpc":"2.0","id":1,"result":"0xde0b6b3a7640000"}
# result is in wei; divide by 1e18 for QNTO
eth_blockNumber
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
eth_getTransactionReceipt
curl -X POST https://api.qanto.org/api \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getTransactionReceipt",
"params":["0xTxHash"],
"id":1
}'
Returns a receipt object with status (0x1 = success),
contractAddress (for deployments),
gasUsed, and logs.
Deploy Your First Smart Contract
QANTO supports EVM-compatible smart contracts. You can deploy any standard Solidity/Vyper contract — or use the Explorer ABI Studio for a no-code deployment experience.
Method 1: Explorer ABI Studio (No-Code)
The fastest way to deploy. Open the QANTO Explorer, scroll to the ABI Studio section, and paste your bytecode.
Get your compiled bytecode
Compile your Solidity contract with Remix, Hardhat, or
Foundry. Copy the bytecode field from the
compiler output (0x-prefixed hex).
Connect your wallet
Click Connect Wallet in the Explorer
header. MetaMask will prompt you to switch to Qanto Testnet
(Chain ID 0x1234).
Paste bytecode and deploy
Paste your EVM bytecode into the left pane of the ABI Studio. Click Deploy Contract. Confirm the transaction in MetaMask.
Get contract address
After confirmation, the ABI Studio shows your contract address and creation tx hash. You can then call functions via the right pane.
Method 2: Hardhat / Foundry
First, create a .env file in your project root with your private key:
PRIVATE_KEY=0xYourPrivateKeyHere
Then, add QANTO as a named network in your config:
// hardhat.config.js
module.exports = {
solidity: "0.8.24",
networks: {
qanto: {
url: "https://api.qanto.org/api",
chainId: 4660,
accounts: [process.env.PRIVATE_KEY],
},
},
};
# Deploy with Hardhat
npx hardhat run scripts/deploy.js --network qanto
# Or with Foundry / Forge
forge create --rpc-url https://api.qanto.org/api \
--private-key $PRIVATE_KEY \
src/MyContract.sol:MyContract
Method 3: Direct RPC Call
For programmatic deployment without a framework:
import { QantoProvider, Wallet } from "@qanto/sdk";
import { readFileSync } from "fs";
const provider = new QantoProvider({ url: "https://api.qanto.org/api" });
const wallet = new Wallet({ address: process.env.WALLET_ADDRESS });
// Read compiled bytecode
const artifact = JSON.parse(readFileSync("./out/MyContract.sol/MyContract.json"));
const bytecode = artifact.bytecode.object;
try {
const txHash = await wallet.deployContract(provider, bytecode, 5_000_000);
console.log("Deploy tx:", txHash);
const receipt = await provider.waitForTransactionReceipt(txHash);
console.log("Contract address:", receipt.contractAddress);
} catch (err) {
console.error("Deployment failed:", err.message);
}
ABI Studio
The QANTO Explorer includes a built-in ABI Studio — a visual interface for deploying EVM bytecode and calling contract functions without writing any code.
What the ABI Studio Does
- Deploy contracts — paste raw EVM bytecode and deploy with MetaMask in one click
- Call functions — provide a contract address + ABI JSON to interactively call read and write functions
- Read receipts — view transaction hash, gas used, contract address, and status immediately after deployment
Using Function Call Mode
To call functions on an already-deployed contract:
Enter contract address
Paste the deployed contract address into the Contract Address field in the right pane of the ABI Studio.
Paste ABI JSON
Paste the contract ABI (from Remix or your build artifacts) into the ABI field. The Studio will parse and display all available functions.
Select function and enter parameters
Pick a function from the dropdown, fill in parameters, and click Execute. Read-only functions show the return value; state-mutating functions prompt MetaMask for signature.
qanto_callContract JSON-RPC payload. You can copy
it and use it directly in your backend for automation.
{
"jsonrpc": "2.0",
"method": "qanto_callContract",
"params": [
"0xCallerAddress",
"0xContractAddress",
"0xa9059cbb...", // ABI-encoded calldata
500000
],
"id": 1
}
JavaScript / TypeScript SDK
The official @qanto/sdk package provides a
full-featured client for interacting with the QANTO network from
Node.js and browser environments.
Installation
npm install @qanto/sdk
# or
yarn add @qanto/sdk
Core Classes
| Class | Description |
|---|---|
QantoClient |
High-level client. Wraps provider, WebSocket, and wallet. |
QantoProvider |
Low-level JSON-RPC provider. Use for direct RPC calls. |
QantoWebSocket |
WebSocket client with auto-reconnect and typed events. |
Wallet |
Wallet abstraction. Wraps deployContract and callContract with error handling. |
Full Client Example
import {
QantoClient,
QantoWebSocket,
DEFAULT_ENDPOINTS,
NETWORKS,
QANTO_TESTNET_CHAIN,
} from "@qanto/sdk";
// Initialize client
const client = new QantoClient({
endpoint: DEFAULT_ENDPOINTS[NETWORKS.TESTNET].http,
});
// Get network info
const chainId = await client.provider.getChainId();
const blockNum = await client.provider.getBlockNumber();
console.log(`Chain: ${chainId} | Block: ${blockNum}`);
// Subscribe to real-time blocks
const ws = new QantoWebSocket({
url: DEFAULT_ENDPOINTS[NETWORKS.TESTNET].websocket,
});
await ws.connect();
ws.on("block", (block) => {
console.log(`Block ${block.height}: ${block.transactionCount} txs`);
});
// QANTO_TESTNET_CHAIN has all MetaMask network params
console.log(QANTO_TESTNET_CHAIN.chainId); // "0x1234"
console.log(QANTO_TESTNET_CHAIN.rpcUrls[0]); // "https://api.qanto.org/api"
QantoBlock, QantoTransaction, and
QantoTransactionReceipt from
@qanto/sdk.