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.
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.jsonnpx forrel sign ./dist/app.bin --project acme-router --version 2.4.1 --key ./signing.forrel-key.json --seq 1npx forrel publish ./dist/app.bin.forrel.json && npx forrel verify ./dist/app.binWhat 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.
CLI Reference
forrel keygen --out <file>Generate an ML-DSA-87 keypair and save an encrypted keyfile.
forrel hash <file>Stream-hash a file with SHA3-256 (0x…).
forrel sign <file> --project <slug> --version <v> --key <keyfile> [--seq <n>]Create <file>.forrel.json. Fetches nextSeq online unless --seq is supplied.
forrel publish <bundle.json>Submit a signed bundle using FORREL_SUBMITTER_KEY.
forrel verify <file> [--project <slug>] [--json]Verify file against ForrelRegistry + live pqcVerify. Exits 0/1/2/3.
forrel rotate --project <slug> --key <keyfile> [--recovery] --out <newkey>Rotate the project signing key via current or recovery key.
forrel revoke --project <slug> --version <v> --reason <0-3> --key <keyfile>Revoke an existing release on-chain.
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).
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.
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.
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.
| # | Field | Type | Bytes |
|---|---|---|---|
| 01 | "FORREL/v1/PUBLISH" | bytes (utf-8) | 17 |
| 02 | chainId | uint256 | 32 |
| 03 | registry | address | 20 |
| 04 | projectId | bytes32 | 32 |
| 05 | seq | uint64 | 8 |
| 06 | versionHash | bytes32 | 32 |
| 07 | artifactHash | bytes32 | 32 |
| 08 | metaHash | bytes32 | 32 |
| Total | 205 | ||
FORREL/v1/ROTATE
Replaces the active signing key. Signed by the current key or offline recovery key.
| # | Field | Type | Bytes |
|---|---|---|---|
| 01 | "FORREL/v1/ROTATE" | bytes (utf-8) | 16 |
| 02 | chainId | uint256 | 32 |
| 03 | registry | address | 20 |
| 04 | projectId | bytes32 | 32 |
| 05 | keyEpoch | uint32 | 4 |
| 06 | newPubkeyHash | bytes32 | 32 |
| 07 | viaRecovery | bool | 1 |
| Total | 137 | ||
FORREL/v1/REVOKE
Marks a release as revoked with a reason code (0–3). Signed by the current signing key.
| # | Field | Type | Bytes |
|---|---|---|---|
| 01 | "FORREL/v1/REVOKE" | bytes (utf-8) | 16 |
| 02 | chainId | uint256 | 32 |
| 03 | registry | address | 20 |
| 04 | projectId | bytes32 | 32 |
| 05 | releaseId | uint256 | 32 |
| 06 | reason | uint8 | 1 |
| Total | 133 | ||
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)
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.