Skip to main content

Omnia Pocket

Type: Mobile payment-channel wallet
Audience: Mobile developers, Pear/Holepunch app builders, everyday payment apps

Omnia Pocket is a lightweight eltoo payment-channel wallet that runs on mobile (via Pear runtime) and enables near-instant off-chain payments. Policy guards set channel size limits, auto-pay caps, and trigger settlement when a channel balance dips below a safety floor.


Packages used

PackageRole in Omnia Pocket
@totemsdk/omniaCore eltoo state machine — open, update, close channels
@totemsdk/omnia-hyperswarmPeer discovery and transport for channel counterparties
@totemsdk/agent-policyGuards on channel size, auto-pay limits, settlement triggers
@totemsdk/pearPear/Holepunch runtime integration for mobile/desktop
@totemsdk/wots-leaseManages WOTS signing keys for each channel state update
@totemsdk/txpowCalibrates TxPoW for on-chain open/close transactions
@totemsdk/chain-providerSubmits channel-open and settlement transactions
@totemsdk/lookup-clientResolves counterparty addresses from the lookup network

Core integration path

1. Initialise the Pear runtime

import { createPearRuntime } from '@totemsdk/pear';

const pear = await createPearRuntime({
appId: 'omnia-pocket',
storage: './wallet-data',
network: 'mainnet',
});

await pear.ready();

2. Open a payment channel

import { openChannel } from '@totemsdk/omnia';
import { HyperswarmTransport } from '@totemsdk/omnia-hyperswarm';
import { createSharedLeaseStrategy } from '@totemsdk/wots-lease';

const transport = new HyperswarmTransport({ swarm: pear.swarm });
const leaseStrategy = createSharedLeaseStrategy({ storage: pear.storage, storageKey: 'wots-lease' });

const channel = await openChannel({
counterpartyKey: resolvedCounterparty.publicKey,
localAmount: 50_000_000n, // 50 MIN
remoteAmount: 50_000_000n,
transport,
chainProvider: getChainProvider({ nodeUrl: NODE_URL }),
wotsLease: await leaseStrategy.getSigner(),
});

3. Pocket payment policy

import type { AgentPolicy, AgentProposal } from '@totemsdk/agent-policy';

const pocketPolicy: AgentPolicy = {
async evaluate(proposal: AgentProposal) {
const { intent } = proposal;
if (intent.type !== 'channel_update') {
return { outcome: 'rejected', reason: 'Omnia Pocket only handles channel_update intents' };
}

const amount = BigInt(intent.localDelta);

// Block overspend — can't go negative
if (amount > channel.localBalance) {
return { outcome: 'rejected', reason: 'Insufficient channel balance' };
}

// Auto-pay up to 1 MIN per update
if (amount <= 1_000_000n) {
return { outcome: 'approved', receipt: buildReceipt(proposal, 'pocket-auto') };
}

// Require confirmation for larger amounts
return {
outcome: 'requires_human',
prompt: `Approve channel payment of ${amount / 1_000_000n} MIN?`,
};
},
};

4. Send a payment over the channel

import { updateChannel } from '@totemsdk/omnia';

async function pay(amountMin: bigint) {
const proposal = buildProposal('channel_update', { localDelta: String(amountMin * 1_000_000n) });
const decision = await pocketPolicy.evaluate(proposal);

if (decision.outcome === 'rejected') throw new Error(decision.reason);
if (decision.outcome === 'requires_human') await confirmDialog(decision.prompt);

return updateChannel(channel, {
localDelta: -(amountMin * 1_000_000n),
signer: await leaseStrategy.getSigner(),
});
}

Future QVAC hook

Future QVAC hook

A QVAC agent can auto-top-up channels from the on-chain wallet when balance drops, negotiate routing paths for payments beyond direct peers, and schedule settlement windows during off-peak hours. All channel state mutations flow through pocketPolicy — the agent never touches keys directly.