v1.0 · Testnet Alpha

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.

Qanto Testnet is live — Chain ID 0x1234 (decimal: 4660)

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.

RPC Endpoint
https://api.qanto.org/api
Primary JSON-RPC endpoint · EVM-compatible
WebSocket
wss://ws.qanto.org
Real-time subscriptions and event streaming
Block Explorer
https://qanto.org/explorer/
Live block telemetry, transactions, and ABI Studio

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.
Getting Started

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

bash
# 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

bash
npm install @qanto/sdk
typescript
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}`);
💡
Explorer ABI Studio: The fastest way to deploy and call contracts without writing code is the QANTO Explorer ABI Studio. Paste your EVM bytecode and deploy with one click.
Architecture

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.

ascii-diagram
                    /-- (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:

formula
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:

formula
Σ 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.

Architecture

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

ℹ️
Determinism guarantee: Block validity is gated solely on the declared header difficulty (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.
rules
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
Architecture

ΛΣ-Ω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.

⚠️
Key security: Never expose your HMAC_SECRET or validator keys. Store secrets in environment variables, not in source code or config files checked into version control.
Network

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.

All endpoints operational

Primary Endpoints

POST JSON-RPC
https://api.qanto.org/api
Primary JSON-RPC 2.0 endpoint. EVM-compatible. Supports eth_* and qanto_* methods.
GET Health
https://api.qanto.org/api/health
Edge health probe. Returns JSON with uptime, version, and peer count.
GET Node Health
https://api.qanto.org/api/node-health
Full node status: block height, sync progress, active chains, and SAGA metrics.
WS WebSocket
wss://ws.qanto.org
Persistent WebSocket connection for real-time block and transaction event subscriptions.
POST GraphQL
https://graphql.qanto.org
GraphQL API for complex queries across blocks, transactions, and validators.
GET Explorer
https://qanto.org/explorer/
Live block explorer with ABI Studio for deploying and calling smart contracts via the UI.

RPC Failover Matrix

The SDK implements automatic failover across endpoints. Configure multiple RPC URLs for maximum resilience:

typescript
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

typescript
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}`);
});
Network

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)

javascript
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/"],
  }],
});
💡
The QANTO Explorer at qanto.org/explorer/ has a one-click "Add to MetaMask" button under the Chain Identity section.

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)
JSON-RPC API

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

json
{
  "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.)
JSON-RPC API

qanto_deployContract

Deploy EVM-compiled bytecode to the QANTO chain. Returns a transaction hash that can be monitored for receipt confirmation.

POST qanto_deployContract
Deploys EVM bytecode as a new smart contract. The 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

bash
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

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xabc123...def456"  // Transaction hash
}

SDK Usage

typescript
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);
JSON-RPC API

qanto_callContract

Execute a state-mutating call to an existing contract on-chain. Unlike eth_call, this writes to state and costs gas.

POST qanto_callContract
Invokes a function on an already-deployed smart contract. The 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

bash
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

typescript
// 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);
JSON-RPC API

Standard eth_* Methods

QANTO supports the standard EVM JSON-RPC methods used by MetaMask, ethers.js, viem, and other Ethereum tooling.

eth_chainId

bash
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

bash
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

bash
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

bash
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.

Smart Contracts

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.

ℹ️
EVM Compatibility: QANTO runs an EVM execution environment on top of its DAG consensus. Contracts compiled for Ethereum are compatible with QANTO — just point your tooling at the QANTO RPC URL.

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:

env — .env
PRIVATE_KEY=0xYourPrivateKeyHere

Then, add QANTO as a named network in your config:

javascript — hardhat.config.js
// hardhat.config.js
module.exports = {
  solidity: "0.8.24",
  networks: {
    qanto: {
      url: "https://api.qanto.org/api",
      chainId: 4660,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};
bash
# 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:

typescript
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);
}
Smart Contracts

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.

💡
The ABI Studio generates the raw qanto_callContract JSON-RPC payload. You can copy it and use it directly in your backend for automation.
json — Generated ABI Studio payload
{
  "jsonrpc": "2.0",
  "method": "qanto_callContract",
  "params": [
    "0xCallerAddress",
    "0xContractAddress",
    "0xa9059cbb...",  // ABI-encoded calldata
    500000
  ],
  "id": 1
}
SDK

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

bash
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

typescript
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"
ℹ️
TypeScript support: The SDK ships with full TypeScript declarations. Import types like QantoBlock, QantoTransaction, and QantoTransactionReceipt from @qanto/sdk.