Skip to main content

IPC Protocol

The VibeFi client bridges dapp JavaScript and the Rust host via JSON-based IPC over Wry's window.ipc.postMessage. Dapps have no direct network or key access — all sensitive operations go through this bridge.

Request

{
"id": 123,
"providerId": "vibefi-provider",
"method": "eth_sendTransaction",
"params": [{ "to": "0x...", "value": "0x..." }]
}
FieldTypeDescription
idu64Correlation ID for matching responses
providerIdstring?Routes to handler — see Provider IDs below
methodstringRPC method or internal method name
paramsarray|objectMethod parameters

Response

Delivered via evaluate_script() calling window.__VibefiHostDispatch():

{
"kind": "rpcResponse",
"payload": { "id": 123, "result": "0x...", "error": null }
}

Error shape: { "id": 123, "result": null, "error": { "code": 4001, "message": "User rejected" } }

Provider Events

Push events from host (e.g., after wallet connection):

{
"kind": "providerEvent",
"payload": { "event": "accountsChanged", "value": ["0xabc..."] }
}

Standard EIP-1193 events: accountsChanged, chainChanged.

WalletConnect Pairing

When WalletConnect generates a pairing URI, the host pushes:

{
"kind": "walletconnectPairing",
"payload": { "uri": "wc:abc123...", "qr_svg": "<svg>...</svg>" }
}

The wallet selector renders the SVG as a scannable QR code.

Provider IDs

IDPurpose
vibefi-providerStandard Ethereum JSON-RPC (EIP-1193) for dapps
vibefi-walletWallet selector UI methods
vibefi-launcherDapp registry/launcher methods
vibefi-tabbarTab bar control
vibefi-settingsSettings panel
vibefi-ipfsCapability-scoped IPFS read APIs

Internal Methods

Beyond standard Ethereum JSON-RPC (eth_*, personal_sign, etc.), the client handles:

Wallet Selector (vibefi-wallet)

MethodPurpose
vibefi_connectLocalSet backend to local signer
vibefi_connectWalletConnectStart WalletConnect pairing flow
vibefi_connectHardwareDetect and connect Ledger/Trezor

Launcher (vibefi-launcher)

MethodPurpose
vibefi_listDappsFetch registry entries from contract events
vibefi_launchDappDownload from IPFS, build, open in new tab
vibefi_openSettingsOpen settings panel

Settings (vibefi-settings)

MethodPurpose
vibefi_getEndpoints / vibefi_setEndpointsRead/persist RPC endpoint list
vibefi_getIpfsSettings / vibefi_setIpfsSettingsRead/persist IPFS config

Tab Bar (vibefi-tabbar)

MethodPurpose
switchTabBring tab to front
closeTabClose a tab

IPFS (vibefi-ipfs)

MethodPurpose
vibefi_ipfsHeadRead metadata (size, contentType) for a CID/path
vibefi_ipfsListRead and filter manifest.json file listing for a bundle CID
vibefi_ipfsReadRead content as json, text, snippet, or raster image (hex)

vibefi_ipfsRead expects params: [cid, path, options] where options.as is one of json|text|snippet|image.

IPFS requests emit progress through provider events with event: "vibefiIpfsProgress" and payload fields: ipcId, method, phase, percent, message, plus optional cid and path.

Security

  • Origin validation: only accepts IPC from app:// protocol
  • Provider ID enforcement: internal methods restricted to correct webview contexts
  • Strict typing: all messages validated against Rust enum/struct definitions in ipc_contract.rs