Skip to content

Latest commit

 

History

History
88 lines (65 loc) · 3.01 KB

File metadata and controls

88 lines (65 loc) · 3.01 KB

For Developers

How to use the Quantova tools to build, with the common workflows and where each tool fits. Every workflow below is post-quantum by default — your transactions are signed with Dilithium, Falcon, or SPHINCS+ and verified on-chain as a QSignature.

Set up

npm install qweb3.js      # or: pip install qweb3
export QUANTOVA_RPC=https://testnet.quantova.io

Get a wallet (QMask) and free TQTOV (Qtox.io) as in getting-started.md.

Read state

from qweb3 import QWeb3
q = QWeb3("https://testnet.quantova.io")
block = q.rpc.block_number()
bal = q.rpc.get_balance("Qf2t7p9C5Im4waDJUgrrMqVt3Hs8=")
const { QWeb3 } = require('qweb3.js');
const q = new QWeb3('https://testnet.quantova.io');
const block = await q.rpc.blockNumber();
const bal = await q.rpc.getBalance('Qf2t7p9C5Im4waDJUgrrMqVt3Hs8=');

Full runnable: ../examples//connect..

Send a transaction (post-quantum signed)

# qweb3.py — derive a PQ account and sign a transfer
from qweb3 import QWeb3
q = QWeb3("https://testnet.quantova.io")
sender = q.wallet.create("dilithium")          # address begins with 'Q'
sig = q.wallet.sign_transaction(payload, sender.address)   # post-quantum signature

A real app registers Quantova's native post-quantum backend (the @quantova modules) and submits via the client; the wallet API is the same shape shown in the examples. See ../examples/python/transfer.py and ../examples/javascript/transfer.js.

Work with QVM contracts

The QVM speaks the standard Solidity ABI (keccak-256 selectors and event topics), so your existing Solidity tooling applies — only the transaction signature is post-quantum.

token = q.contract(QRC20_ABI, TOKEN_ADDRESS)
balance = token.call("balanceOf", [HOLDER])           # decoded automatically
data = token.encode("transfer", [HOLDER, 25 * 10**18])  # calldata to sign + send

Full runnable: ../examples/python/contract_call.py.

Resolve and use names (QNS)

qns = q.qns(QNS_REGISTRY)
addr = qns.resolve("alice.qtov")     # -> a Q-address

Full runnable: ../examples/python/qns_resolve.py. Register names at Qname.io.

Verify your implementation

Before you ship, check your code against the protocol with the verification tools:

  • pq-test-vectors — confirm your address derivation, hashing, ABI selectors, namehash, and signatures match known-answer vectors.
  • node-conformance-tests — confirm the node you build against is the canonical runtime with healthy finality.
  • reproducible-builds — confirm a node binary or runtime WASM matches a signed release before you run it.

Reference

  • Endpoints, genesis, and chain specs: the chain-specs tool.
  • Snippets for quick copy-paste: ../snippets.
  • Patterns and full programs: the examples tool and ../examples.