Skip to content

Documentation

Everything you needto sign, verify, and audit.

Technical reference for the Forrel web app, forrel CLI, @forrel/core encoders, and ForrelRegistry on QoreChain Diana.
01

Overview

Forrel is an append-only release and firmware signing log on QoreChain's Diana testnet (chain 9800). Maintainers publish SHA3-256 artifact fingerprints signed with ML-DSA-87 keys. Before any record enters storage, ForrelRegistry calls QoreChain's native pqcVerify precompile (0x0000…0a01) so unsigned or forged records are rejected on-chain.

01

Fingerprint

Streaming SHA3-256 (FIPS 202) computed locally in a Web Worker or Node stream.

02

Sign

Pure ML-DSA-87 (FIPS 204, empty context) over packed domain-separated bytes.

03

Verify

Wallet-free eth_call lookup + live pqcVerify signature re-check.

02

Quickstart

Verify any release in the browser without a wallet, or sign offline and publish from CI using the forrel CLI. The CLI is not on npm yet: run these from the root of a clone of the repository, after npm install.

npx forrel keygen --out ./signing.forrel-key.json
npx forrel sign ./dist/app.bin --project acme-router --version 2.4.1 --key ./signing.forrel-key.json --seq 1
npx forrel publish ./dist/app.bin.forrel.json && npx forrel verify ./dist/app.bin
03

What is post-quantum, and what isn't

Release signatures
Post-quantum (ML-DSA-87, FIPS 204), verified on-chain via pqcVerify.
Artifact & notes hashes
Post-quantum safe (SHA3-256, 256-bit preimage resistance).
QoreChain account
Hybrid secp256k1 + ML-DSA-87 key registered with pqcKeyStatus.
EVM tx transport
Classical secp256k1 gas payer, but it holds zero release authority without ML-DSA-87.
Network availability
Diana testnet only; pqcVerify is not on mainnet yet.
04

CLI Reference

forrel keygen --out <file>

Generate an ML-DSA-87 keypair and save an encrypted keyfile.

Offline
forrel hash <file>

Stream-hash a file with SHA3-256 (0x…).

Offline
forrel sign <file> --project <slug> --version <v> --key <keyfile> [--seq <n>]

Create <file>.forrel.json. Fetches nextSeq online unless --seq is supplied.

Offline-capable
forrel publish <bundle.json>

Submit a signed bundle using FORREL_SUBMITTER_KEY.

Online
forrel verify <file> [--project <slug>] [--json]

Verify file against ForrelRegistry + live pqcVerify. Exits 0/1/2/3.

Read-only
forrel rotate --project <slug> --key <keyfile> [--recovery] --out <newkey>

Rotate the project signing key via current or recovery key.

Online
forrel revoke --project <slug> --version <v> --reason <0-3> --key <keyfile>

Revoke an existing release on-chain.

Online
Verify exit codes: 0 verified, 1 unknown, 2 revoked, 3 error (bad args, missing file, RPC failure, or PrecompileUnavailable).
FORREL_RPC
JSON-RPC endpoint (default https://evm-testnet.qore.host).
FORREL_REGISTRY
Deployed ForrelRegistry address (auto-reads deployments/diana.json if present).
FORREL_SUBMITTER_KEY
0x-prefixed secp256k1 private key with an open Diana EVM window.
FORREL_PASSPHRASE
Keyfile passphrase for non-interactive CI (falls back to hidden prompt).
05

Bundles & Keyfiles

Keyfiles encrypt only the 32-byte seed using scrypt (N=131072, r=8, p=1) and AES-256-GCM with AAD forrel-keyfile/v1; the expanded 4,896-byte secret key is derived in memory and zeroed after signing. Signed bundles (*.forrel.json) carry the base64 signature, sequence number, and hashes for separated offline signing and CI publishing.

06

Architecture & SSTORE2 Storage

Testnet nodes prune historical event logs. To keep verification durable without an indexer or database, ForrelRegistry writes every 2,592-byte public key and 4,627-byte signature into contract bytecode using SSTORE2 pointers. Verdicts and live signature re-checks read strictly from contract state.

07

Signed Message Spec

Messages are abi.encodePacked byte sequences prefixed with a domain tag. Shared test vectors in packages/core/vectors/ pin TypeScript and Solidity together.

FORREL/v1/PUBLISH

Records a release hash and metadata hash. Signed by the current signing key.

#FieldTypeBytes
01"FORREL/v1/PUBLISH"bytes (utf-8)17
02chainIduint25632
03registryaddress20
04projectIdbytes3232
05sequint648
06versionHashbytes3232
07artifactHashbytes3232
08metaHashbytes3232
Total205

FORREL/v1/ROTATE

Replaces the active signing key. Signed by the current key or offline recovery key.

#FieldTypeBytes
01"FORREL/v1/ROTATE"bytes (utf-8)16
02chainIduint25632
03registryaddress20
04projectIdbytes3232
05keyEpochuint324
06newPubkeyHashbytes3232
07viaRecoverybool1
Total137

FORREL/v1/REVOKE

Marks a release as revoked with a reason code (0–3). Signed by the current signing key.

#FieldTypeBytes
01"FORREL/v1/REVOKE"bytes (utf-8)16
02chainIduint25632
03registryaddress20
04projectIdbytes3232
05releaseIduint25632
06reasonuint81
Total133
08

ForrelRegistry Contract

pqcVerify precompile
0x0000000000000000000000000000000000000a01
pqcKeyStatus precompile
0x0000000000000000000000000000000000000a02 (4-tuple return)
registerProject
~1.4M gas (2x SSTORE2 pubkeys, requires possessionProven)
publish
~1.3M gas (pqcVerify + SSTORE2 signature + state)
rotateKey
~0.8M gas (current or recovery key)
revoke
~0.15M gas (marks release revoked with reason 0–3)
09

Threat Model

Quantum forgery of release signatures

All release authority uses ML-DSA-87 verified on-chain by pqcVerify; classical keys never authorize releases.

Leaked classical EVM submitter key

The submitter key only pays gas. It cannot publish, rotate, or revoke without a valid ML-DSA-87 signature.

Compromised signing key

Revoke affected releases, then rotate to a fresh signing key using your offline recovery key.

Cross-chain or sequence replay

Every signed message binds chainId, registry address, projectId, and seq or keyEpoch.

Compromised download page or web UI

Users hash files locally, Re-check runs raw eth_call, and the CLI verifies independently.

Testnet log pruning

All public keys, signatures, and rotation records live in contract storage (SSTORE2), never relying on logs.