Documentation

Everything needed to understand, deploy, and build on the Emaxis protocol.

Overview

Emaxis is a four-layer protocol that carries a verified AI signal from a Bittensor subnet to an Ethereum market without a trusted middleman. The layers compose through narrow interfaces: each one verifies a proof before passing data to the next.

The pipeline

Bittensor subnet → Tensor Light Client → zkML Coprocessor → SignalOracle → Dynamic v4 Hook, with Shielded Alpha gating private access.

Core concepts

Signal

A model output from the subnet (for example, a predicted-toxicity score in the range -1e18 .. 1e18) plus a confidence in basis points and a commitment to the off-chain payload.

Epoch

The unit of finality. Each Subtensor epoch produces a header with a committee root and a signal root. Signals are opened against a finalized epoch's signal root.

Recursive commitment

The coprocessor folds every verified inference into one running accumulator, so the full provenance of accepted outputs is checkable from a single 32-byte root.

Note

A shielded subscription deposit. Notes live as commitments in a Merkle tree; spending one reveals only a nullifier.

Contract map

ContractPurpose
EmaxisTokenThe $EMAXIS ERC-20.
EmaxisHookDynamic-fee Uniswap v4 hook (flags 0x1080).
SignalOracleAccepts signals that pass the ZK and quorum checks; exposed to the hook.
SubnetRegistryMirrors the subnet validator set and stake weights.
ZKVerifierGroth16 pairing verifier (BN254).
TensorLightClientZK light client of Subtensor finality.
EmaxisCoprocessorzkML inference verification, KZG opening, recursive folding.
ShieldedAlphaCommitment/nullifier pool for private subscriptions.

Tensor Light Client

Admits a finalized Subtensor header after verifying it extends the last header and was finalized by a stake-weighted supermajority.

// submit a finalized epoch header with its finality proof
lc.submitHeader(header, signingStake, a, b, c, publicInputs);

// open one signal leaf against a finalized epoch
lc.openSignal(epoch, leaf, merkleProof, index);

zkML Coprocessor

Verifies an inference proof, opens a KZG commitment to the model, folds the instance, and forwards the decoded signal to the sink.

// commit and activate a model
co.commitModel(modelId, kzgLo, kzgHi, version, paramLog2);
co.activateModel(modelId);

// submit an epoch inference (struct EpochProof)
co.submitEpoch(proof);

// read the recursive state
co.ivcDepth();        // folded steps
co.recent(5);         // last 5 inferences

Shielded Alpha

Private subscription lifecycle. Identity and amount never appear in calldata.

// deposit + insert a note commitment
sa.subscribe(commitment, amount);

// privately unlock a signal stream
sa.claimAccess(a, b, c, root, nullifier, streamId, outCommitment);

// privately withdraw
sa.unsubscribe(a, b, c, root, nullifier, to, amount);

Dynamic v4 Hook

Reads the freshest verified signal and sets the swap fee dynamically. Fails open to the base fee when the signal is stale.

uint24 FEE_BASE = 3000;   // 0.30% calm
uint24 FEE_MAX  = 30000;  // 3.00% peak toxicity
fee = FEE_BASE + (FEE_MAX - FEE_BASE) * toxicity / 10000;
Dynamic-fee pools only. This hook must be initialized into a pool created with the dynamic-fee flag (fee = 0x800000) and tickSpacing = 60. It will revert in a static fee tier.

Deployment

Deploy order (each address feeds the next):

1
ZKVerifier — no args.
2
SubnetRegistry_netuid (your subnet id).
3
SignalOracle(verifier, registry).
4
EmaxisToken — no args.
5
EmaxisCoprocessor(verifier, owner).
6
TensorLightClient(verifier, genesisCommitteeRoot, owner).
7
ShieldedAlpha(token, verifier, owner).
8
HookDeployer, then mine + deploy EmaxisHook at a 0x1080-flagged address.

Compiler: 0.8.24, optimizer on (200 runs), EVM version cancun.

Integration

Consumers read the verified signal through the oracle interface:

interface ISignalOracle {
  function toxicityBps() external view returns (uint256);
  function isFresh(uint256 maxAge) external view returns (bool);
}

Any contract can gate behavior on a fresh, verified signal by calling isFresh() then toxicityBps().

FAQ

Is the ZK actually live?

The verification machinery (pairing checks, KZG precompile calls, Merkle and nullifier logic) is implemented. The production circuits and trusted setup are part of Phase II and III on the roadmap. Until then, treat verified outputs as unverified.

Why a Uniswap v4 hook?

It lets a verified signal act on price directly and makes the protocol self-funding: swap fees flow to the treasury that pays the subnet.

What does privacy actually hide?

Who subscribed, how much they paid, and which streams they hold. The chain sees only nullifiers and aggregate counts.

Disclaimer. Emaxis is experimental, unaudited software. The cryptographic components are not yet production-complete. Nothing here is financial advice. Do not deposit value you cannot afford to lose.