Skip to main content

Module onion

Module onion 

Source
Expand description

The onion privacy layer: its directory, route selection and loop data plane.

This module deliberately sits in rings-node, not rings-core: Chord remains the storage and discovery substrate, while exit policy is an application protocol decision.

The data plane runs client-sealed loops of fixed-width Sphinx cells (circuit, sphinx). A loop evaluates a pipeline over the static signature Σ of operation symbols (signature): every hop’s step interprets the identity symbol relay, and each node’s Σ-algebra interprets the world-facing symbols it registers, as sessions (session) over their worlds (tcp, https). Route selection places a pipeline on a guard-closed loop (loop_shape) whose every position is a node registering that position’s symbol at its current process epoch.

Re-exports§

pub use circuit::OnionInvokeBackend;
pub use circuit::OnionInvokeCall;
pub use circuit::OnionInvokeFn;
pub use invoke_descriptor::OnionInvokeDescriptor;
pub use invoke_descriptor::OnionInvokeDescriptorBody;
pub use invoke_descriptor::OnionInvokeDescriptorDecodeReport;
pub use invoke_descriptor::OnionInvokePolicy;
pub use invoke_descriptor::ONION_INVOKES_TOPIC;
pub use pipeline::OnionInvokeArguments;
pub use pipeline::OnionInvokePipeline;
pub use pipeline::OnionInvokeStage;
pub use pipeline::OnionPipeline;
pub use pipeline::OnionPipelineError;
pub use pipeline::OnionPipelineTerm;
pub use pipeline::OnionValueType;
pub use route::OnionPipelineRoute;
pub use route::OnionPipelineRouteRequest;
pub use route::OnionRoute;
pub use route::OnionRouteHop;
pub use route::OnionRouteRequest;
pub use signature::OnionBackendName;
pub use signature::OnionInputType;
pub use signature::OnionInvokeShape;
pub use signature::OnionLatencyClass;
pub use signature::OnionServiceName;
pub use signature::OnionShape;
pub use signature::OnionWidthClass;
pub use signature::ONION_BACKEND_NAME_MAX_BYTES;
pub use target::OnionProxyTarget;
pub use target::OnionProxyTargetError;
pub use udp::NativeOnionUdpSession;
pub use udp::OnionUdpBindConfig;
pub use udp::OnionUdpBindMode;
pub use udp::OnionUdpClientFrame;
pub use udp::OnionUdpPinholeTable;
pub use udp::OnionUdpServerFrame;

Modules§

circuit
The onion loop data plane (#834 Phase 2a, #843).
https
https: one HTTPS request/response fetch over an onion session (#834 D1′, D2′).
invoke_descriptor
Signed descriptors and DHT registration for intermediate invoke symbols (#834 D1′, D2).
native
The native handle of a node’s onion runtime: tcp streams, https requests, and multi-stage invoke Kleisli pipelines over client-sealed loops.
pipeline
Onion Kleisli pipelines: typed morphisms of the free category Free(G_Σ) over the static signature Σ (#834 D3, D4a, D4b, L1, L2, L3).
proxy
Client-side onion proxy planning.
route
Onion route selection: guard-closed loops over registered symbols (#834 D2, D4, D5, L7).
signature
The onion signature Σ: the static table of operation shape symbols a loop applies, and the open backend name alphabet Ω (#834 D1′, D2, D3).
target
Target authority parsing shared by onion policy and proxy adapters.
tcp
tcp: a byte stream over an onion session, native only (#834 D1′, D2′).
udp
udp: an unconnected OS UDP datagram session with stateful peer-IP pinholes (#1292).

Structs§

NativeOnionGatewayConnector
Native connector that maps one captured target to one Rings Onion TCP stream.
OnionEntryGuardState
Serialized local entry-guard snapshot.
OnionExitDescriptor
Signed descriptor published by onion exits.
OnionExitDescriptorBody
Descriptor fields covered by the onion-exit signature.
OnionExitDescriptorDecodeReport
Result of decoding one onion-exit registry entry.
OnionExitOffer
What an exit offers: a non-empty set of world-facing services under an open policy.
OnionExitPolicy
Signed policy fields for an onion exit.
OnionExitTarget
One entry of an onion exit policy: a pattern over target authorities.
OnionInvokeOffer
What a node offers for intermediate invoke evaluation: a non-empty map from (shape, backend) pairs in Σ_I × Ω to their signed quota(n, f, ω) policies (#834 D2).
OnionLoop
A loop whose relay positions carry a label P and whose symbol positions carry a label T, the guard’s label stored once.
OnionLoopShape
The shape of a loop over n ∈ [1, n_max] symbol applications.
OnionPipelineHandle
Cross-platform handle for registering intermediate invoke backends and evaluating Kleisli pipelines on both native and browser nodes (#834 Phase 2b).
OnionProcessEpoch
Process epoch e_n of one node process (#834 D2), drawn afresh at every process start.
OnionProcessEpochCell
The current process epoch e_n of this node, shared by the onion admission state, which renews it, and the registrations, which publish it at every heartbeat (#834 D2, L9).

Enums§

OnionExitFailure
Why an https exit returned no response: the encoded failure of a fetch outcome. It carries no local diagnostic, so a failure reveals nothing of the exit beyond its class.
OnionLoopClass
The class b of one loop, 16 KiB … 12 MiB (#834 D6, L3): every cell of the loop, replies included, is exactly b bytes.
OnionLoopRole
The role of one position of a loop: a relay position (the guard included), or the symbol hop hₖ with its index k ∈ [1, n].
OnionRole
The registration role of one node process over Σ = {relay} ⊎ Σ_I ⊎ Σ_W (#834 D2).
OnionRouteError
Local route and session failure before any user-facing rendering.

Constants§

MAX_ONION_LOOP_HOPS
Largest number of positions of one loop, H(n_max, s) = (s + 1)·n_max + s = 14, derived from ONION_SEGMENT_RELAYS and MAX_ONION_LOOP_SYMBOLS.
MAX_ONION_LOOP_SYMBOLS
Largest number n_max of symbol applications in one pipeline (#834 D4a).
ONION_EXITS_TOPIC
DHT topic used for application-layer onion exit descriptors.
ONION_SEGMENT_RELAYS
Number s of relays in every segment of a loop, the guard counted in both end segments (D5).

Functions§

default_onion_exit_policy
Default exit policy. It is intentionally closed until the operator configures targets.
default_onion_exit_services
Default native exit services: the world-facing symbols of the onion signature, in table order. It is only published when onion-exit advertisement is enabled.
https_onion_exit_services
Standard HTTPS onion-exit service set: the single https symbol of the onion signature.

Type Aliases§

OnionEntryGuardStorage
Local key-value storage for persisted onion entry guards.