Skip to content

Connect Protocol

The Akita Connect protocol enables secure peer-to-peer communication between applications using WebRTC data channels. It’s primarily used for the agent wallet installation flow — connecting an AI agent to a user’s mobile wallet.

  1. Generate URI — The initiator creates a liquid:// URI containing a signaling server address and session ID
  2. Display QR Code — The URI is shown as a QR code (or shared as a link)
  3. Scan & Connect — The mobile app scans the QR code and connects via the signaling server
  4. WebRTC Channel — A peer-to-peer data channel is established
  5. Exchange Payloads — Structured request/response messages are sent over the channel
import { encodeConnectUri, decodeConnectUri } from '@akta/sdk/connect'
// Create a connect URI
const uri = encodeConnectUri({
origin: 'signal.akita.community',
requestId: 'uuid-here',
})
// Returns: "liquid://signal.akita.community/uuid-here"
// Parse a connect URI
const parsed = decodeConnectUri(uri)
// Returns: { origin: "signal.akita.community", requestId: "uuid-here" }

Used by the agent wallet setup to request installation on a user’s wallet:

import type { AgentInstallRequest } from '@akta/sdk/connect'
const request: AgentInstallRequest = {
type: 'agent-install',
v: 2,
agent: {
name: 'My AI Agent',
address: 'AGENT_ADDRESS...',
},
network: 'mainnet',
escrowName: 'agent:My AI Agent',
newAgentAccount: true,
plugins: [
{ id: 'payPlugin', coverFees: true },
{ id: 'optinPlugin' },
{ id: 'stakingPlugin' },
],
allowances: [
{ asset: '0', type: 'flat', amount: '10000000' },
],
}

The mobile app responds with wallet details:

import type { AgentInstallResponse } from '@akta/sdk/connect'
// Success
const response: AgentInstallResponse = {
type: 'agent-install',
success: true,
walletAppId: '3368395481',
escrowAddress: 'ESCROW_ADDR...',
network: 'mainnet',
}

Plugins are referenced by their NetworkAppIds key:

IDPlugin
payPluginSend ALGO/ASA payments
optinPluginOpt into assets
stakingPluginStake tokens
rewardsPluginClaim rewards
socialPluginSocial interactions
daoPluginDAO governance
subscriptionsPluginSubscriptions
marketplacePluginNFT marketplace
hyperSwapPluginToken swaps
auctionPluginAuctions
rafflePluginRaffles
pollPluginPoll voting
asaMintPluginMint assets
// Flat — fixed total spending limit
{ asset: '0', type: 'flat', amount: '10000000' }
// Window — replenishes over a time interval
{ asset: '0', type: 'window', amount: '10000000', interval: '86400' }
// Drip — continuous linear replenishment
{ asset: '0', type: 'drip', rate: '100', max: '10000000', interval: '3600' }