Five-Layer Architecture Summary
Protected Record Types
The integrity system covers 19 record types across four operational domains:Layer 1: Record Hashing
Algorithm
SHA-384 is the default hash algorithm, selected per CNSA 2.0 (Committee on National Security Systems Advisory) mandate for post-quantum crypto agility. SHA-256 is supported for backward compatibility.Canonical Serialization
Before hashing, record data is serialized into a canonical form:- All keys are sorted alphabetically.
undefinedvalues are omitted;nullvalues are preserved.- The result is JSON-stringified.
- If the record has a predecessor in the chain, the previous hash is prepended
with a colon separator:
{previousHash}:{canonicalJSON}.
Hash Result
Every hash computation returns both the hex digest and the algorithm identifier, enabling future algorithm migration without breaking verification:Layer 2: Hash Chain
Chain Structure
Each aircraft maintains its own hash chain — a sequential linked list where every record references the hash of its immediate predecessor.Chain Verification Rules
Chain verification checks three invariants:- Genesis validity: The first entry (
chainSequence: 0) must havepreviousHash: null. - Sequence contiguity: Each entry’s
chainSequencemust equalpreviousEntry.chainSequence + 1. - Hash linkage: Each entry’s
previousHashmust equal the preceding entry’srecordHash.
Full Verification
Full verification combines chain verification with individual record re-hashing:- Verify chain linkage (structure).
- For each record, re-compute the hash from source data and compare to the
stored
recordHash.
Merkle Tree
For external anchoring, individual record hashes are batched into a binary Merkle tree using SHA-384:- Pairs of hashes are concatenated and hashed to produce parent nodes.
- If a level has an odd number of nodes, the last node is duplicated.
- The root of the tree is a single hash representing all records in the batch.
Layer 3: RFC 3161 Trusted Timestamping
Protocol
RFC 3161 (IETF) defines the Time-Stamp Protocol (TSP). PlaneConnection builds DER-encoded TimeStampReq messages and submits them to accredited TSAs over HTTPS.TSA Endpoints
Hashes are submitted to three TSAs in parallel for redundancy:
Any single successful response provides sufficient temporal proof. Having
multiple TSAs protects against TSA downtime and provides independent
corroboration.
TimeStampReq Structure
Token Structure
Verification
Layer 4: OpenTimestamps (Bitcoin Anchoring)
Protocol
OpenTimestamps aggregates hashes into a Merkle tree and anchors the root in a Bitcoin transaction’sOP_RETURN output. This provides the strongest
immutability guarantee — rewriting a Bitcoin anchor requires controlling 51%
of the Bitcoin network’s hash power.
Calendar Servers
Digest Requirements
OTS calendars require exactly 32-byte (SHA-256) digests. When the record uses SHA-384, the hex string is first re-hashed with SHA-256 to produce the required 32 bytes before submission.Proof Lifecycle
- Submission: Digest bytes are POSTed to
/digeston the calendar server. - Pending proof: The calendar returns an incomplete proof file containing
the calendar commitment. Stored with status
pending. - Upgrade: A background process polls the calendar server to upgrade pending proofs once the Bitcoin block is confirmed (typically 10—60 minutes).
- Complete proof: The upgraded proof contains the full Merkle path from
the record hash to the Bitcoin block header. Status becomes
confirmed.
Verification
Layer 5: EVM Smart Contract
PlaneConnection has deployed two generations of anchor contracts. Both are live and referenced by existing proofs.RecordAnchor V1
The original anchor contract — a minimal Solidity contract that stores bytes32 Merkle roots with timestamps. No access control; gas cost is the economic gate.UniversalAnchor V2
The current-generation anchor contract extends V1 with batch anchoring, workspace and record-type scoping, access control, and an emergency pause mechanism. Key features:- Batch anchoring. Anchor hundreds of Merkle roots in a single transaction, dramatically reducing gas costs for high-volume operators.
- Workspace scoping. Each anchor is associated with a workspace identifier, enabling efficient per-operator querying and audit filtering.
- Record-type classification. Anchors carry a record-type tag (e.g.,
safety_report,work_order,flight_log), enabling domain-specific verification queries. - Ownable access control. Only authorized addresses can submit anchors, preventing unauthorized writes.
- Pausable emergency stop. The contract owner can pause anchoring in an emergency without redeploying, then resume when the issue is resolved.
Gas Cost Comparison
Deployed Addresses
Transaction Flow
- Record hashes are batched into a Merkle tree and the root is computed.
- For V1: the root (padded to bytes32) is submitted as a single anchor call.
- For V2: one or more roots are submitted in a batch call with workspace and record-type metadata.
- The transaction is confirmed with 1 block confirmation (60-second timeout).
- The transaction hash, block number, and gas used are stored alongside the records.
Verification
Block explorer: Search the transaction hash on PolygonScan (Amoy). TheAnchored event log
shows the Merkle root, sender, and block timestamp. For V2 batch transactions,
each root in the batch emits a separate event with its workspace and record-type
tags.
Programmatic: Query the contract’s getAnchor function (V1) or
getAnchor with workspace filtering (V2) using any Ethereum-compatible client
library. The returned struct contains the Merkle root, timestamp, and sender
address.
Anchor Orchestrator
The anchor orchestrator coordinates all three external layers in parallel. A failure in one layer does not block the others.Strategies
Individual layers can also be skipped regardless of strategy.
Result
The orchestrator returns a result containing:- The Merkle root that was anchored.
- The hash algorithm used.
- An array of layer results (one per activated layer), each with success/failure status and layer-specific tokens, proofs, or transaction data.
- The
anchoredAttimestamp. - A flag indicating whether every activated layer succeeded.
Proof Lifecycle States
State Transitions
Cross-Layer Verification
A periodic verification process compares the canonical record hash against hashes stored in each anchor layer. If any layer’s hash disagrees with the base hash, the record is flagged as inconsistent and a tamper alert is generated. The check processes up to 500 anchored records per run. Records without any anchor layers are skipped. The result includes counts of checked, consistent, and inconsistent records, plus human-readable alerts for each discrepancy.Proof Bundle Contents
When you export a proof bundle from PlaneConnection, it contains the following for each included record:Related
Record Integrity Architecture
Why five layers, regulatory context, and trust model design.
Verify Record Integrity
Step-by-step verification and proof bundle export guide.
Manage Work Orders
Work orders that generate records added to the hash chain.
Notification Channels
Alert configuration for hash chain break notifications.