-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: master
Are you sure you want to change the base?
Add embeddedAuth method to Universal Verifier #388
Conversation
There was a problem hiding this 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", |
There was a problem hiding this comment.
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.
"@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.
hardhat.config.ts
Outdated
@@ -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}`, |
There was a problem hiding this comment.
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.
url: `${process.env.AURORA_TESTNET_RPC_URL}`, | |
url: `${process.env.AURORA_MAINNET_RPC_URL}`, |
Copilot uses AI. Check for mistakes.
async function testVerification(verifier: Contract) { | ||
// Register the DID method for your custom network | ||
core.registerDidMethodNetwork({ | ||
method: core.DidMethod.Iden3, | ||
blockchain: "aurora", | ||
chainId: 1313161555, |
There was a problem hiding this comment.
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.
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"; |
There was a problem hiding this comment.
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.
import { getConfig, getDeploymentParameters } from "../../../helpers/helperUtils"; | |
import { getConfig, getDeploymentParameters, getDeployedAddresses } from "../../../helpers/helperUtils"; |
Copilot uses AI. Check for mistakes.
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: