- One shared structure for Altruist firmware, connectivity layer and sensors.social UI.
- Protobuf on the wire (MCU-friendly; high performance, no JSON canonicalization).
┌────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ IoT │ Signed │ Connectivity │ Signed │ Backend/Map │
│ Sensor │──────────────> │ Layer │────────────> │ Infrastructure │
│ Device │ Envelope │ (Pass-through) │ Envelope │ │
└────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ Measures │ Validates │ Decodes
│ Serializes │ Signature │ Processes
│ Signs │ Forwards │ Stores
└──────────────────────────────┴──────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────┐
│ TELEMETRY MESSAGE │
├────────────────────────────────────────────────────────────────────┤
│ │
│ Metadata │
│ ┌────────────────────────────────────────────┐ │
│ │ timestamp: 1723537200000 │ │
│ └────────────────────────────────────────────┘ │
│ │
│ Payload (choose one: Urban OR Insight) │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Public Data (visible to everyone) │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │ Temp: 21°C │ │ PM2.5: 8.1 │ │ Location │ ... │ │
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
│ │ │ │
│ │ Private Data (encrypted for specific recipients) │ │
│ │ ┌──────────────────────────────────────────┐ │ │
│ │ │ 🔒 Encrypted for City Authority │ │ │
│ │ │ Contains: Noise levels, detailed GPS │ │ │
│ │ └──────────────────────────────────────────┘ │ │
│ │ ┌──────────────────────────────────────────┐ │ │
│ │ │ 🔒 Encrypted for Device Owner │ │ │
│ │ │ Contains: All sensor readings │ │ │
│ │ └──────────────────────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────────────┘
Breaking schema changes go in a new folder/package (v2/, v3/, …).
There is no schema_version field inside Message — the path / package sensors.social.v1 is the version.
Telemetry message wrapped in a SignedEnvelope that provides:
sensor_id— Unique device identifier (persistent across restarts)nonce— Random value to prevent replay attacks (e.g., UUID v4)message— The actual measurements data, includingMeta.timestamp(UTC, ms)signature— Ed25519 signature
The signature is computed over the exact bytes of the envelope fields.
signature = sign(sensor_id <> nonce <> message)
DO NOT re-encode envelope. Protobuf serialization is not deterministic — re-encoding may produces different bytes, which:
- Breaks the signature (validation will fail)
- Changes the CID
| Layer | Operation | Safe? |
|---|---|---|
| Device | Serialize once, sign, transmit | ✅ |
| Connectivity | Verify signature, forward envelope | ✅ |
| Backend | Deserialize for indexing, store original bytes | ✅ |
| Any | Decode and re-encode | ❌ May change signed bytes, CID & GossipSub ID |
The primary connectivity-cloud PubSub broadcaster and fallback Rust edge pubsub relay
MUST publish the same original serialized SignedEnvelope bytes to the same topic.
The sensors.social browser clients, broadcaster, and relay MUST all configure the
GossipSub message ID rule below for every topic, including on receiving nodes. HTTP/MQTT
ingress and blockchain anchoring are separate from this GossipSub rule.
The keywords MUST, MUST NOT, and SHOULD in this section express protocol requirements. For every GossipSub topic on participating nodes, the message ID MUST be the full 32-byte digest below. Topic names in the examples are test examples, not a new topic discovery or routing scheme.
SHA-256(domain || topic_length || topic || payload)
| Input | Exact encoding |
|---|---|
domain |
UTF-8 sensors.social/msgid/v1 followed by one zero byte; hex 73656e736f72732e736f6369616c2f6d736769642f763100 |
topic_length |
Topic UTF-8 byte length, as an unsigned 32-bit big-endian integer |
topic |
Exact GossipSub topic name in UTF-8, without normalization |
payload |
Original raw GossipSub message data, including the complete serialized envelope |
Topics exceeding 2^32 - 1 UTF-8 bytes MUST be rejected, not truncated or wrapped.
An implementation MUST NOT parse, decode, normalize, decompress, or re-serialize the
payload to calculate this ID. Empty and non-UTF-8 payload bytes are valid hash inputs;
this does not make them valid telemetry. Topic Unicode normalization, case folding,
and delimiter insertion are also forbidden.
The digest MUST NOT include the publishing peer, GossipSub sequence number,
connection, transport, or routing metadata. Implementations MUST NOT truncate,
rehash, or prepend a multihash prefix to the digest. Adapt it to the local
GossipSub API without changing its bytes (for example, Uint8Array in JS or
gossipsub::MessageId::from(digest.to_vec()) in Rust). Hex in the shared vectors is
only a display encoding; decode it when comparing byte-valued IDs.
This is distinct from the truncated, payload-only Meshtastic reassembly ID in Meshtastic v1. Neither ID substitutes for the other.
The following JS calculation uses Web Crypto, available in browsers and modern Node.js.
payload is a Uint8Array. The result is the digest bytes, not a hex string.
async function sensorsSocialMessageId(topic, payload) {
const encoder = new TextEncoder()
const domain = encoder.encode('sensors.social/msgid/v1\0')
const topicBytes = encoder.encode(topic)
if (topicBytes.length > 0xffffffff) throw new RangeError('Topic too long')
const input = new Uint8Array(domain.length + 4 + topicBytes.length + payload.length)
input.set(domain)
new DataView(input.buffer).setUint32(domain.length, topicBytes.length, false)
input.set(topicBytes, domain.length + 4)
input.set(payload, domain.length + 4 + topicBytes.length)
return new Uint8Array(await crypto.subtle.digest('SHA-256', input))
}
function messageId(message) {
return sensorsSocialMessageId(message.topic, message.data)
}Adapt the message field names to the installed GossipSub API. Only use the async example with APIs that support async message ID callbacks; synchronous APIs need a synchronous SHA-256 implementation with exactly the same inputs and digest.
Equivalent Rust calculation using sha2:
use sha2::{Digest, Sha256};
fn sensors_social_message_id(topic: &str, payload: &[u8]) -> [u8; 32] {
let topic_bytes = topic.as_bytes();
let length = u32::try_from(topic_bytes.len()).expect("Topic too long");
let mut hash = Sha256::new();
hash.update(b"sensors.social/msgid/v1\0");
hash.update(length.to_be_bytes());
hash.update(topic_bytes);
hash.update(payload);
hash.finalize().into()
}In Rust, configure message_id_fn to call this calculation with
message.topic.as_str() and &message.data for every message. Use the exact wire
topic name; do not hash a transformed topic identifier. All participating nodes
must deploy Message ID v1 to provide consistent duplicate suppression.
These are reference calculations, not changes to the external node implementations.
Message ID v1 vectors are language-neutral.
Decode payload_hex as bytes, UTF-8 encode topic, check topic_length_be_hex,
and compare the full digest with expected_digest_hex. origin and sequence_hex
are test metadata, not hash inputs. The paired primary/fallback entries contain a
valid Ed25519-signed SignedEnvelope; its signature covers sensor_id || nonce || message exactly as defined in envelope.proto.
The arbitrary binary and JSON vectors test hashing only, not envelope validity.
JS and Rust node tests MUST consume all vectors and compare digest bytes. Also check that the peer/sequence variants have equal IDs and the different-topic, different-payload, and differently spaced raw JSON pairs have unequal IDs. This repository has no JS/Rust runtime or test harness; these conformance tests belong in the participating implementation repositories.
The participating node suites MUST run a real GossipSub integration test (not just a hash or mock-cache test) with these steps:
- Start independent primary and fallback publishing peers and a receiving peer
subscribed to
sensors.social/telemetry. Configure Message ID v1 on all three. Exercise a JS receiver and a Rust receiver, and the actual broadcaster and relay adapters. Wait for connections and subscription propagation before publishing. - Publish the
signed-envelope-primaryvector through the primary path. Wait until the receiver emits one GossipSub message event with the exact fixture bytes; verify the signature through the existing application validation path. - Publish the identical
signed-envelope-fallbackbytes through the fallback path from a distinct peer with a distinct sequence number. Ensure both arrivals occur within the receiver's configured duplicate-cache retention window. - Instrument receipt at the receiver's GossipSub ingress (before deduplication) to prove that both publications actually reached it. Assert equal message IDs and exactly one receiver GossipSub message event across both arrivals. A suppressed local publish or an absent fallback arrival is not a successful test.
- As controls, send the same bytes on a second topic and different signed envelope bytes on the first topic; each must yield a new event. Repeat the duplicate publication test on a map topic to verify Message ID v1 also applies there.
Use deterministic connection/arrival barriers and a bounded observation interval shorter than duplicate-cache retention rather than relying only on sleeps. Fresh nodes or cleared caches isolate repeated runs. This contract is not an executed integration test in this schema-only repository; external node tests are required before claiming end-to-end rollout or cross-language implementation conformance.
Content IDs provide GossipSub duplicate suppression only within its cache retention window, not exactly-once application processing or guaranteed delivery. They do not authenticate a payload. Existing signature validation, application event deduplication, and retry/acknowledgement policies remain separate and unchanged. The fallback publisher MUST continue retrying according to its delivery policy: a matching message ID is not acknowledgement of primary delivery or processing. Serialize and sign once, retain those bytes for retries, and forward them unchanged. No envelope schema, signing, Kafka, or primary/fallback routing changes are required.
Selective data sharing is supported through public and private measurement sections.
┌─────────────────────────────────────────────────────────────────────┐
│ MODEL 1: Fully Public │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Public: [Temp, PM2.5, Location] 🌍 Everyone can see │
│ Private: [ ] │
│ │
└─────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ MODEL 2: Fully Private │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Public: [ ] │
│ Private: [🔒 Encrypted(All sensors)] 🔐 Only owner can see │
│ │
└─────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ MODEL 3: Mixed (Most Common) │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Public: [Temp, PM2.5, Approx Location] 🌍 Everyone can see │
│ Private: [ │
│ 🔒 Encrypted(Precise GPS, Noise) → City Authority │
│ 🔒 Encrypted(All sensors) → Device Owner │
│ ] │
│ │
└─────────────────────────────────────────────────────────────────────┘
Sensors can implement flexible privacy by:
- Fully public: Only populate the
publicarray with Urban/Insight messages, leaveprivateempty - Fully private: Leave
publicempty, put all measurements inprivatesections (ciphertext contains serialized EncryptedUrban/EncryptedInsight) - Mixed sharing: Share basic metrics publicly, detailed metrics in private sections
- Multiple recipients: Create separate private sections for different users/groups
┌─────────────────────────────────────────────────────────────────────┐
│ How Private Data is Encrypted │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Step 1: Prepare Measurements │
│ ┌────────────────────────────────────────────┐ │
│ │ Urban: [Noise: 85dB, GPS: (51.5, -0.1)] │ │
│ └────────────────────────────────────────────┘ │
│ ▼ │
│ Step 2: Wrap in EncryptedUrban │
│ ┌────────────────────────────────────────────┐ │
│ │ EncryptedUrban { │ │
│ │ sensors: [UrbanSensor, UrbanSensor] │ │
│ │ } │ │
│ └────────────────────────────────────────────┘ │
│ ▼ │
│ Step 3: Serialize to Binary │
│ ┌────────────────────────────────────────────┐ │
│ │ [0x0A, 0x12, 0x08, 0x15, ...] │ Protobuf bytes │
│ └────────────────────────────────────────────┘ │
│ ▼ │
│ Step 4: Key Agreement (ECDH) │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Sensor Private │ + │ Recipient Public │ → Shared Secret │
│ │ Key │ │ Key │ │
│ └──────────────────┘ └──────────────────┘ │
│ ▼ │
│ Step 5: Encrypt with AEAD (XChaCha20-Poly1305) │
│ ┌────────────────────────────────────────────┐ │
│ │ Ciphertext + Auth Tag │ 🔒 Encrypted │
│ └────────────────────────────────────────────┘ │
│ ▼ │
│ Step 6: Add to Private Section │
│ ┌────────────────────────────────────────────┐ │
│ │ Encrypted { │ │
│ │ version: 1 │ │
│ │ algorithm: "xchacha20" │ │
│ │ from: <sensor_pubkey> │ │
│ │ nonce: <random_24_bytes> │ │
│ │ ciphertext: <encrypted_data> │ │
│ │ } │ │
│ └────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
- Create wrapper: Place Urban/Insight measurements in EncryptedUrban/EncryptedInsight wrapper
- Serialize: Convert wrapper to protobuf binary format
- Key Agreement: ECDH between sender's private key and recipient's public key
- Key Derivation: HKDF-SHA256 to derive encryption key from shared secret
- AEAD Encryption: Encrypt serialized protobuf with chosen algorithm
- Authentication: 16-byte Poly1305 or GCM tag appended to ciphertext
AES-GCM-256 (Hardware) ████████████████████████████ 2-3 GB/s
XChaCha20-Poly1305 ██████ ~600 MB/s
✅ Use AES-GCM on devices with hardware acceleration
✅ Use XChaCha20 on MCUs / mobile devices
Revocation only applies going forward.
A private section, once published, is stored in IPFS and its hash is anchored in the chain. A recipient who held the key keeps everything they were able to decrypt up to the moment access was taken back. Rotating keys or dropping a recipient from future messages withdraws access to what comes next — not to what has already been released.
Applications built on this format should present the distinction to the user, rather than implying that sharing can be undone.
Protobuf supports zero-copy pass-through at the connectivity layer:
┌─────────────────────────────────────────────────────────────────────┐
│ Layer Responsibilities │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ FIRMWARE (Creates & Signs) │
│ ┌────────────────────────────────────────────┐ │
│ │ 1. Measure sensors │ │
│ │ 2. Create Message │ │
│ │ 3. Serialize to bytes │ │
│ │ 4. Wrap in SignedEnvelope │ │
│ │ 5. Sign with Ed25519 │ │
│ └────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ CONNECTIVITY LAYER (Pass-through) │
│ ┌────────────────────────────────────────────┐ │
│ │ 1. Verify Ed25519 signature ✓ │ │
│ │ 2. Forward envelope → │ (No parsing!) │
│ │ │ │
│ │ ❌ Does NOT decode Message │ │
│ │ ❌ Does NOT parse measurements │ │
│ └────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ BACKEND/MAP (Full Processing) │
│ ┌────────────────────────────────────────────┐ │
│ │ 1. Deserialize envelope and message │ │
│ │ 2. Extract metadata │ │
│ │ 3. Process public measurements │ │
│ │ 4. Try decrypt private sections │ │
│ │ 5. Store in database │ │
│ │ 6. Update map visualization │ │
│ └────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Beyond signed envelope delivery through connectivity layers, measurements can be anchored on-chain for immutable timestamping and verifiable data provenance.
┌─────────────────────────────────────────────────────────────────────┐
│ ENVELOPE DELIVERY METHODS │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ HTTP/MQTT (Standard) Blockchain (Anchored) │
│ ════════════════════ ═════════════════════ │
│ │
│ ┌──────────┐ ┌──────────┐ │
│ │ Sensor │ │ Sensor │ │
│ └────┬─────┘ └────┬─────┘ │
│ │ SignedEnvelope │ SignedEnvelope │
│ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ HTTP │ │ Send │─────┐ │
│ │ Gateway │ │ Extrinsic│ │ │
│ └────┬─────┘ └──────────┘ │ │
│ │ │ │
│ ▼ OR │ │
│ ┌──────────┐ │ │
│ │ Backend │ ┌──────────┐ │ │
│ │ Database │ │ Batch │ │ │
│ └──────────┘ │ to IPFS │─────┤ │
│ └──────────┘ │ │
│ ✓ Fast │ │
│ ✓ Cheap ▼ │
│ ✗ Mutable ┌────────────────────┐ │
│ ✗ No proof │ 📦 Blockchain │ │
│ │ (Robonomics) │ │
│ └────────────────────┘ │
│ │
│ ✓ Immutable timestamp │
│ ✓ Proof of existence │
│ ✓ Verifiable integrity │
│ ✗ Higher cost │
│ │
└─────────────────────────────────────────────────────────────────────┘
Device pushes serialized envelope directly to blockchain
┌─────────────────────────────────────────────────────────────────────┐
│ │
│ 📡 IoT Device │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 1️⃣ Measure │ │
│ │ ┌─────────┐ │ │
│ │ │ Temp │ 21.5°C │ │
│ │ │ PM2.5 │ 8.1 µg/m³ │ │
│ │ │ GPS │ (51.5, -0.1) │ │
│ │ └─────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ 2️⃣ Create SignedEnvelope │ │
│ │ ┌──────────────────────────────────┐ │ │
│ │ │ sensor_id: 0x4c7f... │ │ │
│ │ │ nonce: 0xf3a9... │ │ │
│ │ │ message: [proto bytes, │ │ │
│ │ │ incl. timestamp] │ │ │
│ │ │ signature: 0x8b2d... (64 bytes) │ │ │
│ │ └──────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ 3️⃣ Serialize to bytes │ │
│ │ [0x0a, 0x20, 0x4c, 0x7f, ...] (~200 bytes) │ │
│ │ │ │ │
│ └──────────┼────────────────────────────────────────────────┘ │
│ │ │
│ │ Submit Extrinsic │
│ ▼ │
│ ⛓️ Robonomics Blockchain │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ pallet_cps::set_payload( │ │
│ │ origin: Signed(device_account), │ │
│ │ payload: [0x0a, 0x20, 0x4c, ...] ← Full envelope │ │
│ │ ) │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────┐ │ │
│ │ │ Block #2847593 │ │ │
│ │ │ ┌───────────────────────────────────────────┐ │ │ │
│ │ │ │ Extrinsic: CPS.set_payload │ │ │ │
│ │ │ │ Account: 4CvP46mxFm54eBb... │ │ │ │
│ │ │ │ Payload: [0x0a, 0x20, 0x4c, ...] 200 B │ │ │ │
│ │ │ │ Timestamp: 2026-08-13 09:36:00 UTC │ │ │ │
│ │ │ └───────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ ✅ Stored on-chain forever │ │
│ │ ✅ Immutable timestamp │ │
│ │ ✅ Immediate finality │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ 💰 Cost: ~0.001 XRT per envelope (~200 bytes storage) │
│ ⏱️ Latency: 6-12 seconds │
│ │
└─────────────────────────────────────────────────────────────────────┘
Service collects envelopes, compresses, stores in IPFS, anchors CID
┌─────────────────────────────────────────────────────────────────────┐
│ │
│ 📡 Multiple Devices │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Sensor 1 │ │ Sensor 2 │ │ Sensor N │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ Envelope₁ │ Envelope₂ │ EnvelopeN │
│ └─────────────┴─────────────┘ │
│ │ │
│ ▼ │
│ 🌐 Connectivity Service │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 1️⃣ Collect envelopes (e.g., 100 messages) │ │
│ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │
│ │ │ E₁ │ │ E₂ │ ... │ E₁₀₀│ │ │
│ │ └─────┘ └─────┘ └─────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ 2️⃣ Create SignedEnvelopeBatch │ │
│ │ ┌──────────────────────────────────┐ │ │
│ │ │ batch: [ │ │ │
│ │ │ SignedEnvelope { ... }, │ │ │
│ │ │ SignedEnvelope { ... }, │ │ │
│ │ │ ... │ │ │
│ │ │ SignedEnvelope { ... } │ │ │
│ │ │ ] │ │ │
│ │ └──────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ 3️⃣ Serialize to protobuf │ │
│ │ [0x0a, 0xc8, 0x01, ...] (~20 KB for 100) │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ 4️⃣ Compress with zlib │ │
│ │ [0x78, 0x9c, 0xed, ...] (~8 KB, 60% reduction) │ │
│ │ │ │ │
│ └──────────┼────────────────────────────────────────────────┘ │
│ │ Store │
│ ▼ │
│ 📦 IPFS Storage │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ipfs.add(compressed_batch) │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────┐ │ │
│ │ │ CID: bafybeigdyrzt5sfp7udm7hu76uh7y26nf... │ │ │
│ │ │ │ │ │
│ │ │ Content: [0x78, 0x9c, 0xed, ...] (8 KB) │ │ │
│ │ │ │ │ │
│ │ │ Contains: 100 signed envelopes │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │ Return CID │
│ ▼ │
│ ⛓️ Robonomics Blockchain │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ pallet_cps::set_payload( │ │
│ │ origin: Signed(service_account), │ │
│ │ payload: b"bafybeigdyrzt5sfp7udm7hu..." ← Just CID │ │
│ │ ) │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────┐ │ │
│ │ │ Block #2847610 │ │ │
│ │ │ ┌───────────────────────────────────────────┐ │ │ │
│ │ │ │ Extrinsic: CPS.set_payload │ │ │ │
│ │ │ │ Account: ConnectivityService │ │ │ │
│ │ │ │ Payload: bafybeigdyrzt... (59 B) │ │ │ │
│ │ │ │ Batch Size: 100 envelopes │ │ │ │
│ │ │ └───────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ ✅ Only CID stored on-chain │ │
│ │ ✅ Batch proof for 100 measurements │ │
│ │ ✅ Cost amortized across batch │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ 💰 Cost: ~0.00001 XRT per envelope (100x cheaper) │
│ ⏱️ Latency: 30-60 seconds (batch interval) │
│ 💾 Storage: IPFS (distributed, needs pinning) │
│ │
└─────────────────────────────────────────────────────────────────────┘
Recommendation:
- Direct Anchoring → Time-critical, high-value measurements requiring guaranteed permanent storage
- Batch Anchoring → Routine telemetry at scale where cost efficiency and throughput matter most