ERC-8356 Purpose-scoped third-party data consent (Purpose-Bound Third-Party Data Consent)

Draft · Other · created 2026-07-30

A standard that lets a data subject delegate access to information about themselves to a third party, scoped by purpose, duration, and count, while allowing the delegate's authority alone to be revoked separately or the entire consent to be publicly revoked at any time.

Why it is needed

Once consent is granted, data passes through multiple institutions and is processed into multiple forms, but every delegation standard so far has used a two-party structure where an asset owner lends authority over their own asset to someone else. By contrast, in cases like medical information where the person giving consent differs from the person who benefits from that information, the scope of authority must narrow progressively as it is passed along, and it must be possible to switch off only the intermediary standing in between (such as a software agent) independently. Existing standards have no such structure. There is also no standard that enforces purpose in code, and the GA4GH Passport tokens currently used for genomic data access have no revocation list, so access can persist until expiration, and status can only be checked once per hour, meaning that even after consent is withdrawn it takes time before access is actually cut off.

What to implement

In depth

A three-party structure: subject, grantee, and agent

This standard divides parties into three: the subject who consents, the grantee who receives access rights, and the agent who can actually exercise those rights on the grantee's behalf. The subject is not the party who benefits. Existing standards like ERC-4907, ERC-5006, and ERC-8226 were all two-party structures in which the asset owner themselves lends out rights, but handling cases such as medical data, where the party who consents differs from the party who benefits, requires a third-party subject concept. Grants are issued against an existing asset token (assetContract, assetTokenId), so the fact of consent is recorded in that asset's history.

The ConsentGrant struct and status values

A grant is stored as a ConsentGrant struct holding the fields scopeRef, purposeProfileRef, termsRef, parentGrantId, assetTokenId, subjectCommit, grantee, notBefore, expiresAt, agent, ops, purposeCode, status, flags, depth, agentKind, agentStatus, suspendedBy, lastUsedAt, useCount, usesMax, usageEpoch, usageCount, agentOperator, and assetContract, using 11 storage slots (0 through 10) in total. status takes one of 7 values: NONE, ACTIVE, REVOKED_BY_SUBJECT, RENOUNCED_BY_GRANTEE, TERMINATED_BY_ISSUER, SUSPENDED, or EXHAUSTED. Input is accepted not as the full ConsentGrant but as a narrower GrantInput struct, because passing the full struct as a function argument would push the ABI decoder past the EVM stack limit and fail to compile.

Creating consent with subjectCommit and an EIP-712 signature

The subject does not leave their address directly on chain. Instead only the commitment subjectCommit = keccak256(abi.encode(subjectSalt, subjectKey)) is left, and subjectSalt carries at least 128 bits of entropy and is never stored or emitted in an event. The grant function allows only (a) a direct call where msg.sender equals subjectKey, or (b) a case where subjectKey has signed EIP-712 typed data named Grant. The nonce consumes the nonces(subjectCommit) value on every grant call to prevent replay, and signatures are no longer accepted once the deadline has passed.

subGrant's attenuation rules

subGrant can only be called by the parent's grantee, and the parent must be an active grant with FLAG_DELEGABLE set. The child's subjectCommit, assetContract, and assetTokenId must match the parent's, ops must be a subset of the parent's, expiresAt cannot be later than the parent's, and notBefore cannot be earlier than the parent's. purposeCode must either match the parent's or be a narrower purpose registered in the registry, and if the parent's usesMax is not 0 (unlimited), the child's must also be nonzero and cannot exceed the parent's value. When scopeRef is a Merkle root, the child's scope must be proven as a leaf under that root via scopeProof, and an unproven child scope must be rejected.

Revocation paths and irreversible states

revokeBySubject can only be called by the subject, takes effect immediately with no conditions, and cannot be blocked by the grantee, issuer, or operator. It must propagate immediately to all sub-grants, but recording every descendant in a single call could exceed the gas limit, so lazy evaluation is permitted and recommended. REVOKED_BY_SUBJECT, RENOUNCED_BY_GRANTEE, TERMINATED_BY_ISSUER, and EXHAUSTED are all terminal states that cannot be reverted back to ACTIVE. The sole exception is returning from SUSPENDED to ACTIVE via resume, which only the party recorded in suspendedBy can call. A subject's revocation is always recorded with priority over any other terminal state.

checkAccess only authenticates an on-chain caller

checkAccess verifies the agent or grantee based on msg.sender. However, calling this function off-chain via eth_call lets the caller set the from value themselves, so it provides no authentication at all. If a client sets from to the agent's address, it can get back true even without actually holding the authorization. So a party judging access off-chain must not use a standalone checkAccess call as proof of identity, and should instead require independent authentication alongside it, such as isGrantActive or effectiveStatus (which do not depend on msg.sender) plus a separate signature. When an on-chain caller goes through checkAccess within the same transaction, it is safe, because msg.sender is the actual EVM caller.

usesMax is not a cryptographic guarantee

Rather than emitting an event for every single access, an off-chain hash chain (h_i = keccak256(h_{i-1}, record_i)) is accumulated, and its head is periodically posted on-chain via commitUsage(grantId, epoch, headHash, count). Only the grantee, or an agent whose agentStatus is ACTIVE, can make this call, and once the cumulative usage count reaches usesMax, the status changes to EXHAUSTED. However, because the party posting the record on-chain is the same party being limited by usesMax, this limit is only a contractual, self-reported bound and not a cryptographically enforced value. There is no external way to detect it if a grantee simply never posts usage records at all.

A proposal still at the Draft stage

ERC-8356 is a proposal in Draft status created on July 30, 2026, and consensus on it has not yet been reached. As the body itself notes, because EIP-712 signing packs 7 fields into a single policy word, wallets have difficulty displaying the signed content to users in readable form. This limitation remains a known issue, and the design of registration authority for the purpose registry, as well as the resourceId used as a Merkle leaf, may vary by implementation. Detailed fields and function signatures may still change going forward.

Original ERC · ← ERCs