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

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

Original ERC · ← ERCs