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.
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
| Contract | Purpose |
|---|---|
EmaxisToken | The $EMAXIS ERC-20. |
EmaxisHook | Dynamic-fee Uniswap v4 hook (flags 0x1080). |
SignalOracle | Accepts signals that pass the ZK and quorum checks; exposed to the hook. |
SubnetRegistry | Mirrors the subnet validator set and stake weights. |
ZKVerifier | Groth16 pairing verifier (BN254). |
TensorLightClient | ZK light client of Subtensor finality. |
EmaxisCoprocessor | zkML inference verification, KZG opening, recursive folding. |
ShieldedAlpha | Commitment/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;
fee = 0x800000) and tickSpacing = 60. It will revert in a static fee tier.Deployment
Deploy order (each address feeds the next):
_netuid (your subnet id).(verifier, registry).(verifier, owner).(verifier, genesisCommitteeRoot, owner).(token, verifier, owner).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.