Skip to content

remotable

Dan Connolly edited this page Jul 19, 2026 · 1 revision

Remotable — Far(), makeExo(), zone.exo()

A Remotable object is passable by reference across vats. When another vat receives a Remotable via marshaling, it gets a remote presence (a proxy) that forwards method calls via E().

Ways to create a Remotable

Far(interfaceName, methods) — low-level

import { Far } from '@endo/far';

const obj = Far('MyInterface', {
  method: (arg) => { /* ... */ },
});

makeExo(interfaceName, interfaceGuard, methods) — with guard

import { makeExo } from '@endo/exo';

const obj = makeExo('MyInterface', M.interface('MyInterface', { ... }), {
  method: (arg) => { /* ... */ },
});

zone.exo(interfaceName, interfaceGuard, methods) — with lifecycle

const obj = zone.exo('MyInterface', M.interface('MyInterface', { ... }), {
  method: (arg) => { /* ... */ },
});

zone.exo() is the preferred API going forward — it integrates with durable object lifecycle (vintage upgrade, persistence). makeExo() adds an interfaceGuard for runtime type checking of method arguments. Far() is the simplest but least featured; suitable for prototyping.

Rules (all forms)

  • All property values must be functions. Accessors (get/set) are not allowed. Data properties throw.
  • The methods object must NOT already be hardened. Far() / makeExo() / zone.exo() harden it before returning.
  • interfaceName is for debugging — shows up in console.log. It is NOT a type check (unless paired with a guard in makeExo).

Why Remotable

Without Far(), a hardened object is passable by copy — it gets serialized and deserialized into a new object in the receiving vat. With Remotable, the object is passable by reference — the receiving vat gets a proxy that forwards messages back. This enables distributed ocap: capabilities are not copied, they are shared.

Guard against accidental export

If an object is NOT a Remotable but is accidentally passed across a vat boundary, marshaling throws an error. This prevents accidental exposure of local-only objects.

References

Clone this wiki locally