In this section: Build
Start
Reference code
- obsp (C)
- Conformance runner (reference service)
- obsp (Go)
- Plugfests (non-normative groundwork)
- Python reference pipelines (draft profiles, synthetic data)
- obsp-eo
- obsp-model-run (draft OIP-0012, MODEL-OBSERVER)
- obsp-sensing (draft OIP-0011, NETWORK-SENSING, provisional)
- obsp-space
- Rust reference workspace
- Performance bench (WP-RI-11)
- The 0.2 candidate (DRAFT)
- obsp-core (Rust reference library)
- obsp-federation
- obsp-node-embedded
- Node agent (obsp-node)
- Evidence verifier (obsp-verify)
- obsp-sdk (TypeScript / ES modules)
Tools
API reference
- All APIs
- Observatory Protocol service administration (production services)
- Observatory Protocol CloudEvents (draft OIP-0024 binding)
- Observatory Protocol correction subscriptions
- Observatory Protocol credential status (reference service)
- Observatory Protocol discovery (reference service)
- Observatory Protocol exchange API (reference)
- Observatory Protocol federation sync (draft OIP-0004)
- Observatory Protocol Field Topic Contract (MQTT 5 and Sparkplug B)
- Observatory Protocol participant gateway
- gRPC services
- Observatory Protocol implementations and conformance registry (reference service)
- Observatory Protocol transparency log (reference service)
- Observatory Protocol WIS 2.0 notifications (draft OIP-0009 binding)
Public services
Bindings and crosswalks
obsp-node-embedded
| Field | Value |
|---|---|
| Status | Reference code written against draft proposals (DRAFT); accepts no proposal; no conformance claim |
| Version | 0.0.1 |
| Source | Rust reference workspace |
A #![no_std] reference of the device and gateway-edge side of the NODE-CONSTRAINED profile (draft proposal OIP-0027,
status DRAFT). It makes no conformance claim: the profile, the compact form and the batch rules are drafts, this code
has no declared level, and no implementation is listed on the strength of it.
Covers
| Module | What it does |
|---|---|
message |
Encodes one measurement as a compact device message: deterministic CBOR (RFC 8949 section 4.2.1), keys 1 ctx, 2 property index, 3 value, 4 unit, 5 phenomenon time, 6 result time, 8 uncertainty; integers as integers, floats in preferred form (section 4.2.2); a clockless device leaves the time out. The 40-byte budget (NC-5) is a constant and a unit of more than 8 characters is refused. |
outbox |
A fixed-size ring buffer (SLOTS messages of up to MSG bytes, const generics, no heap) with a wrapping u32 sequence counter and a full-buffer policy: refuse the new message, or drop the oldest and count it. |
frame |
Packs the oldest queued messages into a frame of at most 51, 115 or 222 bytes (the LoRaWAN payload classes named for this slice) and parses a frame on the gateway side. The frame layout (version, count, low 16 bits of the first sequence number, length-prefixed messages) is this crate’s own; OIP-0027 does not define one. |
batch |
Builds an evidence batch: SHA-256 of each message’s exact bytes, the batch digest over the deterministic CBOR array of those digests, the signed payload (the batch map without entries and signature), the COSE_Sign1 (RFC 9052 section 4.2, detached payload, Ed25519 with COSE code point -19, protected header {1: -19, 4: kid}) over Sig_structure (section 4.4), and the compact batch map (CDDL evidence-batch). Gateway-declared times for clockless devices are carried in key 12. The signing key is a caller-supplied 32-byte seed; the crate stores no key. |
| orchestrate (feature orchestrate) | Verification only, for a device that receives signed plans: the node decision of the draft OIP-0003 (each of the four TUF roles meets its threshold of distinct root-listed Ed25519 keys over its RFC 8785 payload, root chaining at version + 1 signed by the trusted root’s threshold, plan, root and snapshot expiry, timestamp freeze, snapshot and timestamp consistency, version monotonicity, tasking reserved; codes OBS-PLAN-0001 to -0007 as bits) and the install decision of the OIP-0028 SUIT binding (INSTALL, SKIP or the BND-SUIT ids broken). The caller hands decoded members and the payload bytes as received; Sig_structure is built in a caller buffer. See ../obsp-node/ORCHESTRATE.md. |
Dependencies: ed25519-dalek and sha2, both with default features off. The alloc feature only adds a convenience
Measurement::encode_vec; the core never allocates and contains no unsafe.
Does not cover
- Expansion of a message into an ObservationRecord (NC-3), SenML (NC-6), the CompactContext and join (NC-4). The test harness holds a small expansion to prove the round trip; obsp-core has none, and its CBOR decoder refuses floats, so the harness decodes messages with its own decoder and uses obsp-core only for digests and for the float-free batch.
- OSCORE and EDHOC (NC-10): no vector exists, and no link security is implemented. Frames here are plain bytes.
- Verification of a batch signature, key storage, key rotation, a hardware random source, a clock. The device never signs (NC-7); the signing code is for the node that plays gateway.
- Timestamps other than whole seconds since the epoch, tags and text timestamps, every record field outside the measured-quantity message (quality, geometry, interval times, other result forms).
- Constant-time or side-channel properties beyond what
ed25519-dalekprovides, stack depth (not measured), and the LoRaWAN payload limits per region and data rate (checked: not checkedagainst the regional parameters).
Tests
cargo test -p obsp-node-embedded (from reference/rust, or make embedded):
tests/vectors.rsreproduces every message in the OIP-0027messages.jsonbyte for byte (hex, length, digest), the 36-byte worst case, the evidence batch ofbatch.json(batch digest, signature, tagged COSE_Sign1 and the whole 498-byte compact batch), checks that the signature verifies over the vector’s Sig_structure, expands each message and compares the record with the vector’sexpanded, checks the preferred float form for all 65536 half-precision values and 20000 pseudo-random doubles, 2000 random messages against the 40-byte budget, and batches of 1 to 300 entries with worst-case identifiers against46 N + 480.tests/orchestrate.rs(featureorchestrate) gives the hosted decision’s codes on the 12 OIP-0003 plan vectors copied in../obsp-node/tests/vectors/oip-0003/, refuses without trusted time or root, counts a repeated signature once, and reproduces the decisions of the SUIT binding’s golden examples (../obsp-node/tests/vectors/oip-0028/).tests/outbox_frame.rscovers ring wrap, both full policies, sequence numbers, frame packing in each class, frame parse faults.tests/vectors/holds copies of the draft vectors (messages, batch, two contexts), because the live tree does not containconformance/vectors/compact/until OIP-0027 is accepted. A test compares each copy with the published file once it exists.
Embedded build and size
make embedded runs the tests and, if the thumbv7em-none-eabihf target is installed (rustup target add thumbv7em-none-eabihf), builds the crate for it (with and without alloc) and links size-probe/, an image holding
an outbox of 16 x 40 bytes, a batch of 16 entries, a 512-byte signing scratch and a 222-byte frame buffer, with
opt-level = "s" and LTO.
Measured with the Rust 1.97 toolchain, llvm-size, on the probe:
| text (flash) | data | bss | flash total (text + data) | static RAM (data + bss) |
|---|---|---|---|---|
| 54318 | 788 | 2600 | 55106 bytes | 3388 bytes |
About 28 KB of the text is the SHA-512 compression function that Ed25519 needs, and about 5 KB the SHA-256 one. Static RAM is the outbox (788), batch (840), scratch (512), output (1024) and frame buffers; stack use during signing is not measured. The figures describe this probe on this toolchain, not a target part.
Layout
src/ cbor, message, outbox, frame, batch
tests/ vectors.rs, outbox_frame.rs, common/ (test decoder and expansion), vectors/ (draft vector copies)
size-probe/ firmware-shaped binary and linker script for the size report (not a workspace member)