Sub-Protocols

WalletPair's core protocol handles pairing, encryption, and message transport. It is deliberately network-agnostic — it does not define any blockchain-specific logic.

All chain-specific behavior is defined in sub-protocols, one per blockchain ecosystem. Each sub-protocol specifies methods, events, data encoding, and security requirements for its network.

Architecture

LayerResponsibilityNetwork-Aware?
Core ProtocolPairing, key exchange, encryption, transport, relay routingNo
Sub-ProtocolMethods, events, account formats, tx signing, data encodingYes

The core protocol only sees opaque JSON payloads inside encrypted messages. The sub-protocol defines the schema of those payloads.

Available Sub-Protocols

Sub-ProtocolNamespaceCAIP-2 PrefixStatus
EVMevmeip155Release Candidate
SolanasolanasolanaPlanned
SuisuisuiPlanned
Bitcoinbitcoinbip122Planned
TrontrontronPlanned

Cross-Network Differences

Each blockchain ecosystem has fundamentally different primitives. Sub-protocols abstract these differences behind a consistent request/response pattern:

AspectEVMSolanaSuiBitcoin
Address format0x hex, 20Bbase58, 32B0x hex, 32Bbech32 / base58check
Tx formatRLP / JSONbincode / base64BCS / base64PSBT / raw hex
Signaturesecp256k1, 65BEd25519, 64BEd25519 / secp256k1ECDSA / Schnorr
Fee modelgas × gasPricepriority fee + CUgas budget (SUI)sat/vB × weight
Nonce modelper-account seqrecent blockhashper-object seqUTXO (no nonce)

Capability Declaration

The wallet declares which sub-protocols it supports via the capabilities.version field during pairing:

{
  "capabilities": {
    "version": { "evm": 1 },
    "methods": ["wallet_getAccounts", "wallet_signMessage", ...],
    "events": ["accountsChanged", "chainChanged"],
    "chains": ["eip155:1", "eip155:137"]
  }
}

A wallet that supports multiple ecosystems could declare multiple versions:

{
  "capabilities": {
    "version": { "evm": 1, "solana": 1 },
    "chains": ["eip155:1", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]
  }
}

Authoring a Sub-Protocol

To add WalletPair support for a new blockchain ecosystem, author a sub-protocol specification covering:

TopicWhat to Define
Namespace & versionIdentifier (e.g., solana), version integer, CAIP-2 prefix
Chain identificationCAIP-2 format, chain ID encoding in params
Account identificationAddress format, length, checksum, forbidden values
CapabilitiesRequired vs. optional methods, events, chains
Data encodingBinary, integer, address, tx, signature encoding within JSON
MethodsParams schema, result schema, validation, user confirmation
EventsData schema, trigger conditions, dApp handling
Error codesStandard + sub-protocol-specific error codes
Security requirementsConfirmation UI, blind-sign policy, replay rules

See the EVM sub-protocol as a reference implementation.