ERC-8260 On-chain Diving Logbook (Dive Log)
Draft · Signatures & auth · created 2026-05-09
A standard that lets a diver record key dive information and the hash of a dive profile file in an on-chain diving logbook they own, and lets instructors or organizations attest to that record with a signature.
Why it is needed
A diver's logbook serves as evidence of experience for certification, industrial diving regulations, and accident investigations. But most logs are written by the diver themselves on paper or in an app and verified only by a signature or stamp, making them easy to forge and hard for a third party to verify. Dive computers already record depth, time, and gas data and can export it in a common format called UDDF (Universal Dive Data Format), but there was no way to cryptographically bind the fact that a buddy, instructor, or certifying organization attested to that file. Signed files or vendor databases can prove who signed, but not since when the record has existed or whether it was modified later. This standard does not require a witness for every record, but it does let every verifier see the same ordering, timestamps, and correction history through a public, append-only log.
What to implement
event DiveLogged(uint256 indexed diveId, uint32 indexed diveDate, bytes32 contentHash);: Emitted when a new dive is registered in the logbook.event DiveAttested(uint256 indexed diveId, address indexed attester, bytes32 contentHash);: Emitted when a third party attests to a specific dive with a signature.event AttestationNonceCancelled(address indexed attester, uint256 newNonce);: Emitted when an attester raises their own nonce to invalidate a signature that has not yet been submitted.function owner() external view returns (address);: Returns the address that owns the logbook and holds the authority to record and void entries.function logDive(DiveInput calldata input) external returns (uint256 diveId);: Registers a single dive and returns the newly assigned dive ID.function batchLogDives(DiveInput[] calldata inputs) external returns (uint256[] memory diveIds);: Registers up to 20 dives in a single transaction.function voidDive(uint256 diveId, uint256 supersededById, string calldata reason) external;: Voids an existing dive record or supersedes it with another record.function cancelAttestationNonce() external;: Lets an attester raise their own nonce to invalidate a signature that has not yet been submitted.function getDive(uint256 diveId) external view returns (DiveHeader memory);: Returns the full header information for a specific dive.function getDiveCount() external view returns (uint256);: Returns the total number of dives recorded in the logbook.function isDiveVoided(uint256 diveId) external view returns (bool);: Returns whether a specific dive has been voided.function getVoidInfo(uint256 diveId) external view returns (VoidInfo memory);: Returns the void details (superseding dive ID, who processed it, timestamp, and reason).function attestationCount(uint256 diveId) external view returns (uint256);: Returns the number of attestations attached to a specific dive.function getAttestation(uint256 diveId, uint256 index) external view returns (AttestationRecord memory);: Returns the attestation record at a specific index for a specific dive.function attesterNonce(address attester) external view returns (uint256);: Returns the current nonce value for a specific attester.
In depth
Structure Consisting of a Header, Hash, and Optional URI
Each record consists of a compact on-chain header that remains meaningful even if the profile file is lost (date, time, depth, total time, bottom time, mode, units, gas mix, table schedule, repetitive group letter, approximate geohash), a required contentHash, and an optional profileURI. contentHash is the SHA-256 of the exact byte sequence of a UTF-8 XML-encoded UDDF 3.x file, and must be the raw original without a BOM, reconversion, or normalization. A content-addressed profileURI (ipfs:// or ar://) is recommended, but the hash remains the final authority.
Dive Mode, Unit, and Gas Mix Encoding
DiveMode is one of OCRecreational, OCTechnical, CCR, SCR, Freedive, SurfaceSupplied, or Saturation. UnitSystem is a pressure unit that applies only to the maxDepth field: Imperial is in tenths of fsw and Metric is in tenths of msw, not a length unit. o2Bps/heBps record the primary breathing gas in basis points; if either is nonzero, o2Bps must be greater than 0 and the sum must not exceed 10000.
Table Schedule and Repetitive Group Letter
tableSchedule is right-padded with NUL in bytes16 ASCII, in the format '<TOKEN>' or '<TOKEN> <schedule>'. The canonical tokens are USN, PADI, NAUI, BSAC, BUEHL, DCIEM, CSMD, COMEX, and OTHER. repetitiveGroup and repetitiveGroupAfterSI are either 0x00 (unrecorded) or a letter A-Z, with field dependency rules such as requiring tableSchedule to also be recorded whenever a letter is present.
Logging and Validation
logDive and batchLogDives can only be called by the owner, and revert with a specific error if depth is 0 or if the time, date, gas, table, or repetitive group conditions are violated. IDs are assigned sequentially starting from 1, and headers are append-only and cannot be modified or deleted. batchLogDives processes up to 20 entries in an all-or-nothing manner, and dives with past dates can also be registered retroactively.
Correcting with Void and Supersede
voidDive can only be called by the owner and does not erase or change the existing header. Leaving supersededById at 0 voids the record without a replacement, while specifying another dive ID supersedes it with that record. It reverts if an already-voided record or the record itself is specified as the replacement target. Consumers should always check isDiveVoided before trusting a record.
EIP-712 Attestation and Nonce Management
An attestation signs diveId, contentHash, and nonce within an EIP-712 domain made up of name="DiveLog", version="1", chainId, and verifyingContract. The signature must have v equal to 27/28 or 0/1, and a malleable signature whose s value exceeds secp256k1n/2 is rejected. The nonce increases sequentially by 1 per attester, and cancelAttestationNonce can invalidate a signature that has not yet been submitted. The same attester can attest to a given dive only once.
Consistency Rules with the UDDF Profile
The standard defines which position in the UDDF file each header field corresponds to (for example, informationbeforedive/datetime, informationafterdive/diveduration, greatestdepth, gasdefinitions/mix, divetable, surfaceintervalbeforedive) and requires that they match within a tolerance. Values that have no corresponding element in UDDF (the full table schedule string, the repetitive group letter, certain modes) must be written in informationafterdive/notes using a defined phrase. However, this consistency cannot be checked directly by the contract, so consumers must obtain the file and compare it themselves.
Gas Costs and Current Status
Based on the reference implementation, logDive costs about 117,500 gas without a URI and about 205,200 gas with a 66-byte CIDv1 ipfs:// URI. Registering 20 entries via batchLogDives costs about 1.85 million gas without URIs and about 3.61 million gas with CIDv1 URIs, so layer 2 deployment is recommended for cost-sensitive use cases. This proposal is still in Draft status, so details may change or the work may stall.
Things to watch out for
- The Difference Between Self-reporting and Attestation: A record without an attestation is merely the owner's claim, and an attestation only proves that an address vouched for a specific content hash at that point in time. Anyone can create a key and attest without limit, so the number of attestations by itself is not a trust signal.
- Possible Mismatch Between Header and Profile File: contentHash is bound only to the UDDF file bytes, and whether the header fields actually match that file is not verified on-chain. Attestations also only sign diveId, contentHash, and nonce, so you must parse the profile file you hold yourself and compare all fields directly.
- Attester Key Leakage and Inability to Revoke: This interface cannot revoke an attestation that has already been recorded, so a leaked attester key can attest to arbitrary dives in any ERC-8260 contract on any chain. Consumers must refer to a separate identity verification source that supports revocation timing.
- Owner Key Loss and Record Completeness: If the owner loses their key, the logbook simply stops, and a single logbook contract does not prove a complete career history. An owner may maintain multiple logbooks or may not record some dives at all.
- Privacy: Names and exact coordinates are not recorded on-chain, but identity can still be revealed from a wallet address and public dive history alone, and voiding a record does not remove data that remains on-chain.