QoreChain integration
QoreChain Diana (qorechain-diana, EVM chain ID 9800) supplies Knock’s identity bindings, post-quantum encryption and signatures, policy commitments, metered pass purchases, and authoritative session revocations.
Libraries and chain endpoints
Section titled “Libraries and chain endpoints”| Integration | Role in Knock |
|---|---|
github.com/qorechain/qoreseal/go |
Hybrid ML-KEM-1024 + X25519 registered-recipient encryption for Door/Approver envelopes, one-time direct-recipient response sealing, and group-epoch audit Receipts. |
github.com/qorechain/qoresign/go & qorechain-pqc |
Registered hybrid ML-DSA-87 + secp256k1 account bindings, native hybrid transactions, signed Door Cards, manifests, Entry Passes, and host status messages. |
| Diana REST / RPC / EVM endpoints | https://api-testnet.qore.host, https://rpc-testnet.qore.host, and https://evm-testnet.qore.host. knockd verifies chain ID, block freshness (<= 30s), and pinned registry bytecode hash before trusting reads. |
KnockRegistry (contracts/src/KnockRegistry.sol)
Section titled “KnockRegistry (contracts/src/KnockRegistry.sol)”KnockRegistry is an immutable Solidity 0.8.28 contract deployed on Diana EVM (9800). Every security-sensitive mutation (register, updatePolicy, revoke, setOffer, purchasePass, consumePass) verifies a domain-separated (knock-registry-v1) ML-DSA-87 signature directly on-chain using QoreChain’s native precompiles:
pqcKeyStatusat0x0000000000000000000000000000000000000a02: verifies that the signer has a registered, possession-proven ML-DSA-87 public key (2592bytes,algorithmId == 1).pqcVerifyat0x0000000000000000000000000000000000000a01: verifies the4627-byte ML-DSA-87 signature over the ABI-encoded action, chain ID, contract address, signer,doorId, action details, per-signer nonce, and deadline.
Classical ECDSA msg.sender alone cannot register a Door, update policy, revoke a session, set an offer, purchase a pass, or consume a pass.
| Method | Who signs | Purpose |
|---|---|---|
register |
Owner + Door account | Binds doorId, owner, Door account, and policy v1 commitment. |
updatePolicy |
Owner | Advances policy version monotonically and updates commitment and approvers. |
revoke |
Owner or eligible approver | Permanently marks (doorId, sessionRef) revoked. |
setOffer |
Owner (metered Door) | Publishes fixed duration (<= 3600s), price in wei (% 1e12 == 0), and beneficiary. |
purchasePass |
Buyer (payable) |
Escrows exact msg.value, records non-transferable purchase bound to request commitment, and transfers funds to beneficiary via checks-effects-interactions. |
consumePass |
Door account | Atomically marks purchase sessionRef before connection issuance so a purchase can never be redeemed twice. |
Verified Diana testnet deployment
Section titled “Verified Diana testnet deployment”Both Approval and Metered Doors are verified against KnockRegistry on QoreChain Diana at 0xd80502c7dfe2a29a087118b81549b9cb267f3b0d. Select Testnet in the QoreChain Dashboard to inspect these transactions: