BRIK64
Blockchain · Smart Contracts

Smart contracts can't be patched. So bugs can't compile.

A single smart contract bug has caused billions in losses. You can't patch after deployment. BRIK64 makes it simple: if the contract has undefined behavior, it doesn't compile. The bugs never ship.

CosmWasmNear ProtocolSolana (BPF adapter)WASM target < 100KB

The pitch

Solidity: “Hope the auditor finds the bugs”

Rust/WASM: “Hope the tests cover the edge cases”

BRIK64: “The bugs don't compile”

Use cases

Verified Escrow

Deposit, release, refund, timeout — all states covered by exhaustive pattern matching. No undefined behavior.

type Amount = range[0, 1_000_000_000];
type Deadline = range[1, 2_000_000_000];

pc escrow_release(balance: Amount, deadline: Deadline, now: u64) {
    match now > deadline {
        true => Ok(balance),
        false => Err(Error.NotYet),
    }
}

Supply Chain Tracking

Range types for temperature, GPS, timestamps. A sensor reporting 200°C when the domain is [-40, 80] doesn't compile.

type Temperature = range[-40, 80];
type Location = {
    lat: range[-90, 90],
    lon: range[-180, 180]
};

pc log_shipment(temp: Temperature, loc: Location) {
    // -999°C? Doesn't compile.
}

Voting System

Double voting is structurally impossible. The circuit is closed — there is no path where a voter votes twice.

type Choice = enum { Yes, No, Abstain };

pc cast_vote(voter: VoterId, choice: Choice, has_voted: bool) {
    match has_voted {
        true => Err(Error.AlreadyVoted),
        false => Ok(Vote { voter, choice }),
    }
}

Parametric Insurance

Automatic payout when conditions are met. No negative payouts, no overflow, no undefined magnitude values.

type Richter = range[0.0, 10.0];
type PayoutUSD = range[0, 10_000_000];

pc insurance_check(magnitude: Richter, threshold: Richter) {
    match magnitude >= threshold {
        true => calculate_payout(magnitude),
        false => 0,
    }
}

Carbon Credits

A retired credit cannot be re-activated. The circuit prevents double counting structurally.

type CreditStatus = enum { Active, Retired, Cancelled };

pc retire_credit(status: CreditStatus) {
    match status {
        Active => Ok(CreditStatus.Retired),
        Retired => Err(Error.AlreadyRetired),
        Cancelled => Err(Error.Invalid),
    }
}

Identity Verification

Zero-knowledge age check. Reveals only true/false, never the actual data. The circuit guarantees privacy.

type Age = range[0, 150];

pc verify_over_18(age: Age) -> bool {
    // Reveals only true/false, never the age
    // Φc = 1: no path where age is -5 or 999
    age >= 18
}

Gas estimation from PCD

Count monomers = count operations = estimate gas. Within 20% of actual execution cost.

brikc build

$ brikc build escrow.pcd --target wasm --estimate-gas

  ✓ Compiled: 42KB WASM

  ✓ Estimated gas: 127,400 units

  ✓ Φc = 1 — certificate stored on-chain