Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC-7522, a proposal for securely verifying the identity associated with a smart account using OIDC ID tokens and zero-knowledge proofs.
The explanation below translates, summarizes, and expands on the original proposal.
I also cover other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ERC-4337 uses account abstraction to support flexible smart accounts, enabling authentication and recovery methods that do not rely exclusively on conventional private keys. Combining this approach with OIDC (OpenID Connect) can bring a Web3 authentication experience closer to the social login commonly used by Google and other web services.
OIDC is one of the most widely used authentication protocols, and integrating it with smart accounts can improve usability. Doing so, however, requires a secure mechanism for verifying OIDC credentials on-chain. ERC-7522 proposes an OIDC verification model based on zero-knowledge proofs (ZK proofs) for use with ERC-4337.
Users can associate an OIDC identity with their smart account and verify its validity on-chain. This enables OIDC-based validation of a UserOperation. Using ZK proofs also helps protect privacy by concealing the underlying association between a Web2 identity and a Web3 address.
Because ZK verification entails computational costs, one intended use case is to use OIDC as a guardian for account recovery. Registering multiple OIDC accounts, such as Google and Facebook accounts, can also reduce the risk of relying on a single centralized provider.
Motivation
Challenges in connecting OIDC to smart accounts
An IdToken issued through OIDC typically takes the form of a JWT (JSON Web Token), which consists of three parts.
| Component | Description |
|---|---|
| Header | Indicates the signature algorithm and token type. |
| Claims | The payload containing information such as the user ID. |
| Signature | The part signed with the issuer's (IdP's) private key. |
In the RSA-based example, the signature can be verified with the issuer's published RSA public key and covers a hash of the header and claims. Although this is common in Web2, directly performing the same verification on-chain can be prohibitively expensive.
Conventional solutions: limitations of MPC
A common approach uses MPC (multi-party computation), a technique that allows multiple participants to perform computations over private data. However, this approach can have the following limitations.
- Centralized dependencies A third-party service may participate in MPC signature generation, creating risks if the service becomes unavailable or the system depends on a particular vendor.
- Privacy concerns The association between a Web2 account, such as a Google account, and a Web3 address may not be cryptographically protected.
Improvements offered by ZK verification
Zero-knowledge proofs can address these challenges.
- Privacy protection The relationship between a Web2 account and a Web3 address can be proven without disclosing the underlying information.
- Decentralized proof generation ZK proofs can be generated on the client without relying on a third-party signature generation service.
- Cost reduction through aggregation Combining multiple ZK proofs makes it possible to verify a large number of proofs at a lower cost.
The role of OIDC ZK verification in ERC-4337
The proposed model incorporates ZK-based OIDC verification into the account validation process of ERC-4337. It also defines a minimal interface and ZK input format that different ZK implementations can share, giving developers a consistent way to integrate them.
Users can associate an OIDC identity with their smart account and prove the validity of that identity on-chain during validation.
Intended use cases
Because ZK verification incurs gas costs, the proposal particularly anticipates using OIDC identities as guardians for account recovery. For example, if a private key is lost, a user can prove control of a previously registered OIDC account to recover the smart account.
Registering multiple OIDC accounts can further reduce the centralized risk of depending on one identity provider.
Specification
Definitions
The main components of OIDC ZK authentication are listed below.
| Term | Description |
|---|---|
| Identity Provider (IdP) | A service that authenticates users and issues signed ID tokens. |
| User | A client that obtains ID tokens and generates ZK proofs. |
| ZK Aggregator | An off-chain service that aggregates proofs from multiple users. |
| OpenIdZkVerifier | A contract that verifies ZK proofs on-chain. |
| EntryPoint / Aggregator / AA Account | Account abstraction execution components defined by ERC-4337. |
Processing flow
The following diagram illustrates the overall authentication flow combining OIDC, ZK proofs, and ERC-4337.

- The User authenticates with the IdP.
- The IdP returns a signed ID token (JWT) to the User.
- The User generates a ZK proof based on the JWT.
- The User sends the ZK proof to the ZK Aggregator and requests aggregation.
- The ZK Aggregator combines multiple proofs and returns the aggregated proof to the User.
- The User submits an ERC-4337 UserOperation with the ZK proof to the EntryPoint.
- Proof validity is checked as part of the EntryPoint validation process.
- Individual proof:
verify - Aggregated proof:
verifyAggregated
- Individual proof:
- If validation succeeds, the AA Account executes the UserOperation.
Interface
struct OpenIdZkProofPublicInput {
bytes32 jwtHeaderAndPayloadHash;
bytes32 userIdHash;
uint256 expirationTimestamp;
bytes jwtSignature;
}
interface IOpenIdZkVerifier {
// @notice get verification key of the open id authenticator
function getVerificationKeyOfIdp() external view returns(bytes memory);
// @notice get id hash of account
function getIdHash(address account) external view returns(bytes32);
// @notice the function verifies the proof and given a user op
// @params op: the user operation defined by ERC-4337
// input: the zk proof input with JWT info to prove
// proof: the generated ZK proof for input and op
function verify(
UserOp memory op,
OpenIdZkProofPublicInput input,
bytes memory proof
) external;
// @notice the function verifies the aggregated proof give a list of user ops
// @params ops: a list of user operations defined by ERC-4337
// inputs: a list of zk proof input with JWT info to prove
// aggregatedProof: the aggregated ZK proof for inputs and ops
function verifyAggregated(
UserOp[] memory ops,
OpenIdZkProofPublicInput[] memory inputs,
bytes memory aggregatedProof
) external;
}Structs
OpenIdZkProofPublicInput
struct OpenIdZkProofPublicInput {
bytes32 jwtHeaderAndPayloadHash;
bytes32 userIdHash;
uint256 expirationTimestamp;
bytes jwtSignature;
}This struct holds input data derived from an OIDC JWT for use in ZK verification. It combines a hash for checking JWT integrity, a user ID hash, the JWT expiration time, and signature data. This makes it possible to verify the credentials in a ZK circuit without publishing the user's original Web2 identity on-chain.
Parameters
jwtHeaderAndPayloadHash- The hash of the combined JWT header and payload.
userIdHash- A hash of the OIDC user ID, keeping the original ID undisclosed for privacy.
expirationTimestamp- The timestamp at which the JWT expires.
jwtSignature- The signature produced by the identity provider for the JWT.
Functions
getVerificationKeyOfIdp
function getVerificationKeyOfIdp() external view returns(bytes memory);Retrieves the identity provider's verification key. It returns the key needed to verify the JWT signature in the ZK circuit. The key is used to identify the relevant identity provider and establish whether the signature was produced with the corresponding valid signing key.
Return value
- Verification key
- The key used by the ZK circuit for signature verification.
getIdHash
function getIdHash(address account) external view returns(bytes32);Returns the hash of the user ID associated with the specified account. It identifies which IdP user is associated with the AA account without exposing the original user ID.
Arguments
account- The address of the target account.
Return value
- ID hash
- The hash of the registered user ID.
verify
function verify(
UserOp memory op,
OpenIdZkProofPublicInput input,
bytes memory proof
) external;Verifies a ZK proof for a single UserOperation. It checks the proof and the consistency of the JWT signature, expiration time, and user ID. This provides a mechanism for establishing that the UserOperation is authorized by the corresponding user.
Arguments
op- The UserOperation being verified.
input- JWT-derived information used for ZK verification.
proof- The ZK proof data.
verifyAggregated
function verifyAggregated(
UserOp[] memory ops,
OpenIdZkProofPublicInput[] memory inputs,
bytes memory aggregatedProof
) external;Verifies ZK proofs associated with multiple UserOperations together. Using an aggregated proof generated by the ZK Aggregator, the function validates multiple operations in a single verification. Aggregation can improve processing efficiency and reduce gas costs.
Arguments
ops- The UserOperations being verified.
inputs- The ZK proof inputs corresponding to each UserOperation.
aggregatedProof- The aggregated proof data.
Rationale
The OIDC verification model proposed for ERC-4337 uses a zero-knowledge proof derived from an OIDC ID token to establish on-chain that the user corresponds to a particular identity at an identity provider. At least three types of information are needed.
User ID
This value identifies the user at the IdP.
OpenID Connect generally represents it through the sub (subject) claim.
To protect user privacy, the proposed interface avoids directly publishing the original user ID on-chain and instead exposes its hash through getIdHash.
A single user ID may be associated with multiple smart accounts.
Identity provider's public key
The IdP uses public-key cryptography to sign ID tokens. Verifying the validity of the signature through a ZK proof requires the corresponding verification key.
The getVerificationKeyOfIdp function provides this key.
ZK proof
The user generates a ZK proof based on the JWT.
The verify function uses that proof to validate a user operation.
Two accompanying inputs are supplied for verification.
- The UserOperation (the operation to be executed under ERC-4337).
- OpenIdZkProofPublicInput (JWT-derived hashes and signature data).
For aggregated verification, verifyAggregated handles the UserOperations and their corresponding ZK proof inputs together.
OpenIdZkProofPublicInput
The following fields are required to verify JWT validity using a ZK proof.
| Field | Description |
|---|---|
| jwtHeaderAndPayloadHash | Hash of the combined JWT header and payload. |
| userIdHash | Hash of the user ID. |
| expirationTimestamp | JWT expiration time, corresponding to the exp claim. |
| jwtSignature | The identity provider's signature over the JWT signing input. |
Fields omitted from the struct
The design deliberately excludes two fields.
| Omitted field | Reason |
|---|---|
| Public key (verification key) | It can be retrieved through getVerificationKeyOfIdp and therefore need not be included in the struct. |
| User operation hash | The contract can compute the hash from the UserOperation supplied as an input. |
Avoiding redundant public inputs keeps the circuit efficient and the data structure clear.
Security considerations
Secure OIDC verification using ZK proofs requires the following conditions to be satisfied.
Expiration timestamp validation
If expirationTimestamp is not checked correctly, an attacker may replay a previously obtained ID token.
The verification process must establish the following.
expirationTimestampis not earlier than the current time.expirationTimestampuses an increasing time representation, based on the exp claim.
Using the JWT's exp claim directly provides a straightforward way to represent token expiration.
UserOperation validation
If a third party can copy and execute a UserOperation, front-running becomes a concern. ZK verification must establish the following.
- The UserOperation covered by the proof matches the UserOperation actually being executed, through hash verification.
Binding the proof to the operation prevents a third party from reusing it to authorize a different operation.
Validating userIdHash
The goal is to establish that the account submitting a UserOperation is associated with the claimed user ID. The Verifier checks the following condition.
- The
userIdHashin the ZK proof matches the hash returned bygetIdHash(account).
This prevents an attacker from impersonating the account holder by generating a proof using another user's ID.
Citation
Shu Dong (@dongshu2013) shu@hexlink.io, Yudao Yan dean@dauth.network, Song Z s@misfit.id, Kai Chen kai@dauth.network, "ERC-7522: OIDC ZK Verifier for AA Account [DRAFT]," Ethereum Improvement Proposals, no. 7522, September 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7522.
Conclusion
This article covered ERC-7522, a proposal for securely verifying identities associated with smart accounts using OIDC ID tokens and zero-knowledge proofs.
If you have any questions, feel free to reach out via Twitter DM.
I also publish on the following platforms.



