On-chain immutable data storage using IQ Labs tech stack (IQDB, hanLock, x402). Use when building Solana-based persistent storage, on-chain databases, tamper-evident records, password-encoded data, or paid file inscription. Triggers on tasks involving on-chain CRUD, Solana PDA storage, rolling hash verification, Hangul encoding, or HTTP 402 payment-gated inscription.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install iqdb-onchain-storage或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install iqdb-onchain-storage⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/iqdb-onchain-storage/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: iqdb-onchain-storage description: On-chain immutable data storage using IQ Labs tech stack (IQDB, hanLock, x402). Use when building Solana-based persistent storage, on-chain databases, tamper-evident records, password-encoded data, or paid file inscription. Triggers on tasks involving on-chain CRUD, Solana PDA storage, rolling hash verification, Hangul encoding, or HTTP 402 payment-gated inscription. ---
Build on-chain relational databases on Solana using IQ Labs' tech stack. Three tools:
solana --version)solana airdrop 2)9KLLchQVJpGkw4jPuUmnvqESdR7mtNCYr3qS4iQLabs (via @iqlabs-official/solana-sdk).@iqlabsteam/iqdb). Program: 7Vk5JJDxUBAaaAkpYQpWYCZNz4SVPm3mJFSxrBzTQuAX.npm install @iqlabs-official/solana-sdk @solana/web3.js
npm install @iqlabsteam/iqdb @coral-xyz/anchor @solana/web3.js
ANCHOR_WALLET=/path/to/keypair.json # Required — Solana keypair for signing
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com # Required — RPC for writes
NETWORK_URL=https://api.devnet.solana.com # Required — RPC for reads (must match ANCHOR_PROVIDER_URL)
Legacy SDK note: Set NETWORK_URL to match ANCHOR_PROVIDER_URL. The SDK uses separate connections for reads and writes.
RPC Note: Public Solana RPCs rate-limit aggressively. Add 2-3 second delays between rapid transactions on mainnet. Use a dedicated RPC provider (Helius, Alchemy, QuickNode) for production.
const { Connection, Keypair, SystemProgram, PublicKey } = require('@solana/web3.js');
const { writer, reader, setRpcUrl, contract } = require('@iqlabs-official/solana-sdk');
// Monkey-patch for Node v24 Buffer compatibility
const seedModule = require('@iqlabs-official/solana-sdk/dist/sdk/utils/seed');
const origFn = seedModule.toSeedBytes;
seedModule.toSeedBytes = (v) => Buffer.from(origFn(v));
setRpcUrl('https://api.mainnet-beta.solana.com');
const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
// Write a row (requires root + table initialized first — see references/iqdb-core.md)
const sig = await writer.writeRow(
connection, signer, 'my-db-root', 'players',
JSON.stringify({ name: 'Alice', score: '1500', level: '12' })
);
// Read rows
const rows = await reader.readTableRows(tablePda);
// Use CommonJS — the SDK bundles CJS internally
const { createIQDB } = require('@iqlabsteam/iqdb');
const iqdb = createIQDB();
// Ensure root PDA exists (idempotent)
await iqdb.ensureRoot();
// Create a table (idempotent — use ensureTable over createTable)
await iqdb.ensureTable('players', ['name', 'score', 'level'], 'name');
// Write a row — data must be a JSON STRING, not an object
await iqdb.writeRow('players', JSON.stringify({
name: 'Alice', score: '1500', level: '12'
}));
// Read all rows — requires userPubkey as string
const rows = await iqdb.readRowsByTable({
userPubkey: 'YOUR_WALLET_PUBKEY',
tableName: 'players'
});
console.log(rows);
Root PDA (per wallet)
└── Table PDA (per table name)
└── Rows stored as transaction data
└── hash: keccak(domain || prev_hash || tx_data)
ensureRoot().ensureTable() or createTable(). Has column schema and ID column.writeRow(). Append-only — each write is a new transaction.See references/iqdb-core.md for full API.
| Operation | Method | Cost | |-----------|--------|------| | Init root | contract.initializeDbRootInstruction() / ensureRoot() | ~0.01 SOL rent | | Create table | contract.createTableInstruction() / ensureTable() | ~0.02 SOL rent | | Write row | writer.writeRow() / iqdb.writeRow() | ~0.005-0.01 SOL | | Read rows | reader.readTableRows() / readRowsByTable() | Free (RPC read) | | Update/Delete | pushInstruction(table, txSig, before, after) | TX fee only | | Extension table | createExtTable(base, rowId, extKey, cols, idCol?) | ~0.02 SOL rent |
Cost reference (mainnet): Root + 3 tables + 5 data rows = ~0.09 SOL total.
TxTooLong error). For larger data, split across multiple rows or use hanLock sparingly (encoded output is larger than input).writeRow always appends. Use pushInstruction for updates/deletes.readRowsByTable returns raw rows and does NOT reflect updates/deletes from pushInstruction. To see the full picture including corrections, use searchTableByName which returns both rows (raw) and instruRows/targetContent (instruction history). Your application must apply instruction corrections on top of raw rows.require() internally. Use .cjs files or "type": "commonjs" in package.json. ESM imports will fail.See references/hanlock.md for full API.
Encode data with a password before writing on-chain for lightweight privacy:
const { encodeWithPassword, decodeWithPassword } = require('hanlock');
const encoded = encodeWithPassword('short secret', 'mypassword');
// → Korean syllable string like "깁닣뭡..."
// Write encoded data on-chain
await iqdb.writeRow('secrets', JSON.stringify({ owner: 'Alice', data: encoded }));
// Later — decode
const decoded = decodeWithPassword(encoded, 'mypassword');
// → 'short secret'
Note: hanLock encoding expands data size (~3x). Keep input short to stay within the on-chain row size limit.
See references/x402-payments.md for full API.
Payment-gated file inscription to Solana:
POST /quote with file metadata → get price in USDC/SOLPOST /inscribe with payment proof → file chunked into Solana transactionsGET /download/:txId → reconstruct file from on-chain chunks安装 IQDB On-Chain Storage 后,可以对 AI 说这些话来触发它
Help me get started with IQDB On-Chain Storage
Explains what IQDB On-Chain Storage does, walks through the setup, and runs a quick demo based on your current project
Use IQDB On-Chain Storage to on-chain immutable data storage using IQ Labs tech stack (IQDB, han...
Invokes IQDB On-Chain Storage with the right parameters and returns the result directly in the conversation
What can I do with IQDB On-Chain Storage in my developer & devops workflow?
Lists the top use cases for IQDB On-Chain Storage, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/iqdb-onchain-storage/ 目录(个人级,所有项目可用),或 .claude/skills/iqdb-onchain-storage/(项目级)。重启 AI 客户端后,用 /iqdb-onchain-storage 主动调用,或让 AI 根据上下文自动发现并使用。
IQDB On-Chain Storage 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
IQDB On-Chain Storage 可免费安装使用。请查阅仓库了解许可证信息。
On-chain immutable data storage using IQ Labs tech stack (IQDB, hanLock, x402). Use when building Solana-based persistent storage, on-chain databases, tamper-evident records, password-encoded data, or paid file inscription. Triggers on tasks involving on-chain CRUD, Solana PDA storage, rolling hash verification, Hangul encoding, or HTTP 402 payment-gated inscription.
Automate my developer & devops tasks using IQDB On-Chain Storage
Identifies repetitive steps in your workflow and sets up IQDB On-Chain Storage to handle them automatically
IQDB On-Chain Storage 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。