Skip to content

Add embeddedAuth method to Universal Verifier #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

daveroga
Copy link
Contributor

@daveroga daveroga commented Jul 24, 2025

Currently we check Auth in both authResponse with authV2 method (authV2 circuit) and all the responses for request validators (on-chain credential query validator circuits).

We will add a embeddedAuth auth method for the authResponse that won’t verify the auth proof because we already are verifying embedded auth in responses for on-chain circuits now.

This will allow:

  • Save some gas in submitResponse for verification
  • Verify in some networks like Aurora that have a maximum gas limit that we are exceeding now verifying both authResponse and responses proofs.

@daveroga daveroga requested a review from Copilot July 24, 2025 15:46
Copilot

This comment was marked as outdated.

@daveroga daveroga marked this pull request as draft July 25, 2025 10:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new noAuth authentication method to the Universal Verifier system to reduce gas consumption and enable deployment on networks with gas limitations like Aurora. The implementation allows verification to proceed without an authentication proof since authentication is already verified in the response proofs for on-chain circuits.

  • Adds noAuth authentication method that skips auth proof verification
  • Modifies verifier logic to handle authentication differently based on method type
  • Updates deployment scripts and tests to support the new authentication method

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
contracts/verifiers/Verifier.sol Core logic to handle noAuth method and conditional authentication processing
contracts/verifiers/UniversalVerifier.sol Version bump to 2.1.1
contracts/lib/VerifierLib.sol New utility function to extract userID from response signals
test/integration-tests/integration-verifier.test.ts Integration tests for both authV2 and noAuth methods
scripts/upgrade/verifiers/helpers/testVerifier.ts Support for Aurora network and authMethod parameter
Multiple deployment/maintenance scripts Updates to register noAuth method during deployment
hardhat.config.ts Aurora network configuration
helpers/constants.ts Aurora chain ID mappings and version update
package.json Local SDK dependency path changes

@@ -12,7 +12,12 @@
},
"homepage": "https://github.com/iden3/contracts",
"devDependencies": {
"@0xpolygonid/js-sdk": "1.31.1",
"@0xpolygonid/js-sdk": "../../polygonid/js-sdk",
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a local file path dependency for @0xpolygonid/js-sdk instead of a published version can cause issues in CI/CD and for other developers. Consider using a published version or a git URL with a specific commit/tag.

Suggested change
"@0xpolygonid/js-sdk": "../../polygonid/js-sdk",
"@0xpolygonid/js-sdk": "git+https://github.com/0xPolygonID/js-sdk.git#<commit-or-tag>",

Copilot uses AI. Check for mistakes.

@@ -205,6 +205,18 @@ const config: HardhatUserConfig = {
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"aurora-mainnet": {
chainId: 1313161554,
url: `${process.env.AURORA_TESTNET_RPC_URL}`,
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aurora-mainnet network is configured to use AURORA_TESTNET_RPC_URL instead of AURORA_MAINNET_RPC_URL. This should be process.env.AURORA_MAINNET_RPC_URL.

Suggested change
url: `${process.env.AURORA_TESTNET_RPC_URL}`,
url: `${process.env.AURORA_MAINNET_RPC_URL}`,

Copilot uses AI. Check for mistakes.

Comment on lines 17 to 22
async function testVerification(verifier: Contract) {
// Register the DID method for your custom network
core.registerDidMethodNetwork({
method: core.DidMethod.Iden3,
blockchain: "aurora",
chainId: 1313161555,
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded chain ID (1313161555) and network configuration should be extracted to constants or made configurable, as this script appears to be for testing custom networks but has Aurora-specific hardcoded values.

Suggested change
async function testVerification(verifier: Contract) {
// Register the DID method for your custom network
core.registerDidMethodNetwork({
method: core.DidMethod.Iden3,
blockchain: "aurora",
chainId: 1313161555,
// Configurable network parameters
const NETWORK_BLOCKCHAIN = process.env.NETWORK_BLOCKCHAIN || "aurora";
const NETWORK_CHAIN_ID = parseInt(process.env.NETWORK_CHAIN_ID || "1313161555", 10);
async function testVerification(verifier: Contract) {
// Register the DID method for your custom network
core.registerDidMethodNetwork({
method: core.DidMethod.Iden3,
blockchain: NETWORK_BLOCKCHAIN,
chainId: NETWORK_CHAIN_ID,

Copilot uses AI. Check for mistakes.

getDeploymentParameters,
isContract,
} from "../../../helpers/helperUtils";
import { getConfig, getDeploymentParameters } from "../../../helpers/helperUtils";
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several import statements were removed but the functionality appears to still be needed. The getDeployedAddresses function was removed but may be used elsewhere in the deployment process.

Suggested change
import { getConfig, getDeploymentParameters } from "../../../helpers/helperUtils";
import { getConfig, getDeploymentParameters, getDeployedAddresses } from "../../../helpers/helperUtils";

Copilot uses AI. Check for mistakes.

@daveroga daveroga changed the title Add noAuth method to Universal Verifier Add embeddedAuth method to Universal Verifier Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant