/ Docs

How Qlarc works

Qlarc is a quantum-safe, document-conditioned letter of credit. The contract enforces who approved what, which document was disclosed, and whether payment and its public Native receipt happened in the same transaction. It does not judge whether the document is genuine.

Two lanes

EVM lane

One immutable contract: fUSD escrow, five roles, six states, ML-DSA-87 signature checks, Merkle inclusion, approvals, dispute, arbitration, and bounded liveness.

Native lane

Every transition writes a ≤140-byte canonical note to the allowlisted qday-receipts contract through CrossVM. The verifier matches each note to a Native transaction from the LC contract's qor1 address.

Lifecycle

  1. 1

    Create

    The applicant and issuing bank both sign the canonical terms. The applicant escrows fUSD. The contract fixes five role addresses and writes a CREA note to qday-receipts.

  2. 2

    Accept

    The beneficiary signs the acceptance digest before expiry. State moves to Accepted and an ACCP note is written.

  3. 3

    Present

    The beneficiary commits a Merkle root over the document bundle and may disclose individual leaves. Each disclosed leaf is verified in-contract against the root, index, tree size, type, content hash, issuer, and issue time.

  4. 4

    Approve

    The issuing and advising banks each sign an approval bound to the same document root. The second approval settles in one transaction.

  5. 5

    Settle

    fUSD moves to the beneficiary and a SETL note is written to the Native lane in the same EVM transaction. If either the transfer or the receipt fails, the whole settlement reverts.

  6. 6

    Resolve

    A bank can raise a discrepancy before the decision deadline. The arbitrator resolves it before the arbitration deadline. Missing deadlines fall back to refund (or bank-silence settlement).

What the proof means

Proven on-chain

  • • a registered role key signed that action digest;
  • • a disclosed leaf is inside the committed root;
  • • both banks approved the same root;
  • • fUSD and the Native receipt came from the same transaction;
  • • the Native note matches the EVM event and sender.

Not proven on-chain

  • • that the off-chain document is genuine or complete;
  • • that the goods exist or were shipped;
  • • that a role address is a real bank or legal entity;
  • • that a bank is solvent or will honour off-chain duties.

Built with

  • —QoreChain CrossVM precompile (0x…0901) → allowlisted qday-receipts
  • —PQ precompiles: pqcVerify (0x…0a01) for ML-DSA-87 signatures
  • —fUSD (6 decimals) escrow and settlement
  • —Foundry, Solidity 0.8.28, OpenZeppelin 5.1.0
  • —Next.js 15, viem, Tailwind, shadcn/ui

Deployment facts

Contract 0x18262cE4…e17e6F · Native target qor1xjayq5…3gltw8

Qlarc is a hackathon prototype on QoreChain Diana testnet. It is not audited and must not be used with real funds. See the repository's risk notes for the remaining testnet spikes.