Endo
    Preparing search index...

    Module @endo/ocapn

    @endo/ocapn

    A tentative implementation of the OCapN (Object Capability Network) protocol for Hardened JavaScript. The OCapN specification remains a moving target and this package provides few guarantees of future compatibility. This is a testbed for building specification consensus and early discovery of specification questions.

    OCapN is a protocol for secure distributed object programming. It enables networked programming with the convenience of calling methods on remote objects, much like local asynchronous programming.

    This package provides:

    • CapTP: The Capability Transport Protocol, the core message-passing layer of OCapN. See also the related @endo/captp package for a minimal CapTP implementation.
    • Syrup codec: Encode and decode Syrup, the canonical binary serialization format tentatively used by OCapN.
    • Netlayer interface: An abstraction for transport layers, allowing CapTP to operate over various network protocols.
    • Third-party handoffs: Cryptographic mechanisms for securely transferring object references between peers.

    For more information about the protocol, see ocapn.org.

    This package is a work in progress and is not yet published to npm. The API is subject to change.

    Syrup is a binary serialization format tentatively used by OCapN for encoding messages. This package includes a partial implementation that is strictly canonical and limited to forms needed to express the passable value model.

    Supported types:

    Syrup Type JavaScript Type Encoding
    Boolean true, false t, f
    Integer bigint 0+, 1-, etc.
    Double number D + 8 bytes IEEE 754
    Bytestring Uint8Array 3:cat
    String string 3"cat
    List Array (frozen) [ ... ]
    Dictionary Object (frozen) { ... }

    Look to the Syrup codec README for implementation details and limitations.

    The package is organized in layers, from high to low:

    1. Client (src/client/): Session management, handoffs, sturdy references
    2. CapTP (src/captp/): Message dispatch and slot management
    3. Codecs (src/codecs/): Syrup encoding, descriptors, and operations
    4. Netlayer (src/netlayers/): Network and transport abstraction

    Apache-2.0