Discussion topic for ERC-: Dive Log Standard
Update Log
2026-05-04: Initial draft, seeking community feedback.
2026-05-09: Moved from a two-contract Registry/Factory pattern to a universal sis. Added voidDive (supersede) and attestDive (cryptographic verification) mechanisms based on early feedback.
2026-05-10: PR created Dive-Logbook-PR
2026-05-11: The contract is now purely a dive ledger. Wallet-as-identity is the right call, it avoids the PII trap entirely. I reviewed but ultimately kept the dual unit system. Since each dive declares its own UnitSystem, the data is self-describing and auditable. No silent conversion errors, and we won’t require divers to try and convert dive data before logging.
2026-05-15: Refactor: update dive log schema with coordinates, nonce tracking, and refined data types.
Summary
This ERC defines a standard interface for storing, retrieving, and verifying dive log data on EVM-compatible blockchains. Rather than dictating how contracts are deployed (e.g., via a central registry or factory), this standard defines a universal IDiveLogBook interface. This ensures that whether a logbook is deployed by a major certification agency (PADI, NAUI), a military unit, or an independent diver, the resulting records are fully interoperable and easily verified across any platform.
The data model is derived from U.S. military diving log standards (DD Form 2544, ENG Form 4615) and covers commercial, military, scientific, and recreational diving operations, including full decompression planning, breathing gas mixtures, and environmental conditions.
Motivation for ERC
Dive logs are safety-critical records that track decompression history, demonstrate qualifications, and provide evidence of experience. Current storage methods (paper logbooks, centralized apps, institutional databases) are fragile, vendor-locked, and lack interoperability.
This standard provides:
- Permanence — data survives any single point of failure
- Ownership — divers control their records via wallet keys
- Interoperability — a single schema any application can read/write
- Verifiability — records are cryptographically signed and timestamped
Architecture
- The Sovereign Interface: We standardize the book, not the bookstore. Any contract implementing
IDiveLogBookis a valid logbook. - The Corrective Ledger (Void/Supersede): Dive logs are safety-critical and must be immutable. However, human error (typos) happens. Instead of deleting or editing records, we implement a professional accounting standard: a
voidDivefunction that flags a record as invalid and optionally points to asupersededByIdcontaining the corrected data. - On-Chain Attestations: Dives can be cryptographically verified (
attestDive) by a supervisor or buddy, eliminating “pencil-whipping” (faking logs) and establishing high-trust audit trails for commercial operations. - Unit-agnostic pressure fields: (cylinderPressureIn, cylinderPressureOut, gasConsumed) interpreted via the dive’s UnitSystem.
- No PII on-chain: SSN, military IDs, names and other sensitive identifiers are deliberately excluded.
Specification Summary
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;
import "./IDiveLogTypes.sol";
import "./IERC165.sol";
interface IDiveLog is IERC165 {
event DiveLogged(uint256 indexed diveId, uint64 indexed diveDate);
event DiveVoided(uint256 indexed diveId, uint256 indexed supersededById, address indexed voidedBy, string reason);
event DiveAttested(uint256 indexed diveId, address indexed attester);
error NotOwner();
error InvalidDepth();
error InvalidTimes();
error DiveNotFound(uint256 diveId);
error DiveAlreadyVoided(uint256 diveId);
error InvalidSupersede(uint256 voidedId, uint256 supersededId);
error AlreadyAttested(uint256 diveId, address attester);
error InvalidSignature();
error NonceMismatch(uint256 expected, uint256 provided);
function logDive(DiveInput calldata input) external returns (uint256 diveId);
function batchLogDives(DiveInput[] calldata inputs) external returns (uint256[] memory diveIds);
function voidDive(
uint256 diveId,
uint256 supersededById,
string calldata reason
) external;
function attestDive(
uint256 diveId,
uint256 nonce,
bytes calldata signature
) external;
function getDive(uint256 diveId) external view returns (DiveLog memory);
function getDivesByDate(uint64 date) external view returns (uint256[] memory);
function getMultipleDives(uint256[] calldata diveIds) external view returns (DiveLog[] memory);
function getAllDiveIds() external view returns (uint256[] memory);
function getDiveCount() external view returns (uint256);
function isDiveVoided(uint256 diveId) external view returns (bool);
function getVoidInfo(uint256 diveId) external view returns (VoidInfo memory);
function getAttestations(uint256 diveId) external view returns (Attestation[] memory);
function attesterNonce(address attester) external view returns (uint256);
}
Reference Implementation:
Solidity (Foundry), 35 tests passing including fuzz tests:
Questions for Feedback
Is the two-contract (registry + per-diver log book) architecture the right granularity, or would a single-contract with mapping-based storage be preferred for gas efficiency?Should the standard include a verification/attestation mechanism (e.g., a dive supervisor or buddy co-signing a dive record)?- Are there additional dive modes or breathing gas types the community would want beyond SSA/SCUBA and the six defined gas types?
Is the append-only constraint too restrictive, or is it appropriate given the safety-critical nature of dive logs?
Full specifications
Field reference