Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Jun 20, 2025

bump builds for temp testing

  • ios 133
  • android 72
  • update lock files
  • ios build fixes
    • add @tamagui/toast
  • android build fixes
    • upgrade react native gesture handler to 2.24.0
    • migrate from deprecated fotoapparat source to maintained version

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces a major refactor and expansion of the identity verification smart contract system, focusing on modularity, extensibility, and improved data structures. It adds new libraries, updates interfaces, restructures storage and verification flows, and introduces comprehensive tests for both passports and EU ID cards. The changes also remove obsolete SDK test projects and related configuration, while updating build scripts and workspace settings.

Changes

Files / Groups Change Summary
contracts/contracts/IdentityVerificationHubImplV2.sol, contracts/contracts/abstract/SelfVerificationRoot.sol, contracts/contracts/interfaces/IIdentityVerificationHubV2.sol, contracts/contracts/interfaces/ISelfVerificationRoot.sol, contracts/contracts/libraries/SelfStructs.sol, contracts/contracts/libraries/CustomVerifier.sol, contracts/contracts/libraries/GenericFormatter.sol Major refactor of the identity verification hub and root contracts; new modular libraries and interfaces; updated data structures for verification configs and outputs; new extensible verification flow and callback system.
contracts/contracts/libraries/CircuitAttributeHandler.sol, contracts/contracts/libraries/CircuitAttributeHandlerV2.sol, contracts/contracts/libraries/IdCardAttributeHandler.sol Error names standardized (e.g., INSUFFICIENT_CHARCODE_LEN → InsufficientCharcodeLen); OFAC check functions updated for type consistency; internal logic and comments clarified.
contracts/contracts/libraries/Formatter.sol Refined forbidden country code extraction logic for packed data, handling byte alignment and order.
contracts/contracts/verifiers/disclose/Verifier_vc_and_disclose_id.sol Added new zk-SNARK verifier contract for ID card disclosure.
contracts/contracts/verifiers/register_id/Verifier_register_id_sha256_sha256_sha256_rsa_65537_4096.sol Formatting and style adjustments, no logic changes.
contracts/contracts/registry/IdentityRegistryIdCard.sol, contracts/contracts/registry/IdentityRegistryIdCardImplV1.sol Proxy contract removed; unused imports cleaned up in implementation.
contracts/contracts/constants/CircuitConstantsV2.sol Updated constant for passportNoSmtRootIndex for EU ID cards.
contracts/package.json, contracts/hardhat.config.ts, contracts/scripts/dev.sh, contracts/scripts/test.sh, contracts/scripts/README.md Build scripts updated to use yarn; new dev/test scripts and documentation added; Solidity compiler config simplified.
contracts/ignition/modules/, contracts/scripts/set.ts Minor formatting and style updates in deployment scripts.
circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom Added range check for input length using Num2Bits; new imports.
circuits/circuits/utils/passport/disclose/disclose_id.circom, circuits/tests/disclose/vc_and_disclose_id.test.ts Adjusted MRZ byte length from 88 to 90; tests and comments updated accordingly.
circuits/scripts/build/build_disclose_circuits.sh, circuits/scripts/build/common.sh Added new circuit to build list; adjusted include paths; disabled zkey contribution step.
circuits/circuits/utils/crypto/bigInt/bigInt.circom, circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom Whitespace and comment formatting only.
common/index.ts, common/package.json Exported buildSMT; bumped package version.
contracts/test/unit/CustomVerifier.test.ts, contracts/test/unit/GenericFormatter.test.ts, contracts/test/utils/constants.ts, contracts/test/utils/deploymentV2.ts, contracts/test/utils/formatter.ts, contracts/test/utils/generateProof.ts, contracts/test/utils/types.ts, contracts/test/v2/discloseId.test.ts, contracts/test/v2/disclosePassport.test.ts, contracts/test/v2/hubOther.test.ts, contracts/test/v2/registerId.test.ts, contracts/test/v2/registerPassport.test.ts, contracts/contracts/tests/TestCustomVerifier.sol, contracts/contracts/tests/TestSelfVerificationRoot.sol, contracts/contracts/tests/testGenericFormatter.sol New or updated tests for V2 verification and registration flows, including end-to-end and unit tests for both passport and ID card attestations; new test contracts and utilities.
contracts/test/integration/.test.ts, contracts/test/unit/.test.ts Minor style, import, and formatting updates in existing tests.
sdk/tests/api-server/, sdk/tests/web-app/ Entire API server and web app test projects deleted, including configs, scripts, routes, and documentation.
package.json Removed sdk/tests/* from workspaces.
app/, .github/, circuits/* Minor updates: version bumps, dependency updates, gesture/UX tweaks, build workflow changes, and internal refactors.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Contract
  participant Registry
  participant Verifier
  participant CustomVerifierLib

  User->>Contract: verify(proofPayload, userContextData)
  Contract->>Contract: decode input, extract attestationId
  Contract->>Registry: fetch registry address for attestationId
  Contract->>Verifier: fetch verifier for attestationId/type
  Contract->>Contract: perform scope, root, date, Groth16 checks
  Contract->>CustomVerifierLib: customVerify(attestationId, config, proofOutput)
  CustomVerifierLib-->>Contract: GenericDiscloseOutputV2
  Contract->>User: emit VerificationCompleted(output, userData)
Loading

Possibly related PRs

Suggested reviewers

  • remicolin

Poem

A rabbit hopped through fields of code,
Refactoring smart contracts on its road.
With structs and verifiers, libraries anew,
It checked forbidden countries, and OFAC too.
Now passports and ID cards both verify with glee—
All thanks to this bunny's code harmony!
🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🔭 Outside diff range comments (1)
contracts/contracts/libraries/Formatter.sol (1)

158-213: Consider refactoring to improve readability and reduce duplication.

The function contains repetitive byte extraction and reversal logic across multiple conditional branches. This could be simplified for better maintainability.

Consider extracting helper functions:

 function extractForbiddenCountriesFromPacked(
     uint256[4] memory publicSignals
 ) internal pure returns (string[MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH] memory forbiddenCountries) {
     for (uint256 i = 0; i < 4; i++) {
         if (publicSignals[i] >= SNARK_SCALAR_FIELD) {
             revert InvalidFieldElement();
         }
     }
+
+    function reverseBytes3(uint256 data) pure returns (uint24) {
+        return uint24(((data & 0xff) << 16) | ((data & 0xff00)) | ((data & 0xff0000) >> 16));
+    }

     for (uint256 j = 0; j < MAX_FORBIDDEN_COUNTRIES_LIST_LENGTH; j++) {
         uint256 byteIndex = (j * 3) % 93;
         uint256 index = j / 31;

         if (byteIndex + 2 < 31) {
             uint256 shift = byteIndex * 8;
             uint256 mask = 0xFFFFFF;
             uint256 packedData = (publicSignals[index * 3] >> shift) & mask;
-            uint256 reversedPackedData = ((packedData & 0xff) << 16) |
-                ((packedData & 0xff00)) |
-                ((packedData & 0xff0000) >> 16);
-            forbiddenCountries[j] = string(abi.encodePacked(uint24(reversedPackedData)));
+            forbiddenCountries[j] = string(abi.encodePacked(reverseBytes3(packedData)));

Additionally, consider adding documentation explaining the packed data format and why 93 bytes are used (3 × 31-byte segments).

🧹 Nitpick comments (14)
contracts/contracts/example/HappyBirthday.sol (1)

1-202: Consider removing or relocating disabled example contracts

The entire SelfHappyBirthday contract is now commented out. Instead of leaving a fully commented file in the codebase, it’s cleaner to either delete it or move it to a dedicated deprecated/ or examples/ directory. This will improve readability and reduce maintenance overhead.

contracts/contracts/libraries/SelfStructs.sol (2)

101-123: Consider consolidating identical verification config structs.

VerificationConfigV1 and VerificationConfigV2 have identical field definitions. If they're truly the same, consider using a single struct or add comments explaining the intended differences for future versioning.

-    struct VerificationConfigV1 {
-        bool olderThanEnabled;
-        uint256 olderThan;
-        bool forbiddenCountriesEnabled;
-        uint256[4] forbiddenCountriesListPacked;
-        bool[3] ofacEnabled;
-    }
-
-    struct VerificationConfigV2 {
-        bool olderThanEnabled;
-        uint256 olderThan;
-        bool forbiddenCountriesEnabled;
-        uint256[4] forbiddenCountriesListPacked;
-        bool[3] ofacEnabled;
-    }
+    struct VerificationConfig {
+        bool olderThanEnabled;
+        uint256 olderThan;
+        bool forbiddenCountriesEnabled;
+        uint256[4] forbiddenCountriesListPacked;
+        bool[3] ofacEnabled;
+    }
+    
+    // Type aliases for version compatibility
+    type VerificationConfigV1 is VerificationConfig;
+    type VerificationConfigV2 is VerificationConfig;

30-52: Consider consolidating similar output structs.

PassportOutput and EuIdOutput have identical field structures. Consider using a generic struct or adding comments explaining the differences to justify separate definitions.

-    struct PassportOutput {
-        uint256 attestationId;
-        bytes revealedDataPacked;
-        uint256 userIdentifier;
-        uint256 nullifier;
-        uint256[4] forbiddenCountriesListPacked;
-    }
-
-    struct EuIdOutput {
-        uint256 attestationId;
-        bytes revealedDataPacked;
-        uint256 userIdentifier;
-        uint256 nullifier;
-        uint256[4] forbiddenCountriesListPacked;
-    }
+    struct VerificationOutput {
+        uint256 attestationId;
+        bytes revealedDataPacked;
+        uint256 userIdentifier;
+        uint256 nullifier;
+        uint256[4] forbiddenCountriesListPacked;
+    }
+    
+    // Type aliases for specific verification types
+    type PassportOutput is VerificationOutput;
+    type EuIdOutput is VerificationOutput;
contracts/scripts/dev.sh (1)

72-78: Consider preserving cache selectively.

The clean command removes all cache and artifacts directories. Consider preserving some cache for faster subsequent builds, or provide an option for deep vs. shallow cleaning.

         "clean")
             print_status "Cleaning build artifacts..."
             npx hardhat clean
-            rm -rf cache/
+            rm -rf cache/solidity-files-cache.json
             rm -rf artifacts/
             rm -rf typechain-types/
             print_success "Build artifacts cleaned"
contracts/test/unit/GenericFormatter.test.ts (1)

126-164: Comprehensive generic disclose output testing.

The test validates encoding and decoding of generic disclose output structures with comprehensive field validation, ensuring proper data serialization.

Minor observation on line 151: The assertion compares genericDiscloseOutputV2.attestationId.toString() with itself, which will always pass. Consider comparing the decoded value instead:

-    expect(genericDiscloseOutputV2.attestationId.toString()).to.equal(genericDiscloseOutputV2.attestationId);
+    expect(genericDiscloseOutputLatest[0][0]).to.equal(genericDiscloseOutputV2.attestationId);
contracts/contracts/libraries/Formatter.sol (1)

157-157: Address the TODO comment before merging.

The TODO comment indicates that this function needs further review. Please either address the concern or create a tracking issue for it.

Would you like me to help review this function's logic or create an issue to track this TODO?

contracts/test/v2/discloseId.test.ts (1)

1-904: Exceptional end-to-end test coverage for ID card verification!

This test suite thoroughly covers all verification scenarios including edge cases for invalid proofs, configuration mismatches, date validation, OFAC checks, and more. The test organization and assertions are excellent.

Consider adding brief comments before complex test scenarios (e.g., the OFAC and forbidden countries tests) to explain the test setup and expected behavior for future maintainers.

contracts/test/v2/disclosePassport.test.ts (1)

133-135: Consider using ethers.ZeroHash for clarity

While the string comparison works, using ethers.ZeroHash would be more explicit and type-safe.

-    if (currentRoot.toString() === "0") {
+    if (currentRoot === ethers.ZeroHash) {
contracts/contracts/libraries/CustomVerifier.sol (1)

144-156: Consider documenting why ID cards skip document number OFAC checks.

The implementation correctly handles ID card verification, but it would be helpful to add a comment explaining why document number OFAC checks are not applicable to ID cards.

         if (verificationConfig.ofacEnabled[0] || verificationConfig.ofacEnabled[1]) {
             if (
                 !CircuitAttributeHandlerV2.compareOfac(
                     AttestationId.EU_ID_CARD,
                     idCardOutput.revealedDataPacked,
+                    // ID cards don't have document number OFAC checks
                     false,
                     verificationConfig.ofacEnabled[0],
                     verificationConfig.ofacEnabled[1]

Also applies to: 208-212

contracts/contracts/interfaces/IIdentityVerificationHubV2.sol (1)

92-113: Document array length requirements for batch operations.

The batch update functions should document that all input arrays must have equal lengths to prevent implementation errors.

     /**
      * @notice Batch updates register circuit verifiers.
+     * @dev All arrays must have the same length.
      * @param attestationIds An array of attestation identifiers.
      * @param typeIds An array of signature type identifiers.
      * @param verifierAddresses An array of new register circuit verifier addresses.
      */
contracts/contracts/IdentityVerificationHubImplV2.sol (4)

32-33: Remove or implement the bridge address TODO comment.

The comment suggests considering adding a bridge address for cross-chain support, but this is left unimplemented. Either remove this comment or create a tracking issue for implementing cross-chain functionality.

Would you like me to create an issue to track the implementation of cross-chain bridge functionality?


105-106: Consider making the LengthMismatch error more specific.

The error name is too generic. Consider renaming it to be more specific about what arrays have mismatched lengths, such as ArrayLengthMismatch or BatchUpdateLengthMismatch.

-    error LengthMismatch();
+    error BatchUpdateLengthMismatch();

215-229: Consider abstracting the attestation type handling to reduce code duplication.

Both registerCommitment and registerDscKeyCommitment have identical if-else patterns for handling different attestation types. This pattern is repeated throughout the contract.

Consider implementing a registry pattern or factory pattern to handle different attestation types more elegantly. For example:

interface IAttestationHandler {
    function registerCommitment(bytes32 attestationId, uint256 nullifier, uint256 commitment) external;
    function registerDscKeyCommitment(uint256 leaf) external;
}

mapping(bytes32 => IAttestationHandler) attestationHandlers;

This would eliminate the repeated if-else blocks and make adding new attestation types easier.

Also applies to: 244-255


281-293: Consider the API design for unimplemented cross-chain functionality.

The verify function accepts and processes destChainId but always reverts for cross-chain requests. This could be confusing for users.

Consider either:

  1. Removing cross-chain parameters until the feature is implemented
  2. Clearly documenting that cross-chain is not yet supported in the function documentation
  3. Adding a feature flag to enable/disable cross-chain support
     /**
      * @notice Main verification function with new structured input format.
      * @dev Orchestrates the complete verification process including proof validation and result handling.
      * This function decodes the input, executes the verification flow, and handles the result based on destination chain.
+     * NOTE: Cross-chain verification is not yet supported and will revert if destChainId differs from the current chain.
      * @param baseVerificationInput The base verification input containing header and proof data.
      * @param userContextData The user context data containing config ID, destination chain ID, user identifier, and additional data.
      */

Also applies to: 564-570

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9f6207 and e7a23ee.

⛔ Files ignored due to path filters (6)
  • sdk/tests/api-server/bun.lockb is excluded by !**/bun.lockb
  • sdk/tests/web-app/src/app/favicon.ico is excluded by !**/*.ico
  • sdk/tests/web-app/src/app/fonts/GeistMonoVF.woff is excluded by !**/*.woff
  • sdk/tests/web-app/src/app/fonts/GeistVF.woff is excluded by !**/*.woff
  • sdk/tests/web-app/src/app/verified/skeleton.gif is excluded by !**/*.gif
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (107)
  • .github/actions/mobile-setup/action.yml (1 hunks)
  • .github/actions/yarn-install/action.yml (1 hunks)
  • .github/workflows/artifacts.yml (2 hunks)
  • .github/workflows/npm-publish.yml (4 hunks)
  • app/android/app/build.gradle (1 hunks)
  • app/android/react-native-passport-reader/android/build.gradle (1 hunks)
  • app/index.js (1 hunks)
  • app/ios/OpenPassport/Info.plist (1 hunks)
  • app/ios/Self.xcodeproj/project.pbxproj (4 hunks)
  • app/package.json (2 hunks)
  • app/src/layouts/SimpleScrolledTitleLayout.tsx (2 hunks)
  • app/src/screens/dev/MockDataScreen.tsx (2 hunks)
  • app/src/screens/misc/LaunchScreen.tsx (2 hunks)
  • app/src/screens/passport/NFCMethodSelectionScreen.tsx (5 hunks)
  • app/src/screens/passport/PassportNFCScanScreen.tsx (6 hunks)
  • app/src/screens/passport/PassportNFCTroubleScreen.tsx (4 hunks)
  • app/src/screens/settings/SettingsScreen.tsx (2 hunks)
  • app/src/types/react-native-passport-reader.d.ts (1 hunks)
  • app/src/utils/nfcScanner.ts (1 hunks)
  • app/src/utils/utils.ts (1 hunks)
  • circuits/circuits/utils/crypto/bigInt/bigInt.circom (5 hunks)
  • circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom (4 hunks)
  • circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom (3 hunks)
  • circuits/circuits/utils/passport/disclose/disclose_id.circom (3 hunks)
  • circuits/scripts/build/build_disclose_circuits.sh (1 hunks)
  • circuits/scripts/build/common.sh (2 hunks)
  • circuits/tests/disclose/vc_and_disclose_id.test.ts (4 hunks)
  • common/index.ts (2 hunks)
  • common/package.json (1 hunks)
  • contracts/contracts/IdentityVerificationHubImplV2.sol (10 hunks)
  • contracts/contracts/abstract/SelfVerificationRoot.sol (2 hunks)
  • contracts/contracts/constants/CircuitConstantsV2.sol (2 hunks)
  • contracts/contracts/example/Airdrop.sol (1 hunks)
  • contracts/contracts/example/HappyBirthday.sol (1 hunks)
  • contracts/contracts/example/SelfPassportERC721.sol (1 hunks)
  • contracts/contracts/interfaces/IIdentityVerificationHubV2.sol (3 hunks)
  • contracts/contracts/interfaces/ISelfVerificationRoot.sol (2 hunks)
  • contracts/contracts/libraries/CircuitAttributeHandler.sol (3 hunks)
  • contracts/contracts/libraries/CircuitAttributeHandlerV2.sol (8 hunks)
  • contracts/contracts/libraries/CustomVerifier.sol (1 hunks)
  • contracts/contracts/libraries/Formatter.sol (2 hunks)
  • contracts/contracts/libraries/GenericFormatter.sol (1 hunks)
  • contracts/contracts/libraries/IdCardAttributeHandler.sol (3 hunks)
  • contracts/contracts/libraries/SelfStructs.sol (1 hunks)
  • contracts/contracts/registry/IdentityRegistryIdCard.sol (0 hunks)
  • contracts/contracts/registry/IdentityRegistryIdCardImplV1.sol (0 hunks)
  • contracts/contracts/tests/TestCustomVerifier.sol (1 hunks)
  • contracts/contracts/tests/TestSelfVerificationRoot.sol (1 hunks)
  • contracts/contracts/tests/testGenericFormatter.sol (1 hunks)
  • contracts/contracts/verifiers/disclose/Verifier_vc_and_disclose_id.sol (1 hunks)
  • contracts/contracts/verifiers/register_id/Verifier_register_id_sha256_sha256_sha256_rsa_65537_4096.sol (4 hunks)
  • contracts/hardhat.config.ts (1 hunks)
  • contracts/ignition/modules/hub/deployHub.ts (1 hunks)
  • contracts/ignition/modules/verifiers/deployAllVerifiers.ts (3 hunks)
  • contracts/package.json (2 hunks)
  • contracts/scripts/README.md (1 hunks)
  • contracts/scripts/dev.sh (1 hunks)
  • contracts/scripts/setHubV2.ts (3 hunks)
  • contracts/scripts/setRegistry.ts (2 hunks)
  • contracts/scripts/setRegistryId.ts (3 hunks)
  • contracts/scripts/test.sh (1 hunks)
  • contracts/test/example/airdrop.test.ts (4 hunks)
  • contracts/test/integration/commitmentRegistration.test.ts (3 hunks)
  • contracts/test/integration/endToEnd.test.ts (3 hunks)
  • contracts/test/integration/vcAndDisclose.test.ts (4 hunks)
  • contracts/test/integration/verifyAll.test.ts (14 hunks)
  • contracts/test/unit/CustomVerifier.test.ts (1 hunks)
  • contracts/test/unit/GenericFormatter.test.ts (1 hunks)
  • contracts/test/unit/IdentityRegistry.test.ts (1 hunks)
  • contracts/test/unit/formatter.test.ts (1 hunks)
  • contracts/test/utils/constants.ts (1 hunks)
  • contracts/test/utils/deploymentV2.ts (1 hunks)
  • contracts/test/utils/formatter.ts (1 hunks)
  • contracts/test/utils/generateProof.ts (7 hunks)
  • contracts/test/utils/pubkeys/serialized_csca_tree.json (0 hunks)
  • contracts/test/utils/pubkeys/serialized_dsc_tree.json (0 hunks)
  • contracts/test/utils/types.ts (2 hunks)
  • contracts/test/v2/discloseId.test.ts (1 hunks)
  • contracts/test/v2/disclosePassport.test.ts (1 hunks)
  • contracts/test/v2/hubOther.test.ts (1 hunks)
  • contracts/test/v2/registerId.test.ts (1 hunks)
  • contracts/test/v2/registerPassport.test.ts (1 hunks)
  • package.json (0 hunks)
  • sdk/tests/api-server/.env.sample (0 hunks)
  • sdk/tests/api-server/.gitignore (0 hunks)
  • sdk/tests/api-server/README.md (0 hunks)
  • sdk/tests/api-server/package.json (0 hunks)
  • sdk/tests/api-server/src/app.routes.ts (0 hunks)
  • sdk/tests/api-server/src/app.ts (0 hunks)
  • sdk/tests/api-server/src/contracts/infrastructure/contracts.controller.ts (0 hunks)
  • sdk/tests/api-server/tsconfig.json (0 hunks)
  • sdk/tests/web-app/.env.sample (0 hunks)
  • sdk/tests/web-app/.eslintrc.json (0 hunks)
  • sdk/tests/web-app/.gitignore (0 hunks)
  • sdk/tests/web-app/README.md (0 hunks)
  • sdk/tests/web-app/next.config.mjs (0 hunks)
  • sdk/tests/web-app/package.json (0 hunks)
  • sdk/tests/web-app/postcss.config.mjs (0 hunks)
  • sdk/tests/web-app/src/app/api/verify/route.ts (0 hunks)
  • sdk/tests/web-app/src/app/disclose/logo.ts (0 hunks)
  • sdk/tests/web-app/src/app/disclose/page.tsx (0 hunks)
  • sdk/tests/web-app/src/app/globals.css (0 hunks)
  • sdk/tests/web-app/src/app/layout.tsx (0 hunks)
  • sdk/tests/web-app/src/app/page.tsx (0 hunks)
  • sdk/tests/web-app/src/app/verified/page.module.css (0 hunks)
  • sdk/tests/web-app/src/app/verified/page.tsx (0 hunks)
  • sdk/tests/web-app/tailwind.config.ts (0 hunks)
⛔ Files not processed due to max files limit (1)
  • sdk/tests/web-app/tsconfig.json
💤 Files with no reviewable changes (29)
  • sdk/tests/web-app/.env.sample
  • package.json
  • sdk/tests/web-app/.eslintrc.json
  • sdk/tests/web-app/next.config.mjs
  • sdk/tests/api-server/.env.sample
  • sdk/tests/api-server/tsconfig.json
  • sdk/tests/api-server/README.md
  • sdk/tests/web-app/src/app/disclose/logo.ts
  • sdk/tests/web-app/README.md
  • sdk/tests/web-app/tailwind.config.ts
  • sdk/tests/web-app/postcss.config.mjs
  • sdk/tests/web-app/src/app/globals.css
  • contracts/contracts/registry/IdentityRegistryIdCard.sol
  • sdk/tests/web-app/src/app/page.tsx
  • sdk/tests/web-app/src/app/verified/page.tsx
  • contracts/test/utils/pubkeys/serialized_csca_tree.json
  • sdk/tests/api-server/src/app.ts
  • sdk/tests/web-app/src/app/disclose/page.tsx
  • sdk/tests/api-server/.gitignore
  • sdk/tests/web-app/package.json
  • contracts/test/utils/pubkeys/serialized_dsc_tree.json
  • sdk/tests/api-server/src/app.routes.ts
  • sdk/tests/web-app/src/app/layout.tsx
  • sdk/tests/web-app/.gitignore
  • sdk/tests/web-app/src/app/verified/page.module.css
  • sdk/tests/api-server/package.json
  • contracts/contracts/registry/IdentityRegistryIdCardImplV1.sol
  • sdk/tests/api-server/src/contracts/infrastructure/contracts.controller.ts
  • sdk/tests/web-app/src/app/api/verify/route.ts
🧰 Additional context used
🪛 Biome (1.9.4)
contracts/test/unit/CustomVerifier.test.ts

[error] 4-8: Do not export from a test file.

(lint/suspicious/noExportsInTest)

🔇 Additional comments (150)
contracts/contracts/example/Airdrop.sol (1)

1-330: Clarify the inconsistency between PR title and changes, and consider alternative approaches to deactivating this contract.

The PR title suggests this is related to "Android build 72 upgrade gesture package," but the actual change is commenting out an entire Solidity smart contract. This creates confusion about the PR's intent.

Additionally, commenting out an entire contract file is unusual. Consider these alternatives:

  • Delete the file entirely if it's no longer needed
  • Move to an archived directory if you want to preserve it for reference
  • Add a README explaining why example contracts were deactivated

The current approach leaves dead code in the repository, which could confuse future developers.

Could you clarify:

  1. Is this PR title correct, or should it reflect the contract deactivation changes?
  2. Is commenting out the preferred approach over deletion for these example contracts?

Likely an incorrect or invalid review comment.

contracts/contracts/example/HappyBirthday.sol (1)

1-202: Verify no residual references

Commenting out the contract may lead to broken imports or references elsewhere. Please ensure no other contracts, tests, or scripts import or reference SelfHappyBirthday.

#!/bin/bash
# Search for any references to SelfHappyBirthday in the repository
rg "SelfHappyBirthday" -n
.github/workflows/npm-publish.yml (3)

6-6: Branch change from main to dev looks correct.

The change to trigger publishing on dev branch pushes aligns with the PR objectives and is properly implemented.


66-66: Command change from yarn to npm is consistent.

The switch from yarn npm publish to npm publish is applied consistently across all three publish jobs and should work correctly with the Node.js setup.

Also applies to: 94-94, 121-121


68-69: Let’s explicitly search your workflows directory (which is hidden by default in ripgrep) to catch both tokens:

#!/bin/bash
# Include hidden .github folder in the search
rg -n "NPM_AUTH_TOKEN" .github/workflows
rg -n "NODE_AUTH_TOKEN" .github/workflows
contracts/scripts/setRegistry.ts (2)

19-21: Good stylistic improvement.

Removing unnecessary quotes from object keys when they're valid identifiers improves code readability and follows JavaScript/TypeScript best practices.


33-36: Improved readability with multi-line path construction.

The reformatted path.join call with trailing commas enhances readability and makes it easier to add or modify path segments in the future.

contracts/test/example/airdrop.test.ts (2)

35-35: Consistent arrow function parameter formatting.

Adding parentheses around arrow function parameters in dynamic imports improves consistency with TypeScript style guidelines.

Also applies to: 290-290


77-83: Better formatting for contract deployment.

The reformatted contract deployment calls improve readability while maintaining the same functionality.

Also applies to: 352-352

contracts/contracts/libraries/SelfStructs.sol (1)

1-124: Well-structured library with comprehensive documentation.

The library provides a solid foundation for the identity verification system with clear, well-documented data structures. The NatSpec documentation is thorough and follows Solidity best practices.

app/ios/OpenPassport/Info.plist (1)

24-24: Version bump looks correct and coordinated.

The version increment from 2.5.3 to 2.5.4 aligns with the coordinated version updates across iOS, Android, and package.json mentioned in the AI summary.

common/package.json (1)

3-3: Bump package version
Version updated from 0.0.2 to 0.0.3 to align with downstream dependencies.

app/package.json (2)

3-3: Sync mobile app version
Version bumped to 2.5.4 to match Android and iOS builds.


96-96: Upgrade gesture handler dependency
Updated react-native-gesture-handler to ^2.25.0; ensure compatibility and test gesture interactions on both platforms.

app/android/app/build.gradle (1)

89-90: Update Android version code and name
VersionCode set to 72 and versionName to "2.5.4" to match mobile app release.

.github/actions/yarn-install/action.yml (1)

18-19: Pin Yarn to v4.6.0
Explicitly activating Yarn 4.6.0 for consistent CI installs.

contracts/test/utils/constants.ts (1)

4-4: Add EU_ID_CARD attestation identifier
Introduced EU_ID_CARD constant; verify it’s referenced in verification logic and tests.

Run this script to confirm usage:

#!/bin/bash
rg 'EU_ID_CARD' -n .
app/android/react-native-passport-reader/android/build.gradle (1)

37-38: Verify compatibility with jmrtd library version 0.8.1.

The version update from 0.7.42 to 0.8.1 represents a minor version bump that could potentially introduce breaking changes. Given the comment about "getting different errors" with various versions, please ensure thorough testing of passport reading functionality after this upgrade.

#!/bin/bash
# Description: Check for any breaking changes or security advisories for jmrtd library versions

# Check Maven Central for jmrtd 0.8.1 availability and changelog
curl -s "https://search.maven.org/solrsearch/select?q=g:org.jmrtd+AND+a:jmrtd+AND+v:0.8.1&rows=1&wt=json" | jq -r '.response.docs[0] // "Version not found"'

# Check for security advisories
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: MAVEN, package: "org.jmrtd:jmrtd") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'
common/index.ts (1)

25-25: LGTM! Clean addition to public API.

The buildSMT function import and export follow the established pattern in this file and will make this SMT utility accessible to external consumers as intended.

Also applies to: 65-65

circuits/circuits/utils/crypto/hasher/shaBytes/dynamic/sha1Bytes.circom (1)

31-31: LGTM! Good code hygiene with whitespace cleanup.

The whitespace cleanup improves code consistency without affecting circuit logic or functionality.

Also applies to: 69-69, 71-71, 89-89, 95-95, 118-118

app/index.js (1)

24-24: We need to broaden the search to all JS/TS files without relying on built-in type definitions. Let’s rerun ripgrep with glob patterns:

#!/bin/bash
echo "🔍 Searching for ToastProvider usage..."
rg -i "ToastProvider" -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' -A2 -B2 || echo "✔ No ToastProvider references found"

echo "🔍 Searching for useToast hook usage..."
rg -i "useToast" -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' -A2 -B2 || echo "✔ No useToast references found"

echo "🔍 Searching for toast( function calls..."
rg -i "toast\(" -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' -A2 -B2 || echo "✔ No toast() calls found"

echo "🔍 Searching for <Toast components..."
rg -i "<Toast" -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' -A2 -B2 || echo "✔ No <Toast components found"
contracts/ignition/modules/verifiers/deployAllVerifiers.ts (1)

10-10: LGTM! Good code style improvements.

The consistent use of parentheses in arrow function parameters and reformatted console.log statements enhance code readability and maintainability without affecting functionality.

Also applies to: 25-25, 67-72

contracts/ignition/modules/hub/deployHub.ts (1)

21-21: LGTM: Clean formatting improvement.

The consolidation of the initialize function arguments into a single line improves readability while maintaining identical functionality.

circuits/scripts/build/build_disclose_circuits.sh (1)

19-19: Verify the corresponding circuit implementation exists.

The addition of the ID card circuit configuration looks correct and consistent with the existing pattern. Ensure that the corresponding circuit files and verifier contracts are properly implemented.

#!/bin/bash
# Verify that the ID card circuit and related files exist
fd -t f "vc_and_disclose_id" --exec echo "Found: {}"
.github/actions/mobile-setup/action.yml (1)

55-55: LGTM: Good practice for build consistency.

Explicitly setting the Yarn version to 4.6.0 ensures consistent dependency management across CI environments and aligns with similar changes in other workflow files.

contracts/hardhat.config.ts (1)

4-4: LGTM: Minor formatting improvement.

Adding the trailing comma improves code consistency and makes future modifications easier.

app/src/screens/misc/LaunchScreen.tsx (2)

29-33: LGTM: Standardized developer mode gesture.

The change from a two-finger tap to a five-tap gesture standardizes the developer mode activation pattern across the app. The five-tap gesture may be more accessible for users who have difficulty with multi-finger gestures.


40-40: Gesture detector updated correctly.

The gesture detector properly references the renamed devModeTap gesture, maintaining the intended functionality.

app/src/screens/settings/SettingsScreen.tsx (2)

139-143: LGTM! Improved gesture accessibility and consistency.

The change from a two-finger tap to a five-tap gesture makes developer mode activation more accessible while maintaining security through repetitive action. This aligns well with the standardization effort across multiple screens mentioned in the summary.


200-200: LGTM! Gesture detector properly updated.

The GestureDetector correctly references the renamed gesture variable.

contracts/test/unit/IdentityRegistry.test.ts (1)

195-195: LGTM! Improved code style consistency.

Adding parentheses around the arrow function parameter aligns with common linting rules and improves code consistency.

circuits/circuits/utils/crypto/bigInt/bigInt.circom (1)

11-168: LGTM! Code formatting improvements.

The whitespace and formatting changes improve code readability and consistency without affecting the circuit logic or functionality. These align well with the broader code cleanup effort mentioned in the summary.

circuits/scripts/build/common.sh (2)

75-77: Verify the updated include paths work with current project structure.

The change from ./node_modules to ../node_modules suggests the build context has changed. Please ensure these paths are correct for the current directory structure and that all necessary libraries are found during compilation.


88-91: Let’s inspect the surrounding logic to confirm how and where ${CIRCUIT_NAME}_final.zkey is produced and used:

#!/bin/bash
echo "=== lines 80-130 ==="
sed -n '80,130p' circuits/scripts/build/common.sh
echo
echo "=== lines 140-180 ==="
sed -n '140,180p' circuits/scripts/build/common.sh
contracts/scripts/setHubV2.ts (3)

16-18: LGTM! Improved object key styling.

Removing quotes from object keys that are valid identifiers follows modern JavaScript/TypeScript best practices and improves code readability.


37-40: LGTM! Enhanced path construction readability.

The multi-line path.join() with trailing commas improves readability and makes future modifications easier to track in version control.


228-228: LGTM! Improved code formatting.

Proper indentation enhances code consistency and readability.

contracts/contracts/libraries/CircuitAttributeHandler.sol (1)

15-15: LGTM: Error naming standardization

The renaming from INSUFFICIENT_CHARCODE_LEN to InsufficientCharcodeLen follows Solidity naming conventions by using PascalCase for custom errors. This change is consistent across the error declaration, NatSpec documentation, and revert statement.

Also applies to: 182-182, 194-194

app/src/screens/dev/MockDataScreen.tsx (1)

263-264: LGTM: Simplified gesture for better UX

The change from a 2-finger triple tap to a single-finger 5-tap gesture makes the advanced mode activation more accessible and easier to execute. This aligns with the standardization effort mentioned across other screens in the app.

contracts/scripts/setRegistryId.ts (1)

19-21: LGTM: Code formatting improvements

The formatting changes improve code readability:

  • Removing quotes from object keys follows modern JavaScript/TypeScript conventions
  • Multi-line formatting for long expressions enhances readability
  • No functional changes introduced

Also applies to: 33-36, 89-93

.github/workflows/artifacts.yml (2)

43-45: LGTM: Modern Yarn setup with corepack

Using corepack enable and setting a specific Yarn version (4.6.0) is the modern approach for managing package managers in Node.js environments. This ensures consistent dependency management across CI workflows.


63-64: LGTM: Formatting cleanup

Removing trailing spaces after && operators improves command syntax consistency.

contracts/contracts/libraries/IdCardAttributeHandler.sol (1)

16-16: LGTM: Consistent error naming standardization

The renaming from INSUFFICIENT_CHARCODE_LEN to InsufficientCharcodeLen matches the identical change in CircuitAttributeHandler.sol, ensuring consistency across the attribute handler libraries. This follows Solidity naming conventions for custom errors.

Also applies to: 180-180, 192-192

app/ios/Self.xcodeproj/project.pbxproj (1)

426-426: Version updates look correct, but verify the scope of changes.

The iOS version bumps are consistent (CURRENT_PROJECT_VERSION: 129→132, MARKETING_VERSION: 2.5.3→2.5.4), but the PR title mentions "bump android build 72". Please confirm whether this PR includes coordinated Android and iOS version updates.

Also applies to: 541-541, 564-564, 678-678

app/src/types/react-native-passport-reader.d.ts (2)

6-7: Verify native module implementations for new properties.

The new canNumber and useCan properties suggest CAN (Card Access Number) support, which aligns with enhanced passport scanning capabilities. Ensure these properties are properly implemented in the native iOS/Android modules.


13-13: Verify native module implementation for reset method.

The new reset() method suggests scanner state management functionality. Ensure this method is properly implemented in the native iOS/Android modules.

circuits/circuits/utils/passport/disclose/disclose_id.circom (2)

67-67: Good documentation update to reflect actual data layout.

The comment correction accurately describes the revealedData array structure: 90 bytes for MRZ data, 2 bytes for age verification, and 2 bytes for OFAC checks, totaling 94 bytes as declared.


45-47: Clean whitespace formatting improvements.

The whitespace adjustments improve code readability and consistency.

Also applies to: 71-71, 94-94

app/src/utils/utils.ts (1)

6-11: Excellent improvement to MRZ format detection.

The regex-based validation is much more robust than the previous simple length checks. The TD1 regex properly validates the complete 60-character ID card structure, and the TD3 regex validates passport format structure.

contracts/test/integration/commitmentRegistration.test.ts (3)

8-8: Good cleanup of import statement.

Removing the .js extension aligns with TypeScript best practices when proper module resolution is configured.


62-62: Consistent dynamic import syntax improvement.

The arrow function syntax with parentheses around the parameter improves consistency in the dynamic import statements.

Also applies to: 246-246


9-9: Verify the new file path exists.

The path change from a test-specific location to a common directory suggests repository restructuring. Ensure the file exists at ../../../common/pubkeys/serialized_dsc_tree.json.

#!/bin/bash
# Description: Verify the serialized_dsc_tree.json file exists at the new path
# Expected: File should exist and be accessible

find . -name "serialized_dsc_tree.json" -type f
contracts/contracts/constants/CircuitConstantsV2.sol (2)

64-64: LGTM! Comment accurately reflects the updated constant value.

The comment update aligns with the code change below, improving documentation clarity.


101-101: Verify that dependent code handles the sentinel value correctly.

The change from 0 to 99 for passportNoSmtRootIndex in EU ID cards makes logical sense since ID cards don't have passport numbers. Using 99 as a sentinel value is clearer than 0 which could be mistaken for a valid index.

However, ensure that all code consuming this constant properly handles the sentinel value 99 to avoid index out-of-bounds errors or incorrect processing.

#!/bin/bash
# Description: Search for usage of passportNoSmtRootIndex to verify proper handling of sentinel value 99

# Search for direct usage of the constant
rg -A 3 -B 3 "passportNoSmtRootIndex"

# Search for usage of the specific value 99 in circuit-related files
rg -A 3 -B 3 "\b99\b" --type=sol --type=ts
contracts/test/integration/verifyAll.test.ts (2)

44-44: LGTM! Consistent arrow function parameter formatting.

The parentheses around the arrow function parameter improve consistency with similar dynamic imports throughout the codebase.


181-181: LGTM! Improved type annotation formatting.

The consistent formatting of VcAndDiscloseHubProof type annotations enhances code readability without affecting functionality.

Also applies to: 202-202, 225-225, 248-248, 269-269, 307-307, 332-332, 353-353, 381-381, 405-405, 429-429, 482-482, 505-505

circuits/tests/disclose/vc_and_disclose_id.test.ts (4)

84-84: LGTM! Correctly removes passport number SMT for ID card circuits.

Using null for passportNo_smt is appropriate since ID cards don't have passport numbers, aligning with the circuit logic changes.


186-187: LGTM! Test assertions updated to match new data layout.

The assertion indices correctly shifted from 88-89 to 90-91, consistent with the MRZ data length increase from 88 to 90 bytes.


268-268: LGTM! Consistent removal of passport number SMT.

This change maintains consistency with the earlier modification, correctly using null for passport number SMT in ID card scenarios.


140-140: Verify the MRZ data length increase from 88 to 90 bytes.

The loop boundary change from 88 to 90 suggests the MRZ data structure for ID cards is 2 bytes longer than passports. This aligns with the AI summary mentioning updated circuit comments indicating 90 bytes for MRZ and 2 bytes for OFAC data.

Please confirm this change is intentional and matches the actual circuit specification.

#!/bin/bash
# Description: Verify the MRZ data length change in circuit files and related constants

# Search for MRZ length constants or references to 88/90 bytes
rg -A 3 -B 3 "\b(88|90)\b.*MRZ" 

# Check circuit files for MRZ data structure definitions
fd -e circom | xargs rg -A 5 -B 5 "MRZ.*90|90.*MRZ"

# Look for selector_dg1 array length definitions
rg -A 3 -B 3 "selector_dg1.*90|Array\(90\)"
contracts/test/integration/endToEnd.test.ts (3)

12-14: LGTM! Import path cleanup improves module resolution.

The removal of .js extensions and path adjustments align with TypeScript best practices and improve module resolution consistency across the test suite.


89-89: LGTM! Consistent dynamic import formatting.

The parentheses around the arrow function parameter maintain consistency with similar changes in other test files.


186-197: LGTM! Improved code formatting for deployment.

The single-line deployment call with direct arguments improves readability and maintains consistency with similar patterns in other test files.

app/src/utils/nfcScanner.ts (2)

37-37: LGTM! Reset call ensures clean scanning state.

Adding PassportReader.reset() at the beginning of the Android scan function helps ensure a clean state before scanning, which can improve reliability and consistency.


42-43: LGTM! CAN authentication support added for Android.

The addition of canNumber and useCan parameters brings Android scanning functionality to parity with iOS, enabling CAN (Card Access Number) authentication for enhanced NFC reading capabilities.

The fallback values ('' for canNumber and false for useCan) ensure backward compatibility when these parameters are not provided.

circuits/circuits/utils/crypto/hasher/shaBytes/shaBytesDynamic.circom (3)

6-7: LGTM - Imports added for new functionality.

The new imports are correctly added to support the range check functionality being introduced.


24-26: Excellent security improvement with range checking.

Adding explicit range validation for in_len_padded_bytes is a valuable security enhancement. The constraint ensures the input length fits within the expected bit-width derived from max_num_bytes * 8, preventing potential overflow or out-of-bounds issues in the hashing circuits.

The use of log2Ceil(max_num_bytes * 8) correctly converts the maximum byte count to the corresponding bit-width needed for the range check.


37-37: LGTM - Minor formatting improvement.

The whitespace formatting fix improves code consistency.

contracts/contracts/tests/TestCustomVerifier.sol (1)

1-16: LGTM - Well-structured test contract.

This test contract follows good practices:

  1. Clean wrapper pattern - Exposes the library function for isolated testing
  2. Correct imports - Imports both CustomVerifier and SelfStructs libraries
  3. Appropriate visibility - Uses external pure which is correct for a stateless wrapper
  4. Clear naming - Function name clearly indicates its testing purpose

The contract enables comprehensive unit testing of the CustomVerifier library without requiring the full verification hub infrastructure.

contracts/contracts/verifiers/register_id/Verifier_register_id_sha256_sha256_sha256_rsa_65537_4096.sol (3)

25-56: LGTM - Improved constant declaration formatting.

The alignment of assignment operators in constant declarations improves readability and maintains consistency throughout the file.


63-68: LGTM - Better function signature formatting.

The multi-line formatting of the verifyProof function signature improves readability, especially given the multiple complex parameter types.


76-76: LGTM - Assembly code cleanup.

The whitespace cleanup in the assembly block improves code organization without affecting the verification logic. All critical operations like field checks, pairing computations, and return values remain unchanged.

Also applies to: 111-111, 113-113, 115-115, 167-167, 169-169, 171-171, 178-181

contracts/test/integration/vcAndDisclose.test.ts (4)

13-13: LGTM: Import addition aligns with formatter updates.

The import of formatCountriesList, reverseBytes, reverseCountryBytes is consistent with the broader changes to the verification system and formatter utilities.


46-46: LGTM: Dynamic import syntax modernization.

The arrow function syntax for the dynamic import is cleaner and more consistent with modern JavaScript practices.


92-92: LGTM: Consistent with updated forbidden countries handling.

The use of getPackedForbiddenCountries function maintains consistency with the updated data handling patterns.


136-141: ```shell
#!/bin/bash

Search for all TS definitions and occurrences of forbiddenCountriesListPacked

rg -n "forbiddenCountriesListPacked" -g '*.ts' -C 5

Search for any Solidity declarations or usages of forbiddenCountriesListPacked in contracts

rg -n "forbiddenCountriesListPacked" -g 'contracts/**/*.sol' -C 5


</details>
<details>
<summary>app/src/screens/passport/PassportNFCTroubleScreen.tsx (5)</summary>

`3-3`: **LGTM: YStack import supports layout restructuring.**

The addition of YStack import is necessary for the new layout structure introduced later in the component.

---

`17-17`: **LGTM: Improved string consistency.**

Standardizing apostrophes to straight quotes improves text consistency across the application.



Also applies to: 25-25, 33-33, 37-37

---

`52-57`: **Excellent UX improvement: Simplified gesture for better accessibility.**

The change from a two-finger five-tap to a single-finger five-tap gesture significantly improves accessibility and reduces the complexity of triggering developer mode. This is a thoughtful enhancement that makes the feature more discoverable.

---

`63-65`: **Great addition: Secondary button provides user-friendly alternative.**

Adding the "Open NFC Options" secondary button gives users a clear, discoverable path to access NFC method selection without needing to know about the hidden gesture. This improves the overall user experience.

---

`66-79`: **Well-structured layout with focused gesture scope.**

The new YStack layout properly separates concerns by wrapping only the first caption with the gesture detector, while keeping the tips and concluding caption outside. This ensures the gesture is discoverable but doesn't interfere with normal scrolling behavior.

</details>
<details>
<summary>contracts/scripts/README.md (1)</summary>

`1-154`: **Excellent documentation: Comprehensive and well-structured developer guide.**

This README provides thorough documentation for the utility scripts with:

- Clear categorization of test and development commands
- Practical usage examples and workflows  
- Helpful troubleshooting section
- Good integration notes with package.json scripts

The documentation will significantly improve developer experience by making the scripts more discoverable and easier to use correctly.

</details>
<details>
<summary>contracts/test/utils/formatter.ts (1)</summary>

`91-110`: ```shell
#!/bin/bash
# Display the code around extractForbiddenCountriesFromPacked in the Solidity library
rg -n "function extractForbiddenCountriesFromPacked" -A 30 -B 5 contracts/contracts/libraries/Formatter.sol
app/src/screens/passport/NFCMethodSelectionScreen.tsx (5)

9-9: LGTM: Appropriate imports for new functionality.

The addition of BodyText and useUserStore imports supports the new MRZ editing functionality and state management requirements.

Also applies to: 13-13


47-47: Good platform expansion: CAN authentication now available on Android.

Extending CAN authentication support to Android improves the accessibility of this authentication method across platforms.


58-66: Valuable addition: Manual MRZ editing capability.

The new MRZ correction option provides a crucial fallback for users experiencing automatic scanning issues. Making it available on both platforms ensures consistent functionality.


84-87: LGTM: Proper state management integration.

The integration with the user store for passport data fields follows good React patterns and centralizes state management appropriately.


94-104: LGTM: Clean input handlers.

The input change handlers are straightforward and properly update the centralized state.

app/src/layouts/SimpleScrolledTitleLayout.tsx (3)

5-5: Good addition of SecondaryButton import.

The import is correctly added and will be used in the conditional rendering below.


14-16: Well-designed optional props interface.

The interface extension with optional secondaryButtonText and onSecondaryButtonPress props maintains backward compatibility while enabling new functionality.


37-41: Proper conditional rendering implementation.

The conditional rendering correctly checks for both props before rendering the SecondaryButton, and the positioning with mb="$2" provides appropriate spacing above the dismiss button.

contracts/contracts/tests/testGenericFormatter.sol (2)

1-3: Correct import statements.

The imports for GenericFormatter and SelfStructs are properly structured and necessary for the test functions.


4-34: Well-structured test wrapper functions.

Each test function properly wraps the corresponding GenericFormatter library function with:

  • Consistent naming convention using "test" prefix
  • Appropriate public pure visibility for testing
  • Correct parameter types and return values
  • Simple pass-through implementation

This follows good practices for exposing library functions for testing.

contracts/scripts/dev.sh (3)

1-6: Good bash script setup.

The shebang, error handling with set -e, and clear comments establish good practices for the development script.


8-30: Excellent color-coded output functions.

The color constants and print functions provide clear, user-friendly feedback with appropriate color coding for different message types.


119-127: Robust directory navigation logic.

The script correctly handles execution from both the contracts directory and contracts/scripts directory, with appropriate error handling when hardhat.config.ts is not found.

app/src/screens/passport/PassportNFCScanScreen.tsx (5)

6-11: Good import consolidation and additions.

The import statements are well-organized, and the addition of CircleHelp icon and UI components (Button, XStack) supports the new help functionality.

Also applies to: 23-23


80-93: Excellent consolidated error handling approach.

The openErrorModal callback provides a consistent user experience by showing an error modal with both dismiss and help options, improving user assistance.


310-324: Great UI improvement with help button integration.

The XStack layout with the help button provides easy access to troubleshooting while maintaining good visual balance. The CircleHelp icon is appropriately styled and accessible.


221-221: ```shell
#!/usr/bin/env bash

Locate and inspect PassportNFCScanScreen.tsx for detailed error-handling logic

file=$(fd PassportNFCScanScreen.tsx)
echo "Inspecting file: $file"

Show context around openErrorModal calls

rg -n "openErrorModal" "$file" -C 5

Show all catch blocks to see how errors are handled

rg -n "catch" "$file" -C 5

Look for any type checks or property checks on the error object

rg -n "instanceof" "$file" -C 5
rg -n "error.code" "$file" -C 5


---

`73-78`: ```shell
#!/bin/bash
# Search for all Gesture.Tap() usages across TS/TSX files
rg "Gesture\.Tap" -g '*.ts' -g '*.tsx' -A5 -B5

# Find any .numberOfTaps(5) occurrences
rg "numberOfTaps\(5\)" -g '*.ts' -g '*.tsx' -A5 -B5

# Look for any .numberOfTouches(2) in case some screens still use the old two-finger 5-tap
rg "numberOfTouches\(2\)" -g '*.ts' -g '*.tsx' -A5 -B5
contracts/contracts/libraries/GenericFormatter.sol (6)

1-4: Proper license and imports.

The SPDX license identifier, pragma version, and SelfStructs import are correctly specified.


6-9: Well-defined struct for generic verification.

The GenericVerificationStruct appropriately combines an attestation ID with verification configuration bytes, providing a clean interface for the library functions.


17-27: Correct V1 to V2 config conversion.

The fromV1Config function properly maps all fields from V1 to V2 configuration struct, maintaining data integrity during the conversion.


34-38: Safe bytes to struct decoding.

The verificationConfigFromBytes function uses abi.decode appropriately to convert bytes to V2 configuration struct.


45-50: Consistent formatting functions.

Both formatV1Config and formatV2Config functions follow a consistent pattern:

  • V1 version converts to V2 then encodes
  • V2 version directly encodes
  • Both return properly encoded bytes

This ensures all configurations are stored in the latest format.

Also applies to: 57-61


68-72: Proper generic output formatting.

The toV2Struct function correctly encodes the GenericDiscloseOutputV2 struct to bytes using abi.encode.

contracts/scripts/test.sh (1)

1-186: Excellent bash script structure with comprehensive test coverage.

The script is well-implemented with proper error handling, colored output, comprehensive help documentation, and robust directory navigation. The categorization of tests (V2 individual/groups, legacy, utilities) provides clear organization for different testing scenarios.

Minor suggestions for enhanced robustness:

+# Validate required tools exist
+command -v npx >/dev/null 2>&1 || { print_error "npx is required but not installed. Aborting."; exit 1; }
+command -v hardhat >/dev/null 2>&1 || command -v npx hardhat >/dev/null 2>&1 || { print_error "Hardhat is required but not installed. Aborting."; exit 1; }

Consider adding validation for required dependencies before test execution.

contracts/test/utils/types.ts (4)

9-31: Well-structured type imports for V2 system.

The addition of V2 contract imports and ID card-specific verifiers properly extends the type system to support the new verification architecture.


43-51: Consistent environment-based type selection.

The conditional type aliases for ID card verifiers follow the same pattern as existing verifiers, maintaining consistency across the type system.


68-87: Comprehensive V2 deployment interface.

The DeployedActorsV2 interface thoroughly represents all components of the V2 system including hub implementations, registries, verifiers, and test contracts.


93-97: Proper type exports for new contracts.

The export of new contract types maintains consistency with the existing pattern and supports proper type checking throughout the codebase.

contracts/test/v2/hubOther.test.ts (5)

1-34: Excellent test suite setup with proper isolation.

The test setup uses deployment fixtures, snapshot isolation, and proper before/after hooks to ensure clean test execution.


35-73: Comprehensive batch update function testing.

The tests properly validate both error conditions (length mismatch) and success cases for batch update functions, ensuring the hub correctly handles array parameter validation.


75-88: Proper access control validation.

The access control tests verify that only owners can call restricted functions, which is critical for security.


90-138: Thorough view function testing with error cases.

The view function tests cover both success scenarios and proper error handling for invalid attestation IDs, ensuring robust error reporting.


140-185: Comprehensive Verification Config V2 testing.

The verification config tests validate setting, retrieval, existence checks, and event emissions, ensuring the new config management functionality works correctly.

contracts/test/unit/GenericFormatter.test.ts (4)

1-35: Thorough V1 to V2 config conversion testing.

The test properly validates that all fields are correctly converted from V1 to V2 configuration format, ensuring backward compatibility.


37-74: Comprehensive byte encoding/decoding validation.

The test verifies that config structures can be properly encoded to bytes and decoded back with all field values preserved.


76-99: Proper V1 config byte formatting test.

The test ensures V1 configs are correctly formatted to the latest byte representation, maintaining compatibility across versions.


101-124: Correct V2 config byte formatting validation.

The test confirms V2 configs are properly serialized to bytes with all field values preserved.

contracts/test/unit/CustomVerifier.test.ts (6)

10-26: Proper test contract deployment with library linking.

The deployment correctly links the CustomVerifier library to the test contract, enabling proper testing of the library functionality.


28-61: Comprehensive passport verification with all checks disabled.

The test properly validates the basic verification flow when all security checks are disabled, establishing a baseline for functionality.


62-106: Thorough OFAC validation testing.

The tests properly validate both OFAC check failures and successful OFAC result returns, ensuring the security mechanism works correctly.


108-193: Comprehensive age and country validation testing.

The tests cover forbidden countries checks and age validation scenarios, including both enabled/disabled states and valid/invalid conditions.


195-380: Thorough ID card verification testing.

The ID card verification tests mirror the passport tests with appropriate test data, ensuring both document types are properly validated.


381-411: Proper invalid attestation ID error handling.

The test correctly validates that invalid attestation IDs trigger the expected custom error, ensuring robust error handling.

contracts/test/v2/registerId.test.ts (1)

1-267: Excellent test coverage for ID registration flows!

The test suite provides comprehensive coverage for both DSC key commitment and identity commitment registration, including all relevant error scenarios. The use of snapshots for test isolation and the clear organization with describe blocks demonstrates good testing practices.

contracts/test/v2/registerPassport.test.ts (1)

1-269: Well-structured passport registration tests!

The test suite properly adapts the ID card registration tests for passport attestations, maintaining the same high standards of test coverage and organization.

contracts/contracts/verifiers/disclose/Verifier_vc_and_disclose_id.sol (1)

1-308: Standard auto-generated zk-SNARK verifier.

This snarkJS-generated verifier contract follows the expected pattern for Groth16 proof verification with appropriate gas optimizations.

contracts/contracts/interfaces/ISelfVerificationRoot.sol (1)

4-73: Well-structured interface with comprehensive documentation

The interface is properly designed with clear data structures and well-documented functions. The GenericDiscloseOutputV2 struct provides a comprehensive representation of verified identity data.

contracts/package.json (2)

18-53: Consistent migration to yarn commands

All scripts have been properly updated to use yarn hardhat instead of npx hardhat, ensuring consistency across the build system.


113-113: Package manager specification added

Good practice to explicitly specify the yarn version for consistent dependency management across environments.

contracts/contracts/tests/TestSelfVerificationRoot.sol (1)

8-89: Well-designed test contract implementation

The test contract provides excellent coverage for testing the verification lifecycle:

  • Proper state tracking with verificationSuccessful, lastOutput, and lastUserData
  • Event emission for verification completion
  • Helper functions for state reset and scope modification
  • Access control testing capability

This implementation will effectively support the comprehensive V2 verification flow tests.

contracts/test/utils/generateProof.ts (3)

90-139: LGTM! Well-structured ID card registration proof generation.

The function properly handles circuit selection based on the passport data type and follows the same pattern as the existing generateRegisterProof function.


303-408: LGTM! Comprehensive ID card disclosure proof generation.

The function correctly handles ID card-specific requirements including the 90-element selector and proper document type configuration.


420-428: Good enhancement for Solidity compatibility.

The conversion of hex strings to decimal strings ensures proper format when passing public signals to Solidity contracts.

contracts/contracts/libraries/CircuitAttributeHandlerV2.sol (3)

243-268: Excellent refactoring of compareOfac logic.

The use of boolean variables with descriptive names and clear default values improves code readability and maintainability.


323-325: Good backward compatibility handling.

The legacy function properly converts the boolean result to uint256, ensuring existing code continues to work.


199-232: ```shell
#!/bin/bash

Display the full GenericDiscloseOutputV2 struct to verify the ofac field type

sed -n '70,140p' contracts/contracts/libraries/SelfStructs.sol


</details>
<details>
<summary>contracts/contracts/libraries/CustomVerifier.sol (1)</summary>

`43-132`: **Well-implemented passport verification logic.**

The function properly validates all verification criteria and constructs a comprehensive output structure with proper error handling.

</details>
<details>
<summary>contracts/contracts/abstract/SelfVerificationRoot.sol (3)</summary>

`138-151`: **Proper security implementation for the callback function.**

The `onVerificationSuccess` function correctly validates that only the authorized hub contract can invoke it, preventing unauthorized callbacks.

---

`86-128`: **Well-structured proof verification with clear data format handling.**

The function properly validates input lengths and constructs the verification input according to the documented format. The use of assembly for attestationId extraction is efficient.

---

`153-166`: **Excellent extensibility pattern with the virtual hook.**

The `customVerificationHook` provides a clean extension point for derived contracts while maintaining separation of concerns.

</details>
<details>
<summary>contracts/contracts/interfaces/IIdentityVerificationHubV2.sol (1)</summary>

`115-181`: **Well-designed interface with comprehensive state query capabilities.**

The new view functions provide excellent visibility into the contract state with clear naming and proper documentation.

</details>
<details>
<summary>contracts/contracts/IdentityVerificationHubImplV2.sol (5)</summary>

`180-195`: **LGTM! Clean initialization implementation.**

The initialization function properly sets up the V2 hub with circuit version 2 and emits the appropriate event.

---

`747-749`: **Consider timezone implications in date validation.**

The `_getStartOfDayTimestamp` function assumes UTC timezone. Ensure this aligns with how dates are encoded in the proofs.

The current date validation allows a 2-day window (previous day to next day). Verify that this tolerance is intentional and documented, as it could allow proofs generated with future dates.


Also applies to: 810-814

---

`503-641`: **Well-structured modular design with good separation of concerns.**

The internal functions demonstrate excellent modularity with clear responsibilities:
- Proper use of `memory` and `calldata` for gas optimization  
- Clear separation between validation logic and output formatting
- Good error handling and input validation

The helper functions for decoding inputs and formatting outputs maintain consistency across different attestation types.



Also applies to: 837-1008

---

`36-37`: **Verify the ERC-7201 storage location constants are correctly calculated.**

The storage location constants should follow the ERC-7201 pattern exactly. Please verify these hardcoded values match the expected calculation.

```shell
#!/bin/bash
# Description: Verify ERC-7201 storage location constants are correctly calculated

# Create a Python script to verify the storage location calculations
cat << 'EOF' > verify_storage_locations.py
from web3 import Web3

def calculate_storage_location(namespace):
    # Calculate keccak256(namespace)
    namespace_hash = Web3.keccak(text=namespace)
    
    # Convert to int and subtract 1
    namespace_int = int.from_bytes(namespace_hash, 'big') - 1
    
    # Encode as bytes32
    encoded = Web3.keccak(namespace_int.to_bytes(32, 'big'))
    
    # Apply mask ~uint256(0xff) = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
    mask = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
    result = int.from_bytes(encoded, 'big') & mask
    
    return f"0x{result:064x}"

# Verify the first storage location
namespace1 = "self.storage.IdentityVerificationHub"
expected1 = "0x2ade7eace21710c689ddef374add52ace9783e33bac626e58e73a9d190173d00"
calculated1 = calculate_storage_location(namespace1)

print(f"Namespace: {namespace1}")
print(f"Expected:   {expected1}")
print(f"Calculated: {calculated1}")
print(f"Match: {expected1.lower() == calculated1.lower()}\n")

# Verify the second storage location
namespace2 = "self.storage.IdentityVerificationHubV2"
expected2 = "0xf9b5980dcec1a8b0609576a1f453bb2cad4732a0ea02bb89154d44b14a306c00"
calculated2 = calculate_storage_location(namespace2)

print(f"Namespace: {namespace2}")
print(f"Expected:   {expected2}")
print(f"Calculated: {calculated2}")
print(f"Match: {expected2.lower() == calculated2.lower()}")
EOF

# Install web3 if needed and run the verification
pip install web3 > /dev/null 2>&1
python verify_storage_locations.py

Also applies to: 40-41


1028-1030: ```shell
#!/bin/bash

Check for RIPEMD160 references in passport custom hashers

echo "=== Ripemd references in customHashers.circom ==="
rg -n "ripemd" -g "circuits/circuits/utils/passport/customHashers.circom"

echo -e "\n=== customHashers.circom (first 200 lines) ==="
sed -n '1,200p' circuits/circuits/utils/passport/customHashers.circom


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines 153 to 172
const input1 = "0x414754414154414149414f4741444e414d5341415a44424c41414c41474641";
const input2 = "0x4542524c42425242444742524842534842455a415355415742414d52414752";
const input3 = "0x4e41434d484b5650434e52424c4f424e5442554d424e45425a4c42554d424c";
const input4 = "0x4853454d4559424d5a45575a5455564b4e445453454e4843564943";
const contractResult = await testFormatter.testExtractForbiddenCountriesFromPacked([
input1,
input2,
input3,
input4,
]);
const tsResult: string[] = Formatter.extractForbiddenCountriesFromPacked([input1, input2, input3, input4], "id");
let formattedTsResult = tsResult
.map((item: string, index: number) => {
if (index % 3 === 0) {
return item + tsResult[index + 1] + tsResult[index + 2];
}
return undefined;
})
.filter(Boolean);
expect(contractResult).to.deep.equal(formattedTsResult);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider simplifying the test formatting logic.

The test now uses complex formatting logic that concatenates every 3 consecutive elements from the TypeScript result. This approach has potential issues:

  1. The logic assumes the array length is always divisible by 3
  2. It's tightly coupled to the TypeScript implementation's output format
  3. The formatting logic is hard to understand and maintain

Consider either:

  • Moving this formatting logic into a helper function with clear documentation
  • Adjusting the TypeScript implementation to return pre-formatted results
  • Adding validation to ensure the array length is divisible by 3
-      let formattedTsResult = tsResult
-        .map((item: string, index: number) => {
-          if (index % 3 === 0) {
-            return item + tsResult[index + 1] + tsResult[index + 2];
-          }
-          return undefined;
-        })
-        .filter(Boolean);
+      // Helper function for clarity
+      function formatTsResult(result: string[]): string[] {
+        if (result.length % 3 !== 0) {
+          throw new Error('Array length must be divisible by 3');
+        }
+        const formatted: string[] = [];
+        for (let i = 0; i < result.length; i += 3) {
+          formatted.push(result[i] + result[i + 1] + result[i + 2]);
+        }
+        return formatted;
+      }
+      
+      let formattedTsResult = formatTsResult(tsResult);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const input1 = "0x414754414154414149414f4741444e414d5341415a44424c41414c41474641";
const input2 = "0x4542524c42425242444742524842534842455a415355415742414d52414752";
const input3 = "0x4e41434d484b5650434e52424c4f424e5442554d424e45425a4c42554d424c";
const input4 = "0x4853454d4559424d5a45575a5455564b4e445453454e4843564943";
const contractResult = await testFormatter.testExtractForbiddenCountriesFromPacked([
input1,
input2,
input3,
input4,
]);
const tsResult: string[] = Formatter.extractForbiddenCountriesFromPacked([input1, input2, input3, input4], "id");
let formattedTsResult = tsResult
.map((item: string, index: number) => {
if (index % 3 === 0) {
return item + tsResult[index + 1] + tsResult[index + 2];
}
return undefined;
})
.filter(Boolean);
expect(contractResult).to.deep.equal(formattedTsResult);
const input1 = "0x414754414154414149414f4741444e414d5341415a44424c41414c41474641";
const input2 = "0x4542524c42425242444742524842534842455a415355415742414d52414752";
const input3 = "0x4e41434d484b5650434e52424c4f424e5442554d424e45425a4c42554d424c";
const input4 = "0x4853454d4559424d5a45575a5455564b4e445453454e4843564943";
const contractResult = await testFormatter.testExtractForbiddenCountriesFromPacked([
input1,
input2,
input3,
input4,
]);
const tsResult: string[] = Formatter.extractForbiddenCountriesFromPacked([input1, input2, input3, input4], "id");
// Helper function for clarity
function formatTsResult(result: string[]): string[] {
if (result.length % 3 !== 0) {
throw new Error('Array length must be divisible by 3');
}
const formatted: string[] = [];
for (let i = 0; i < result.length; i += 3) {
formatted.push(result[i] + result[i + 1] + result[i + 2]);
}
return formatted;
}
let formattedTsResult = formatTsResult(tsResult);
expect(contractResult).to.deep.equal(formattedTsResult);
🤖 Prompt for AI Agents
In contracts/test/unit/formatter.test.ts around lines 153 to 172, the test
formatting logic concatenates every 3 consecutive elements from the TypeScript
result array, which is complex, assumes the array length is divisible by 3, and
is hard to maintain. Refactor this by extracting the formatting logic into a
well-documented helper function to improve clarity and reusability, or modify
the TypeScript implementation to return already formatted results. Additionally,
add validation to check that the array length is divisible by 3 before
processing to prevent potential runtime errors.

Comment on lines 1 to 219
// // SPDX-License-Identifier: MIT
// pragma solidity 0.8.28;

// import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
// import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

// import {ISelfVerificationRoot} from "../interfaces/ISelfVerificationRoot.sol";

// import {SelfCircuitLibrary} from "../libraries/SelfCircuitLibrary.sol";
// import {SelfVerificationRoot} from "../abstract/SelfVerificationRoot.sol";

// /**
// * @title SelfPassportERC721
// * @notice This contract issues ERC721 tokens based on verified passport credentials using self's verification infrastructure
// * @dev Inherits from SelfVerificationRoot for verification logic and ERC721 for NFT functionality
// */
// contract SelfPassportERC721 is SelfVerificationRoot, ERC721, Ownable {
// using SelfCircuitLibrary for uint256[3];

// // ====================================================
// // Storage Variables
// // ====================================================

// /// @notice Counter for token IDs
// uint256 private _tokenIdCounter;

// /// @notice Mapping from token ID to passport attributes
// mapping(uint256 tokenId => SelfCircuitLibrary.PassportData passportAttributes) private _passportAttributes;

// /// @notice Mapping to track minted user identifiers to prevent double minting
// mapping(uint256 userIdentifier => bool minted) private _mintedUserIdentifiers;

// // ====================================================
// // Events
// // ====================================================

// event PassportNFTMinted(uint256 indexed tokenId, address indexed owner, SelfCircuitLibrary.PassportData attributes);

// // ====================================================
// // Errors
// // ====================================================

// error UserIdentifierAlreadyMinted();
// error InvalidUserIdentifier();

// // ====================================================
// // Constructor
// // ====================================================

// /**
// * @notice Constructor for the SelfPassportERC721 contract
// * @param identityVerificationHubAddress The address of the Identity Verification Hub
// * @param scopeValue The expected proof scope for user registration
// * @param contractVersion The contract version for validation
// * @param attestationIdsList The expected attestation identifiers required in proofs
// * @param name The name of the NFT collection
// * @param symbol The symbol of the NFT collection
// */
// constructor(
// address identityVerificationHubAddress,
// uint256 scopeValue,
// uint8 contractVersion,
// bytes32[] memory attestationIdsList,
// string memory name,
// string memory symbol
// )
// SelfVerificationRoot(identityVerificationHubAddress, scopeValue, contractVersion, attestationIdsList)
// ERC721(name, symbol)
// Ownable(_msgSender())
// {}

// // ====================================================
// // External/Public Functions
// // ====================================================

// /**
// * @notice Updates the scope used for verification
// * @dev Only callable by the contract owner
// * @param newScope The new scope to set
// */
// function setScope(uint256 newScope) external onlyOwner {
// _setScope(newScope);
// }

// /**
// * @notice Adds a new attestation ID to the allowed list
// * @dev Only callable by the contract owner
// * @param attestationId The attestation ID to add
// */
// function addAttestationId(bytes32 attestationId) external onlyOwner {
// _addAttestationId(attestationId);
// }

// /**
// * @notice Removes an attestation ID from the allowed list
// * @dev Only callable by the contract owner
// * @param attestationId The attestation ID to remove
// */
// function removeAttestationId(bytes32 attestationId) external onlyOwner {
// _removeAttestationId(attestationId);
// }

// /**
// * @notice Updates the verification configuration
// * @dev Only callable by the contract owner
// * @param newVerificationConfig The new verification configuration
// */
// function setVerificationConfig(
// ISelfVerificationRoot.VerificationConfig memory newVerificationConfig
// ) external onlyOwner {
// _setVerificationConfig(newVerificationConfig);
// }

// /**
// * @notice Get passport attributes for a specific token ID
// * @param tokenId The token ID to query
// * @return The passport attributes associated with the token
// */
// function getPassportAttributes(uint256 tokenId) external view returns (SelfCircuitLibrary.PassportData memory) {
// require(_exists(tokenId), "Token does not exist");
// return _passportAttributes[tokenId];
// }

// /**
// * @notice Check if a user identifier has already minted an NFT
// * @param userIdentifier The user identifier to check
// * @return True if the user identifier has already minted, false otherwise
// */
// function isUserIdentifierMinted(uint256 userIdentifier) external view returns (bool) {
// return _mintedUserIdentifiers[userIdentifier];
// }

// /**
// * @notice Check if the specified attestation ID is allowed
// * @param attestationId The attestation ID to check
// * @return True if the attestation ID is allowed, false otherwise
// */
// function isAttestationIdAllowed(bytes32 attestationId) external view returns (bool) {
// return _attestationIdToEnabled[attestationId];
// }

// /**
// * @notice Get the current scope value
// * @return The current scope value
// */
// function getScope() external view returns (uint256) {
// return _scope;
// }

// /**
// * @notice Get the current verification configuration
// * @return The current verification configuration
// */
// function getVerificationConfig() external view returns (ISelfVerificationRoot.VerificationConfig memory) {
// return _getVerificationConfig();
// }

// // ====================================================
// // Override Functions from SelfVerificationRoot
// // ====================================================

// /**
// * @notice Hook called after successful verification - handles NFT minting
// * @dev Validates user identifier and mints passport NFT with extracted attributes
// * @param userIdentifier The user identifier from the proof
// * @param revealedDataPacked The packed revealed data from the proof
// */
// function onBasicVerificationSuccess(
// bytes32 /* attestationId */,
// uint256 /* scope */,
// uint256 userIdentifier,
// uint256 /* nullifier */,
// uint256 /* identityCommitmentRoot */,
// uint256[] memory revealedDataPacked,
// uint256[4] memory /* forbiddenCountriesListPacked */
// ) internal override {
// // Check if user identifier is valid
// if (userIdentifier == 0) {
// revert InvalidUserIdentifier();
// }

// // Check if user identifier has already minted an NFT
// if (_mintedUserIdentifiers[userIdentifier]) {
// revert UserIdentifierAlreadyMinted();
// }

// // Convert dynamic array to fixed-size array for passport data (first 3 elements)
// uint256[3] memory passportRevealedData;
// for (uint256 i = 0; i < 3 && i < revealedDataPacked.length; i++) {
// passportRevealedData[i] = revealedDataPacked[i];
// }

// // Extract passport data using SelfCircuitLibrary
// SelfCircuitLibrary.PassportData memory attributes = SelfCircuitLibrary.extractPassportData(
// passportRevealedData
// );

// // Mint NFT
// uint256 tokenId = _tokenIdCounter++;
// _mint(msg.sender, tokenId);
// _passportAttributes[tokenId] = attributes;
// _mintedUserIdentifiers[userIdentifier] = true;

// emit PassportNFTMinted(tokenId, msg.sender, attributes);
// }

// // ====================================================
// // Internal Functions
// // ====================================================

// /**
// * @notice Check if a token exists
// * @param tokenId The token ID to check
// * @return True if the token exists, false otherwise
// */
// function _exists(uint256 tokenId) internal view returns (bool) {
// return _ownerOf(tokenId) != address(0);
// }
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider removing commented code or use proper deprecation.

The entire contract has been commented out, which suggests it's being deprecated. Consider these alternatives:

  1. Remove the file entirely if it's no longer needed
  2. Add deprecation documentation explaining why it was removed and what replaces it
  3. Move to a separate deprecated folder if you need to keep it for reference

Keeping large amounts of commented code can:

  • Confuse future developers about what's active
  • Increase repository size unnecessarily
  • Make code reviews more difficult

If this contract is replaced by the new verification system mentioned in the AI summary, consider adding a README or migration guide explaining the transition.

🤖 Prompt for AI Agents
In contracts/contracts/example/SelfPassportERC721.sol from lines 1 to 219, the
entire contract code is commented out, which can confuse developers and clutter
the repository. To fix this, either delete the file if it is no longer needed,
or move it to a dedicated deprecated folder with a clear README or migration
guide explaining why it was deprecated and what replaces it. Avoid keeping large
blocks of commented code in active directories.

Comment on lines 163 to 190
{method.key === 'mrzCorrection' &&
selectedMethod === 'mrzCorrection' && (
<YStack marginTop={12} gap={8}>
<Input
placeholder="Enter Passport/ID Number"
value={passportNumber}
onChangeText={onPassportNumberChange}
/>

<BodyText>Birth Date (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfBirth}
onChangeText={onDateOfBirthChange}
keyboardType="numeric"
maxLength={6}
/>

<BodyText>Date of Expiry (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfExpiry}
onChangeText={onDateOfExpiryChange}
keyboardType="numeric"
maxLength={6}
/>
</YStack>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add input validation for date fields.

The MRZ correction form lacks validation for the date fields. Consider adding:

  1. Format validation: Ensure YYMMDD format is followed
  2. Range validation: Verify realistic date ranges
  3. Visual feedback: Show format hints or validation errors
<BodyText>Birth Date (YYMMDD)</BodyText>
<Input
  placeholder="YYMMDD"
  value={dateOfBirth}
  onChangeText={onDateOfBirthChange}
  keyboardType="numeric"
  maxLength={6}
+ autoCorrect={false}
+ autoCapitalize="none"
/>
+{dateOfBirth && !/^\d{6}$/.test(dateOfBirth) && (
+  <Description color="red">
+    Please enter date in YYMMDD format
+  </Description>
+)}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{method.key === 'mrzCorrection' &&
selectedMethod === 'mrzCorrection' && (
<YStack marginTop={12} gap={8}>
<Input
placeholder="Enter Passport/ID Number"
value={passportNumber}
onChangeText={onPassportNumberChange}
/>
<BodyText>Birth Date (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfBirth}
onChangeText={onDateOfBirthChange}
keyboardType="numeric"
maxLength={6}
/>
<BodyText>Date of Expiry (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfExpiry}
onChangeText={onDateOfExpiryChange}
keyboardType="numeric"
maxLength={6}
/>
</YStack>
)}
{method.key === 'mrzCorrection' &&
selectedMethod === 'mrzCorrection' && (
<YStack marginTop={12} gap={8}>
<Input
placeholder="Enter Passport/ID Number"
value={passportNumber}
onChangeText={onPassportNumberChange}
/>
<BodyText>Birth Date (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfBirth}
onChangeText={onDateOfBirthChange}
keyboardType="numeric"
maxLength={6}
autoCorrect={false}
autoCapitalize="none"
/>
{dateOfBirth && !/^\d{6}$/.test(dateOfBirth) && (
<Description color="red">
Please enter date in YYMMDD format
</Description>
)}
<BodyText>Date of Expiry (YYMMDD)</BodyText>
<Input
placeholder="YYMMDD"
value={dateOfExpiry}
onChangeText={onDateOfExpiryChange}
keyboardType="numeric"
maxLength={6}
/>
</YStack>
)}
🤖 Prompt for AI Agents
In app/src/screens/passport/NFCMethodSelectionScreen.tsx between lines 163 and
190, the date input fields for birth date and date of expiry lack validation.
Add input validation to ensure the dates follow the YYMMDD format using regex or
date parsing, check that the dates fall within realistic ranges (e.g., valid
months and days, not future birth dates), and provide visual feedback such as
error messages or input border color changes when validation fails. Also
consider adding format hints near the inputs to guide users.

Comment on lines 5 to 8
export const AttestationId = {
E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
} as const;
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Address static analysis warning about exports in test files.

The AttestationId constant is exported from a test file, which violates testing best practices.

Move the AttestationId constants to a shared constants file or make them internal to the test:

-export const AttestationId = {
+const AttestationId = {
   E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
   EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
 } as const;

Alternatively, move these to a shared constants file if they need to be reused across multiple test files.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const AttestationId = {
E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
} as const;
const AttestationId = {
E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
} as const;
🧰 Tools
🪛 Biome (1.9.4)

[error] 4-8: Do not export from a test file.

(lint/suspicious/noExportsInTest)

🤖 Prompt for AI Agents
In contracts/test/unit/CustomVerifier.test.ts around lines 5 to 8, the
AttestationId constant is exported from a test file, which is against best
practices. To fix this, either move the AttestationId object to a shared
constants file if it needs to be reused across multiple test files, or make it
internal to this test file by removing the export keyword so it is not exposed
outside the test scope.

vcAndDisclose: vcAndDiscloseVerifier,
vcAndDiscloseId: vcAndDiscloseIdVerifier,
register: registerVerifier,
registerId: RegisterVerifierId.register_sha256_sha256_sha256_rsa_65537_4096,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent field assignment in return object

The registerId field is assigned a VerifierId constant instead of the register ID verifier contract, which is inconsistent with other verifier fields.

-    registerId: RegisterVerifierId.register_sha256_sha256_sha256_rsa_65537_4096,
+    registerId: registerIdVerifier,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
registerId: RegisterVerifierId.register_sha256_sha256_sha256_rsa_65537_4096,
registerId: registerIdVerifier,
🤖 Prompt for AI Agents
In contracts/test/utils/deploymentV2.ts at line 229, the registerId field is
incorrectly assigned a VerifierId constant instead of the actual register ID
verifier contract. Replace the assignment with the correct register ID verifier
contract reference to maintain consistency with other verifier fields in the
return object.

Comment on lines 3 to 6
import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
import {AttestationId} from "../constants/AttestationId.sol";
import {SelfStructs} from "./SelfStructs.sol";
import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate import statement.

CircuitAttributeHandlerV2 is imported twice (lines 3 and 6).

 import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
 import {AttestationId} from "../constants/AttestationId.sol";
 import {SelfStructs} from "./SelfStructs.sol";
-import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
 import {Formatter} from "./Formatter.sol";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
import {AttestationId} from "../constants/AttestationId.sol";
import {SelfStructs} from "./SelfStructs.sol";
import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
import {CircuitAttributeHandlerV2} from "./CircuitAttributeHandlerV2.sol";
import {AttestationId} from "../constants/AttestationId.sol";
import {SelfStructs} from "./SelfStructs.sol";
import {Formatter} from "./Formatter.sol";
🤖 Prompt for AI Agents
In contracts/contracts/libraries/CustomVerifier.sol between lines 3 and 6, there
is a duplicate import of CircuitAttributeHandlerV2 on lines 3 and 6. Remove the
second import statement on line 6 to eliminate redundancy.

address registryAddress = $._registries[attestationId];

if (registryAddress == address(0)) {
revert("Registry not set for attestation ID");
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use custom error instead of string revert for consistency.

The contract uses custom errors throughout but reverts with a string here, which is inconsistent with the standardized error handling approach.

-            revert("Registry not set for attestation ID");
+            revert InvalidAttestationId();

Or create a more specific error:

+    error RegistryNotSet(bytes32 attestationId);
     
     // In the function:
-            revert("Registry not set for attestation ID");
+            revert RegistryNotSet(attestationId);
🤖 Prompt for AI Agents
In contracts/contracts/IdentityVerificationHubImplV2.sol at line 781, replace
the string revert with a custom error to maintain consistency with the
contract's error handling style. Define a new custom error for "Registry not set
for attestation ID" if it does not exist, and use that error in the revert
statement instead of the string message.

@transphorm transphorm changed the base branch from main to dev June 20, 2025 21:08
@transphorm
Copy link
Member Author

@coderabbtai review

@transphorm transphorm changed the title Justin/bump android build 72 upgrade gesture package Bump build: ios 133; android 72. Upgrade gesture package. Re-add @tamagui/toast Jun 20, 2025
@transphorm transphorm changed the title Bump build: ios 133; android 72. Upgrade gesture package. Re-add @tamagui/toast Bump build: ios 133; android 72 and build fixes Jun 20, 2025
"react-native-device-info": "^14.0.4",
"react-native-dotenv": "^3.4.11",
"react-native-gesture-handler": "^2.22.1",
"react-native-gesture-handler": "2.24.0",
Copy link
Member Author

@transphorm transphorm Jun 21, 2025

Choose a reason for hiding this comment

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

upgrade gesture handler to be compatible with our version of react native. older version was causing ios builds to break

versions

Copy link
Member Author

Choose a reason for hiding this comment

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

@seshanthS for rn gesture handler, it recommends we don't go past 2.24.0 since we are on 0.75.4 rn


//Camera
implementation "com.github.RedApparat:Fotoapparat:2.7.0"
implementation "com.github.fotoapparat:fotoapparat:2.7.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

fix source so that fotoapparat can compile successfully.

build is currently broken on jitpack:
https://jitpack.io/#RedApparat/Fotoapparat

Screenshot 2025-06-21 at 9 04 58 AM

# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
Copy link
Member Author

Choose a reason for hiding this comment

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

optimize android build settings

@transphorm transphorm requested a review from seshanthS June 21, 2025 16:55
@transphorm transphorm merged commit ae0dca3 into dev Jun 21, 2025
9 of 10 checks passed
@transphorm transphorm deleted the justin/bump-android-build-72-upgrade-gesture-package branch June 21, 2025 16:55
remicolin added a commit that referenced this pull request Jun 24, 2025
* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* #652 (comment)

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>
0xturboblitz pushed a commit that referenced this pull request Jun 25, 2025
* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* #652 (comment)

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>
remicolin added a commit that referenced this pull request Jun 25, 2025
* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* #652 (comment)

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

* refactor deployment scripts (#678)

* feat: add register eu id instances (#682)

* feat: add register eu id instances

* feat: add new instances

* chore: update scripts

* chore: fix sig alg

* chore: rm circuits

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>
remicolin added a commit that referenced this pull request Aug 20, 2025
* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* https://github.com/selfxyz/self/pull/652#issuecomment-2992046545

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* merge dev to main (#657)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* https://github.com/selfxyz/self/pull/652#issuecomment-2992046545

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

* Dev (#677)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* https://github.com/selfxyz/self/pull/652#issuecomment-2992046545

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>

* refactor deployment scripts (#678)

* feat: add register eu id instances (#682)

* feat: add register eu id instances

* feat: add new instances

* chore: update scripts

* chore: fix sig alg

* chore: rm circuits

* update the smart contracts scripts (#684)

* remove the && false

* fix euid (#685)

* keep build and version in sync (#686)

* fix env set to null

* fix: circuit for register ci (#690)

* fix: circuit for register ci

* fix: rm duplicate workflow_dispatch

* feat: add better error handling (#691)

* fix: older than bug (#692)

* bump: sdk/[email protected]

* fix: config not found bug

* decrease parallel circuits to 3

* ci: add prettier check for contract sdk (#602)

* Add Prettier check for code formatting in contracts workflow

* Update contracts workflow: remove unused checkout action and fix build step name

* Run formatter

* Run lint fix

* chore: update build_cpp to 2 concurrent builds

* Contract/fix sdk (#695)

* fix contracts sdk

* fix contracts sdk

* Fix contract example v2 (#694)

* feat: add verification config ID functionality to Airdrop, HappyBirthday, and SelfIdentityERC721 contracts

* Run formatter

* SEL-473: Add lint rule for BUSL headers (#698)

* chore(app): enforce license header via eslint

* update lock and order

* fix formatting

* SEL-444: Fix android cloud backup (#697)

* feat(android): migrate google backup

* update lock and google services config

* add bulk format command

* backup fixes

* working drive settings!!!!!!!!

* remove unneeded intent filter

* add tests

* coderabbit feedback

* coderabbit feedback

* abstract google method

* coderabbit feedback and fix test

* more coderabbit suggestions and tests fixes

* chore: update relayer verifier enum to include the register circuits (#699)

* fix env sample (#700)

* Abstract iOS cloud backup logic (#701)

* feat(ios): abstract cloud backup logic

* prettier and cr feedback

* tested on iOS and android and functionality is the same

* Fix navigation serialization warnings (#702)

* test: cover modal callbacks

* coderabbit feedback

* feat(app): clarify passport linking (#704)

* Show NFC support message (#708)

* SEL-425: Add document management analytics events (#706)

* Add document management analytics

* coderabbit feedback

* SEL-447: Improve proof failure feedback (#707)

* feat: flag stale proofs as failed

* make a constant

* format

* SEL-330: Add backup check after verification (#711)

* route to save phrase if backup disabled

* format

* SEL-483: Implement recovery backup prompts (#710)

* feat: prompt users to back up account

* feat: prompt users to back up account

* format

* Add tests for recovery prompt logic

* more lint updates

* fix imports

* fix unused import

* update cursor suggestions

* implement coderabbit suggestions and fix tests

* SEL-472: Enable production push notifications (#703)

* chore: leave sandbox apns token comment

* tweak entitlement

* coderabbit ai feedback

* firebase tweaks

* Chore: ensure there is an extra empty line after the license declaration (#712)

* ensure there is an extra empty line after the license declaration

* ignore adding header to cjs config files

* add missing license header

* ignore linting metro config

* bump version and add mainnet hub address

* Bugfix: Show recovery prompt only when user has docs (#714)

* feat(app): prompt recovery only when docs exist

* cr feedbacl

* SEL-487: Prompt user to backup recovery phrase before registering (#715)

* feat: prompt backup before registration

* coderabbit feedback

* fix tests

* coderabbitai feedback and fix tests

* Remove StartupFlushPolicy (#717)

* SEL-479: Multi-ID onboarding mvp flow (#688)

* save new launch screen wip

* save wip

* finalize launch look

* replace launch screen

* rename

* update camera onboarding and scan screen

* update tips looks

* update nfc scan issue screens

* update copy

* add launch screen todo

* fix casing

* update launch screen link, copy and add tracking event

* bump project version to match app store

* match app store

* updated supported bio id link

* add dialog message support back in

* cr feedback

* bump version and build

* update images

* tweak animation layout

* loop with setTimeout

* fix onboarding assets (#719)

* feat: add flag to use PACEPolling (#680)

* feat: add flag to use PACEPolling

* fix: santize before storing in store

* bump ios build number and update podfile lock

* prettier

* bump build

* feat: add flag to use PACEPolling

* fix: santize before storing in store

* bump ios build number and update podfile lock

* prettier

* bump build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* fix backup button label (#722)

* update version to 2.6.0 and bump build numbers (#721)

* SEL-179 & SEL-312: Add gitleaks and GitGuardian scanning (#705)

* chore: add secret scanning setup

* fix: correct GitGuardian action path

* cr feedbacak

* test husky commit

* pr feedback

* fix workflows

* tweaks

* fix versions

* upgrade: migrate from husky v8 to v9

- Update husky from ^8.0.0 to ^9.1.7
- Change prepare script from 'husky install' to 'husky'
- Remove v8 hook structure (shebang, husky.sh sourcing)
- Delete .husky/_/ directory as it's not needed in v9
- Maintain gitleaks pre-commit hook functionality

* coderabbitai feedback

* add bulk sort command (#723)

* feat(app): redirect empty docs to launch (#725)

* Apply consistent safe area padding across screens (#726)

* Contracts/update verifiers (#729)

* update the verifiers

* update deployment script

* update deployment script and deploy to prod

* prettier run write

* App/ethcc fixes (#730)

* fix mock data screen

* increase timout between dsc and register proof

* fix the isUserRegisteredWithAlternativeCSCA function

* yarn nice

* allow people to switch to a mock id (#732)

* yarn nice

* chore: update default config id method

* chore: use named exports

* Update README.md

* Temporarily disable recovery redirect and reminder prompts  (#733)

* Revert "SEL-487: Prompt user to backup recovery phrase before registering (#715)"

This reverts commit fe14ac655e11b4b9e0c4023002b84fcc79bedd31.

* revert update

* fix safe area context pkg

* Revert "SEL-487: Prompt user to backup recovery phrase before registering (#715)"

This reverts commit fe14ac655e11b4b9e0c4023002b84fcc79bedd31.

* fix old flow

* more silent tests

* update lock files

* hard code return

* SEL-486: Fix unwrap DO (#718)

* update podfile: unwrapDO

* update lock

* bump version and builds

* bump build; forgot to enable logs

* fix version to not interfere with release

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-494: Update proving machine event tracking (#734)

* Add extensive proof analytics instrumentation

* prettier and sort events by key name

* remove loading screen race condition redirect (#736)

* Chore: new build for v2.6.0 ios 145 android 81 (#737)

* bump version and build

* properly bump app

* bump build

* Improve manual mobile deploy workflow and docs (#728)

* Add basic Fastlane helper tests

* Upgrade fastlane and enhance helper tests (#738)

* simplify mobile deploy pipelines and make them manual. update readme

* update fastlane dev readme

* update tests and add helper script

* cr feedback, update tests, revert circuits package.json sort change

* tweaks

* fix slack

* cr feedback and fixes

* add better cjs eslint support

* save wip. add confirmation check script. update scripts

* remove auto increment feature

* migrate readme items over to DEV due to fastlane auto regen docs flow

* use regular xcode

* fix hermes compiler path

* coderabbit feedback

* reinstall when on local dev

* fix upload

* simplify

* simplify confirmation feedback with tests

* fix mobile deploys

* cr feedback

* test iOS building

* fix trigger logic

* cr feedback

* updates

* fix env var

* fix order

* re-enable upload to testflight for ios

* updated notes

* chore: update readme

* Bugfix: android deeplinks (#742)

* bugfix: deep linking

* add android manifest test

* bump build and version

* format readme

* fix deeplink genmockiddoc

* add the gender to the deeplink optoin

* bump version (#743)

* fix the female bug

* bump build 148 (#744)

* SEL-496: Add Firebase Remote Config and dev feature flag screen (#735)

* feat: add remote config support

* update lock

* tweak config logic. add feature flag viewing screen

* add tests

* allow for local overriding of feature flags

* save local override work

* save wip

* clean up ui

* update screen to handle multi value types

* fix tests

* cr feedback and fix tests

* remote config upates. fix tests, codex feedback

* Improve AGENTS workflow notes (#747)

* clarify workflow instructions

* agents feedback

* Address minor mobile deployment bugs (#745)

* feat: improve deployment tooling

* cr feedback

* for temp testing

* clean build artifacts after deploy

* add deploy source

* uncomment ios commands

* Add tests for minor deployment fixes (#750)

* Add test coverage for deployment scripts and Fastfile

* format

* increase github check to 5 minutes

* Extend platform build file tests (#748)

* Add build file tests

* cr feedback

* Add proving machine tests (#749)

* Add actor mock helper and tests

* format tests

* fix tests

* wip fix tests

* address cr feedback

* Add thorough test cases for mobile app (#752)

* Add actor mock helper and tests

* format tests

* fix tests

* Revert non-app tests

* update tests

* fix tests

* coderabbit feedback

* revert change

* remove spurious tests

* don't use crypto in core sdk

* Start of Web App (#689)

* Add .cursorignore to optimize AI editor performance and security (#758)

Prevents Cursor AI from accessing sensitive files (keys, credentials,
deployment configs) and large generated artifacts that slow down indexing.
Keeps source code accessible while excluding build outputs, node_modules,
and circuit/contract compilation artifacts across the monorepo.

* SEL-504: fix fonts and some styles (#762)

* fix fonts and some styles

* dry config

* fix some warnings

* lets start with coverage for app (#763)

* lets start with coverage for app

* lint

* better setup

* SEL-559: Update td1 regex (#760)

* feat: update td1 regex

* update review comments

* fix: NPE on expirationDate regex

* fix user defined data (#766)

* fix: name formatting for middle name

* bump: sdk/core to 1.0.7-beta.1

* Feat/retrieve OFAC trees from api (#769)

* retrieve the ofac trees from the api

* remove the ofac trees from the common repo

* fix ofac test

* yarn nice

* yarn nice

* yarn nice

* refactor ofac fetching

* Release new build v2.6.2 (#779)

* bump version and build

* ignore podfile

* Remove failing version test (#780)

* remove version check test

* remove test all together

* SEL-269: Update ESLint rules & lock prettier config (#781)

* Update ESLint config and lock prettier config

* Refine ESLint config and fix lint issues

* Apply eslint fixes

* Use socketIo alias (#782)

* move gesture handler

* save wip updates

* fix svg imports

* update tsconfig

* eslint updates

* eslint fixes

* improve ignore folders

* coderabbit feedback

* Fix style prop shorthands (#787)

* Expand view style props

* Expand remaining style props

* update types

* fix pipeline

* fix test env check

* nicer casting

* fix booleans

* update deeplink url handling and make it more robust

* add socket error handler

* Add COSE signature verification tests (#788)

* Update ESLint config and lock prettier config

* Refine ESLint config and fix lint issues

* save wip updates

* eslint updates

* eslint fixes

* Add COSE signature verification tests

* fix tests

* SEL-553: Show NFC Progress (#764)

* feat: add haptics

* fix: BAC FAILED error event

* update lock file

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-566: Navigate Home based on document validity (#768)

* feat: navigate home if atleast one valid document is present

* update comments

* Review: Remove unnecessary continue statement

* feat: add tracking

* SEL-544: Generate Mock DSC on mock-passport flow (#772)

* feat: Generate mock DSC on mock-passport flow

* Remove console log

* yarn format

* revert to mock dsc generation

* SEL-570: Display user ID in prove screen (#790)

* Display user ID on prove screen

* Add user ID formatting util and tests

* Clarify user ID formatting

* fix nice

* add tests and save toggle wip

* update tests based on feedback

* say connected wallet when wallet

* fix: Add localhost validation to prevent invalid endpoint usage in QR Code SDK (#794)

* Feat/mobile deployment automation (#759)

* feat: add version management system with build number tracking

- Add version.json to track iOS/Android build numbers separately
- Create version.cjs script for build number management
- Add Fastlane version_manager.rb helper
- Keep npm version for semver, version.json for build tracking

* feat: integrate version.json with Fastlane deployment process

## What Changed
- Updated iOS and Android Fastlane lanes to use version.json for build number management
- Added automatic build number increment on deployment
- Added deployment timestamp tracking

## How It Works

### iOS Deployment
1. Reads current build number from version.json
2. Increments iOS build number (e.g., 148 → 149)
3. Updates Xcode project with new build number via increment_build_number
4. Proceeds with TestFlight deployment
5. Updates lastDeployed timestamp on successful upload

### Android Deployment
1. Reads current build number from version.json
2. Increments Android build number (e.g., 82 → 83)
3. Updates build.gradle with new version code via increment_version_code
4. Proceeds with Play Store deployment
5. Updates lastDeployed timestamp on successful upload

## Why This Change
- Eliminates manual version/build number entry
- Prevents version conflicts between deployments
- Provides single source of truth for build numbers
- Enables automatic deployments without human intervention
- Tracks deployment history with timestamps

## Dependencies
- Requires version.json file (already created in previous commit)
- Uses existing Fastlane plugins:
  - increment_build_number (iOS - built-in)
  - increment_version_code (Android - from plugin)
- Version numbers still managed by npm version command

* feat: enhance deploy confirmation with version.json info

* fix: use ENV variable directly in increment_build_number to avoid secret masking

* fix: correct xcodeproj path for GitHub Actions workflow

* feat: add test mode to workflow for safe testing

- Skip store uploads when test_mode is true
- Test version bumps and builds without deployment
- Prevent accidental pushes to TestFlight/Play Store

* fix: use gradle_file_path instead of gradle_file for increment_version_code

* fix: use gsub to remove ../ prefix for CI compatibility

* chore: remove accidentally committed files

- Remove .cursor/mcp.json
- Remove .cursorignore
- Remove deployment-automation-summary.md
- Remove deployment-meeting-questions.md
- Remove pipeline.md

* feat: auto-commit version.json after successful deployment

- Commits version.json changes back to repository
- Only runs when test_mode is false
- Uses [skip ci] to prevent infinite loops
- Checks for actual changes before committing

* feat : update package.json in build step using npm version

* feat: add comprehensive caching to mobile deployment workflow

- Add caching for Yarn dependencies, Ruby gems, CocoaPods, Gradle, and Android NDK
- Implement cache versioning strategy for easy cache invalidation
- Fix cache order: caches now restored after checkout but before dependency installation
- Update mobile-setup action to skip installs when dependencies are cached
- Add cache size monitoring to track usage against GitHub's 10GB limit
- Fix Slack notification bug: skip notifications in test_mode
- Add detailed logging for package.json version updates (show from/to versions)

Expected performance improvement: ~50% faster builds (from ~15min to ~7-10min)

* fix: move bundler config after Ruby setup in mobile-setup action

* fix: rename cache env vars to avoid Yarn conflicts

Yarn was interpreting YARN_CACHE_VERSION as its own config setting.
Prefixed all cache version env vars with GH_ to avoid conflicts.

* fix: remove bundler deployment mode to allow Gemfile updates

The deployment mode was causing bundler to fail when Gemfile
changed (nokogiri was removed). CI should be able to update
the lockfile as needed.

* feat: implement strict lock file enforcement (Option 1)

- Re-enable bundler deployment mode for strict Gemfile.lock checking
- Use yarn install --immutable for strict yarn.lock checking
- Add clear error messages when lock files are out of date
- Add pre-checks to verify lock files exist
- This ensures reproducible builds and makes caching maximally effective

When developers change dependencies, they must now:
1. Run yarn install or bundle install locally
2. Commit the updated lock files
3. CI will fail with helpful instructions if they forget

* fix: update Gemfile.lock for CI environment

Remove nokogiri from Gemfile.lock since it's excluded in CI
environments (GITHUB_ACTIONS=true). This allows the strict
lock file checks to pass in CI.

* fix: correct yarn.lock path for monorepo workspace

The project uses Yarn workspaces with yarn.lock at the repository
root, not in the app directory. Updated paths to check for yarn.lock
at workspace root and use it for cache keys.

* fix: handle both boolean and string test_mode parameter

The test_mode parameter was only checking for string 'true' but
could be passed as boolean true from command line. Now handles both
cases to ensure test mode works correctly for iOS and Android.

* fix: address code review feedback for mobile deployment workflow

- Replace jq with Node.js for version extraction (jq not available on macOS runners)
- Fix concurrent commit race condition by creating separate update-version job
- Add platform validation to version_manager.rb and version.cjs scripts
- Use POSIX-compatible single = for shell string comparisons
- Ensure single atomic commit when deploying to both platforms

* fix: formatting and linting issues

- Remove trailing spaces from workflow YAML file
- Fix prettier formatting in JavaScript files
- Add -y flag to yarn version command for non-interactive mode
- Address all lint warnings from CI

---------

Co-authored-by: Jayaditya Gupta <[email protected]>

* fix: increment iOS build number

* fix: bump app version to 2.6.3 for iOS release

* App/deeplink callback (#789)

* add deepllinkCallback support

* bump package version

* yarn nice

* fix background countdown

* cast the URL to prevent malicious code introduction

* fix: use cleanDocumentNumber (#784)

* increment iOS bundle version

* Feat/push to dev main (#767)

* feat: add version management system with build number tracking

- Add version.json to track iOS/Android build numbers separately
- Create version.cjs script for build number management
- Add Fastlane version_manager.rb helper
- Keep npm version for semver, version.json for build tracking

* feat: integrate version.json with Fastlane deployment process

## What Changed
- Updated iOS and Android Fastlane lanes to use version.json for build number management
- Added automatic build number increment on deployment
- Added deployment timestamp tracking

## How It Works

### iOS Deployment
1. Reads current build number from version.json
2. Increments iOS build number (e.g., 148 → 149)
3. Updates Xcode project with new build number via increment_build_number
4. Proceeds with TestFlight deployment
5. Updates lastDeployed timestamp on successful upload

### Android Deployment
1. Reads current build number from version.json
2. Increments Android build number (e.g., 82 → 83)
3. Updates build.gradle with new version code via increment_version_code
4. Proceeds with Play Store deployment
5. Updates lastDeployed timestamp on successful upload

## Why This Change
- Eliminates manual version/build number entry
- Prevents version conflicts between deployments
- Provides single source of truth for build numbers
- Enables automatic deployments without human intervention
- Tracks deployment history with timestamps

## Dependencies
- Requires version.json file (already created in previous commit)
- Uses existing Fastlane plugins:
  - increment_build_number (iOS - built-in)
  - increment_version_code (Android - from plugin)
- Version numbers still managed by npm version command

* feat: enhance deploy confirmation with version.json info

* fix: use ENV variable directly in increment_build_number to avoid secret masking

* fix: correct xcodeproj path for GitHub Actions workflow

* feat: add test mode to workflow for safe testing

- Skip store uploads when test_mode is true
- Test version bumps and builds without deployment
- Prevent accidental pushes to TestFlight/Play Store

* fix: use gradle_file_path instead of gradle_file for increment_version_code

* fix: use gsub to remove ../ prefix for CI compatibility

* chore: remove accidentally committed files

- Remove .cursor/mcp.json
- Remove .cursorignore
- Remove deployment-automation-summary.md
- Remove deployment-meeting-questions.md
- Remove pipeline.md

* feat: auto-commit version.json after successful deployment

- Commits version.json changes back to repository
- Only runs when test_mode is false
- Uses [skip ci] to prevent infinite loops
- Checks for actual changes before committing

* feat : update package.json in build step using npm version

* feat: add comprehensive caching to mobile deployment workflow

- Add caching for Yarn dependencies, Ruby gems, CocoaPods, Gradle, and Android NDK
- Implement cache versioning strategy for easy cache invalidation
- Fix cache order: caches now restored after checkout but before dependency installation
- Update mobile-setup action to skip installs when dependencies are cached
- Add cache size monitoring to track usage against GitHub's 10GB limit
- Fix Slack notification bug: skip notifications in test_mode
- Add detailed logging for package.json version updates (show from/to versions)

Expected performance improvement: ~50% faster builds (from ~15min to ~7-10min)

* fix: move bundler config after Ruby setup in mobile-setup action

* fix: rename cache env vars to avoid Yarn conflicts

Yarn was interpreting YARN_CACHE_VERSION as its own config setting.
Prefixed all cache version env vars with GH_ to avoid conflicts.

* fix: remove bundler deployment mode to allow Gemfile updates

The deployment mode was causing bundler to fail when Gemfile
changed (nokogiri was removed). CI should be able to update
the lockfile as needed.

* feat: implement strict lock file enforcement (Option 1)

- Re-enable bundler deployment mode for strict Gemfile.lock checking
- Use yarn install --immutable for strict yarn.lock checking
- Add clear error messages when lock files are out of date
- Add pre-checks to verify lock files exist
- This ensures reproducible builds and makes caching maximally effective

When developers change dependencies, they must now:
1. Run yarn install or bundle install locally
2. Commit the updated lock files
3. CI will fail with helpful instructions if they forget

* fix: update Gemfile.lock for CI environment

Remove nokogiri from Gemfile.lock since it's excluded in CI
environments (GITHUB_ACTIONS=true). This allows the strict
lock file checks to pass in CI.

* fix: correct yarn.lock path for monorepo workspace

The project uses Yarn workspaces with yarn.lock at the repository
root, not in the app directory. Updated paths to check for yarn.lock
at workspace root and use it for cache keys.

* fix: handle both boolean and string test_mode parameter

The test_mode parameter was only checking for string 'true' but
could be passed as boolean true from command line. Now handles both
cases to ensure test mode works correctly for iOS and Android.

* fix: address code review feedback for mobile deployment workflow

- Replace jq with Node.js for version extraction (jq not available on macOS runners)
- Fix concurrent commit race condition by creating separate update-version job
- Add platform validation to version_manager.rb and version.cjs scripts
- Use POSIX-compatible single = for shell string comparisons
- Ensure single atomic commit when deploying to both platforms

* fix: formatting and linting issues

- Remove trailing spaces from workflow YAML file
- Fix prettier formatting in JavaScript files
- Add -y flag to yarn version command for non-interactive mode
- Address all lint warnings from CI

* feat: implement automated branch-based mobile deployments

- Add mobile-deploy-auto.yml workflow that triggers on PR merges to dev/main
- Update mobile-deploy.yml to support workflow_call for reusability
- Add deployment_track, version_bump, and auto_deploy parameters
- Create new Fastlane lanes (deploy_auto) for iOS and Android
- Implement smart version bumping based on PR labels (major/minor/patch)
- Add graceful error handling for Play Store permission issues
- Enhance Slack notifications with deployment track information

This enables automatic deployments when PRs are merged:
- dev branch → internal testing track
- main branch → production track
- Skip deployment with [skip-deploy] in PR or no-deploy label

* feat: add automated git tagging and release system

- Add automatic git tagging for production deployments (v2.5.5, platform-specific tags)
- Create GitHub releases with changelogs for production deployments
- Add manual release script (yarn release) for version bumping and tagging
- Implement simple changelog generation from git history
- Add comprehensive deployment documentation in .github/MOBILE_DEPLOYMENT.md
- Update app/README.md with deployment commands and workflows

This completes the release automation system requested in the ticket for
manual tagging and versioning with automated changelogs and release notes.

---------

Co-authored-by: Jayaditya Gupta <[email protected]>

* Implement basic code splitting

* cm feedback

* update lock

* yarn nice

* add typing to crypto loader

* fix type. more opportunities

* lint suggestions

* build dependencies before linting

* fix build command

* save updated imports

* update build checks

* fix import

* fix imports and test

* fix install commands

* Update Gemfile.lock to exclude nokogiri in CI environments

- Regenerated Gemfile.lock with GITHUB_ACTIONS=true to match the conditional
  nokogiri exclusion in the Ge…
@coderabbitai coderabbitai bot mentioned this pull request Aug 25, 2025
Nesopie added a commit that referenced this pull request Sep 9, 2025
* make contract sdk simpler (#514)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

* Revert "make contract sdk simpler (#514)" (#518)

This reverts commit 847b88d.

* merge dev into main (#576)

* Feat: Show error code in SDK (#500)

* feat: emit `error_code` and `reason` in app

* feat: add `onError` in sdk

* feat: Display reason in app

* lint & fmt

* feat: add scrollview in ProofRequestStatusScreen for long reasons

* Fix input generation for 521bit curves (#481)

* fix EC point padding for 521 bit curves

* rename modulus to point in findStartIndexEC as it is a point

* simplify matching logic

* simplify padding logic

* remove comment

* remove log

removing .only so the CI/CD runs circuit tests

fix disclosure test

fix scope in test

fix scope error in circuit tests

remove .only

fix test

* run ci/cd

* Feat/simpler contract sdk (#519)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

---------

Co-authored-by: motemotech <[email protected]>

* forgot to include package update (#521)

* Bump version to 2.5.1 (#522)

* bump version

* update fastlane

* fix bump version

* bump build and add todo

* disable commit for now

* [SEL-154] Step 1: Scan your passport (#511)

* simplify navigation logic

* use aesop design hook

* save wip

* add new aesop redesign screens

* save wip design

* refactor nav bar logic

* fix paths

* save wip

* stub progress navbar and save wip

* save wip progress bar animation

* save wip progress bar, almost done with design

* fix progress bar design

* fix bottom padding

* disable git commit for now

* fix flaky android downloads that causes pipeline to crash

* update lock for ci

* [SEL-46] FE: Add minimum bottom padding (#510)

* fix bottom padding for smaller screens

* fix podfile post install hook permissions check

* update pod lock and disable git commit action step for now

* update lock

* fix flaky android downloads that causes pipeline to crash

* fix: improve error handling for forbidden countries list mismatch (#494)

* Update SelfBackendVerifier.ts

* Update constants.ts

* Update formatInputs.ts

* Update formatCallData.ts

* DX: Auto format on save (#526)

* save wip

* use elint instead of prettier to sort imports

* set imports to warn

* sync prettier settigns

* update prettier settings

* save working version

* fix export and disable mobile pipeline for now

* limit auto formatting to the app folder

* remove artefacts

* SEL-187: Make bottom layout scrollable on smaller screens (#525)

* fix design check

* add an option to disable local sending of sentry events

* better sentry enable / disable

* fix scan passport height

* make bottom layout scrollable so it doesn't squish top screen

* simpler logic check. don't create new env var

* fix internet connection issues

* readd comment

* use isConnected instead of internet reachable

* use a dynamic bottom panel height

* add missing recovery screens

* move aesop below

* remove dupe export

* fix rebase

* fix android package download issue

* Feat/extend id support (#517)

* refactor proving impleting xstate, speedup proving

* add disclosure proof support

* keep refactoring provingMachine, clean old implementation

* call init method when switching from dsc to register

* rebase with dev to display why the proof verification failed

* refactor ws connexion between front-end and mobile to retrieve self-app

* update the webclient at proofVerification and use selfAppStore in provingMachine

* fix provintStore.init in ProveScreen

* yarn nice

* fetch data correctly in splash screen

* Bump build versions for 2.5.1 (#531)

* release new builds

* fix app and build versions

* fix env check

* display error animation on failure on loading screen (#532)

* display error animation on failure on loading screen

* remove log

---------

Co-authored-by: Justin Hernandez <[email protected]>

* ci: bump actions/checkout to v4 (#529)

* make contract sdk simpler (#514)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

* Revert "make contract sdk simpler (#514)" (#518)

This reverts commit 847b88d.

* ci: bump actions/checkout to v4

---------

Co-authored-by: nicoshark <[email protected]>
Co-authored-by: turnoffthiscomputer <[email protected]>

* fix italy (#530)

* Fix/proving machine endpoint type (#538)

* store endpoint type in proving machine

* yarn nice

* fix splash screen error (#539)

* New bug fix build for v2.5.1 (#540)

* bump new build for dev fixes

* update lock

* reinstall before running local deploy

* SEL-178: Improve haptic feedback library (#535)

* fix dev settings typing

* add dev screens file

* save haptic feedback progress

* change ordedr

* fix initial route and add haptic feedback screen to dev settings options

* add delete scripts (#542)

* update staging registry address (#545)

* feat: Add Disclose history (#533)

* feat: Add Disclose history

* fix: Duplicate history in list

* fix: Outdated disclosures

* Delete app/ios/Self copy-Info.plist

* allow a scale of up to 1.3 (#546)

* allow a scale of up to 1.3

* update lock files

* clean up unused imports

* fix settings

* add common sdk (#537)

* add common sdk

* remove sdk backend api

* remove registry

* regenerate sha256 rsa dsc each time

* download ski-pem dynamically on staging, refactor initpassportDataParsing

* add state machine for button on prove screen, improve ux on splash screen

* fetch ski-pem in production

* fix linter issues

* fix prove screen button bugs

* update podfile.lock and yarn.lock

* run linter in circuits repo

* bump build

* bump version for sentry debugging

* bump ios to version 118

---------

Co-authored-by: Justin Hernandez <[email protected]>

* better connection check (#548)

* Clean up navigation and setup Jest (#549)

* remove dupe account screens and prefer the term home

* organize screen loading better

* sort keys

* rename screen files wip

* fix deleted directory issues

* rename folders

* fix paths and naming

* save working jest import test

* save base working jest navigation test

* finalize navigation refactor and jest test

* update test name and podfile lock

* remove unused packages

* use the correct version of react test renderer

* bump build (#552)

* Eth dublin (#554)

* add mock id card generator

* add genMockIdDoc in common/sdk exports

* onboard developer id using deeplink, allow custom birthdate on mockpassport

* log more dsc info (#558)

* Push notification (#536)

* add push notification feature

* merge new app impl

* change dsc key

* import

* reverse mock dsc

* worked in the ios

* checked in android

* update url and delete console

* delete small changes

* lint

* add yarn.lock

* fix warning message

* add mock notification service for test code

* fix path for the mock implementation

* add mock deeplink to the test code

* nice notificationServiceMock.js

* delete unused firebase related implementation

* fix wording and UI related to notification service

* hotfix on mockdatascreen

---------

Co-authored-by: turnoffthiscomputer <[email protected]>

* Fix deeplink 2 (#560)

* fix deeplink

* fix deeplink

* yarn nice

* feat: Use vision for MRZ scanning (SEL-47) (#557)

* feat: Use vision for MRZ scanning

* modify label to position the smartphone during the OCR scan

---------

Co-authored-by: turnoffthiscomputer <[email protected]>

* SEL-255: improved loading screen with estimated wait times (#550)

* create new loading screen and rename static to misc

* fix route

* save wip loading screen

* save wip animation

* save static wip design

* continue

* splash

* add a loading screen text helper

* add test for loading screen text

* save wip. almost there

* update haptic logic

* better feedback and add dev scren

* save current work

* update text logic and tests

* load passport metadata in loading screen

* simplify and fix tests

* test for additional exponents

* add new animation

* rename file

* consolidate ui useEffect and fix loading screen layout

* fix current state

* remove mockPassportFlow param

* merge new loading screen and new notification logic

* simplify

* update lock

* use passportMetadata instead of metadata

* save simplification

* update loading text based on pr feedback and tests

* Bump v2.5.1: ios 122; android 60 (#561)

* increment build to 120

* bump builds for 2.5.1. ios 121; android 60

* clean up logic

* upgrade react native firebase for privacy manifests

* update react native keychain to fix could not recover issue (#564)

* fix: update ocr corrections (#563)

* Chore: Polish proof history to prep for release (#566)

* clean up nav and home boundaries, passport data screen insets

* migrate proof history screen out of settings

* minor clean up

* save wip

* add new ibm plex mono font and clean up proof detail screen

* remove test data

* remove extra loading screen text

* remove unnecessary ceil

* Bump v2.5.1; ios 123; android 62 (#565)

* bump to build 61

* bump ios version

* update version

* Feature/add prettier formatter (#568)

* Add Prettier configuration and ignore files for code formatting

- Created .prettierignore to exclude specific directories and files from formatting.
- Added .prettierrc.yml with custom settings for print width and trailing commas.
- Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code.

* Run prettier formatting

* fix nationality using mock passports

* SEL-181 & SEL-252: Update mobile app events (#570)

* improve analytics handling

* add error boundary that flushes segment events before error occurs

* upgrade segment analytics package

* flush analytics when user encounters error screen

* track all click events

* add tracking to loading screen

* better init and click event names

* track cloud backup and modal actions

* use __DEV__ for debugging

* add tracking to account recovery, auth, mock data

* return false instead of throwing

* add more tracking events

* save wip event updating

* abstract analytic event names

* update click events

* clean up

* move reasons comment

* add unsupported passport event

* Feature/enhance self verification root (#569)

* Add SelfVerificationConsumer contract for self-verification logic

- Introduced an abstract contract, SelfVerificationConsumer, that extends SelfVerificationRoot.
- Implemented nullifier tracking, verification success events, and customizable validation and update methods for nullifiers.
- Added error handling for nullifier check failures and hooks for derived contracts to implement custom logic after successful verification.

* Add SelfHappyBirthday contract example using SelfVerificationConsumer

- Introduced SelfHappyBirthday contract that allows users to claim USDC on their birthday.
- Integrated SelfVerificationConsumer for handling verification and nullifier tracking.
- Added functions to set claimable amount and window, along with event emissions for state changes.
- Implemented logic to check if the claim is within the user's birthday window and transfer USDC accordingly.

* Refactor imports in HappyBirthday contract for better organization

- Updated import statements in HappyBirthday.sol to use relative paths for ISelfVerificationRoot, SelfCircuitLibrary, and SelfVerificationConsumer.
- Improved code readability and maintainability by organizing imports more logically.

* Refactor Airdrop contract to use SelfVerificationConsumer for registration logic

- Updated Airdrop contract to inherit from SelfVerificationConsumer instead of SelfVerificationRoot.
- Refactored mappings for user identifiers and nullifiers for improved clarity and functionality.
- Enhanced error handling and updated function parameters for consistency.
- Implemented new validation and update methods for nullifiers, streamlining the registration process.
- Removed deprecated verifySelfProof function and integrated logic into new methods.

* Add events and refactor SelfVerificationRoot and related contracts

- Introduced new events in SelfVerificationRoot for verification configuration updates, scope changes, and attestation ID management.
- Updated Airdrop contract to remove deprecated events and added a new event for Merkle root updates.
- Refactored SelfPassportERC721 to inherit from SelfVerificationConsumer, enhancing verification logic and event handling.
- Improved function parameters for consistency and clarity across contracts.

* Refactor contracts to use SelfVerificationRoot and enhance verification logic

- Removed SelfVerificationConsumer contract and updated related contracts to inherit from SelfVerificationRoot.
- Refactored mappings and event emissions in Airdrop, HappyBirthday, and SelfPassportERC721 for improved clarity and functionality.
- Enhanced verification success hooks to include user identifiers and nullifiers for better tracking.
- Updated constructor parameters for consistency across contracts and improved error handling for user registration and claims.

* Refactor constructor in SelfPassportERC721 for improved readability

* Refactor function parameters in SelfVerificationRoot and related contracts

* Refactor constructor parameter names in IdentityVerificationHub, Airdrop, IdentityRegistry, and ProxyRoot contracts for improved clarity and consistency

* fix getCircuitName function (#575)

* fix getCircuitName function

* fix getCircuitName function

* feat: Read ID cards (#571)

* Update GitHub checkout action from v3 to v4 (#544)

* Bump build version 2.5.2 to test react native keychain (#572)

* bump build and version

* bump version 2.5.2

* don't downgrade react native keychain

* update app/README.md toolchain instructions (#140)

* bump build (#580)

---------

Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: turboblitz <[email protected]>
Co-authored-by: motemotech <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: James Niken <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: leopardracer <[email protected]>
Co-authored-by: Olof Andersson <[email protected]>

* feat(wip): register circuit for aadhaar

* chore: add anon aadhar circuits

* chore: remove sc and disclose selfrica test

* feat: extract aadhaar qr data

* test: aadhaar qr data extract circuit

* test: aadhaar register  circuit

* feat: extract pincode and ph no last 4 digit

* fix: register aadhaar nullifier and commitment

* test: Verify commitment circuit of aadhaar

* feat: add photoHash inside commitment

* feat: build Aadhaar OFAC SMT

* feat: ofac check and reveal data (test done)

* test: qr extractor for custom data input

* feat: add state as reveal data inside VC and disclose

* chore: add comments

* fix: num2Ceil component

* chore: review changes

* chore: use passport SignatureVerifier

* fix: signatureVerifier inputs

* feat: extract ascii values of fields

* feat: provide users the flexibility to reveal specific characters of a field

* chore: refactor

* test: register aadhaar for tampered data

* test(wip): should return 0 if in ofac list

* test: ofac check

* test: register aadhaar circuit for different qr data

* merge dev into main (#683)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* #652 (comment)

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

* refactor deployment scripts (#678)

* feat: add register eu id instances (#682)

* feat: add register eu id instances

* feat: add new instances

* chore: update scripts

* chore: fix sig alg

* chore: rm circuits

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>

* fix: commitment hash

* fix: register aadhaar test

* chore: refactor

* feat: reveal data in packed bytes

* feat: add constrain on delimiterIndices

* feat: reveal timestamp

* merge main to feat/aadhaar

* fix: tests

* feat: hash pubKey

* feat: add registry contract

* feat: Update HubImplV2 (WIP)

* add functions to generate aadhaar data (WIP)

* modularize aadhaar data generation (WIP)

* fix(wip): register test

* fix: test qr extractor

* fix

* chore: refactor functions

* feat: add age extractor and tested

* feat: add isMiniumAge check

* fix: prepareAadhaarTestData func

* registry contract tests

* feat: registry contract tests

* feat: extract fields from qr data bytes

* chore: refactor mockData

* feat: move minimum age to revealPackedData

* feat: create a constant.ts to retrive fields from unpacked bytes

* chore: refactor

* fix: exports

* rebase

* rebase

* feat: add public signal ,indices mapping

* chore: add public output to indices mapping

* fix:AADHAAR_PUBLIC_SIGNAL_INDICES

* feat: make nullifier public

* fix: nullifier cal for disclose circuits

* feat: merge isMiniumAgeValid and miniumAge signal

* fix: disclsoe test

* feat: support for user identifier and secret

* chore :refactor

* feat: ofac test last name , firstname

* feat: add forbidden_countries_list check

* feat: add tests for aadhaar (WIP)

* failing ofac tests

* feat: finish contract tests

* fix: merge conflicts

* update the common package to be usable in circuits and contracts

* lint everything

* coderabbit fixes

* chore: update name dob,yob aadhaar ofac tree

* feat: merge ofac and reverse ofac check into one

* test: merged ofac constrain

* SELF-253 feat: add user email feedback (#889)

* feat: add sentry feedback

* add sentry feedback to web

* feat: add custom feedback modal & fix freeze on IOS

* yarn nice

* update lock

* feat: show feedback widget on NFC scan issues (#948)

* feat: show feedback widget on NFC scan issues

* fix ref

* clean up

* fix report issue screen

* abstract send user feedback email logic

* fixes

* change text to Report Issue

* sanitize email and track event messge

* remove unnecessary sanitization

* add sanitize error message tests

* fix tests

* save wip. almost done

* fix screen test

* fix screen test

* remove non working test

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>

* chore: centralize license header checks (#952)

* chore: centralize license header scripts

* chore: run license header checks from root

* add header to other files

* add header to bundle

* add migration script and update check license headers

* convert license to mobile sdk

* migrate license headers

* remove headers from common; convert remaining

* fix headers

* add license header checks

* update unsupported passport screen (#953)

* update unsupported passport screen

* yarn nice

* feat: support new ofac trees

* fix: qr extractor tests

* chore: remove unassigned age signal

* chore: modify timestamp func comment

* fix: add constrain on photo bytes delimiter

* fix: add range check on minimumAge within 2^7

* fix: range check for country not in list

* chore: remove dummy constrain

* fix: assert lessthan

* fix: check is photoEOI valid

* fix: replace maxDataLength with qrPaddedLength for valid del indices

* feat: update forbidden countries in disclose and disclose id

* feat: convert name to uppercase

* fix: add constrain between delimiter and photoEOI

* feat: support for phno len 4 and 10

* chore: hard-code attestaion_ID to 3

* feat: calculate nullifier using uppercase name

* feat: add real id support

* fix: rebase error

* chore: refactor

* add new nullifier and commitment calc

* fix: reuse uppercase name from verify commitment

* feat: add a function that will iterate though all pubkeys

* chore: skip real id test

* chore: yarn format

* chore: update yarn.lock

* chore: rm trailing / from import

* chore: add support for issuing state

* chore: linting and types

* chore: rm types script from circuits

* chore: add license header

---------

Co-authored-by: nicoshark <[email protected]>
Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: turboblitz <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: James Niken <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: leopardracer <[email protected]>
Co-authored-by: Olof Andersson <[email protected]>
Co-authored-by: vishal <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>
remicolin added a commit that referenced this pull request Sep 22, 2025
* SDK Go version (#920)

* feat: helper functions and constant for go-sdk

* feat: formatRevealedDataPacked in go

* chore: refactor

* feat: define struct for selfBackendVerifier

* feat: verify function for selfBackendVerifier

* feat(wip): custom hasher

* feat: SelfVerifierBacked in go

* test(wip): scope and userContextHash is failing

* test: zk proof verified

* fix: MockConfigStore getactionId function

* chore: refactor

* chore: remove abi duplicate files

* chore: move configStore to utils

* chore: modified VcAndDiscloseProof struct

* chore: more review changes

* feat: impl DefaultConfig and InMemoryConfigStore

* chore: refactor and export functions

* fix: module import and README

* chore: remove example folder

* chore: remove pointers from VerificationConfig

* chore: coderabbit review fixes

* chore: more coderabbit review fix

* chore: add license

* fix: convert attestationIdd to int

* chore: remove duplicate code

---------

Co-authored-by: ayman <[email protected]>

* Moving proving Utils to common (#935)

* remove react dom

* moves proving utils to the common

* need to use rn components

* fix imports

* add proving-utils and dedeuplicate entry configs for esm and cjs.

* must wrap in text component

* fix metro bundling

* fix mock import

* fix builds and tests

* please save me

* solution?

* fix test

* Move proving inputs to the common package (#937)

* create ofactTree type to share

* move proving inputs from app to register inputs in common

* missed reexport

* ok

* add some validations as suggested by our ai overlords

* Fix mock passport flow (#942)

* fix dev screens

* add hint

* rename

* fix path

* fix mobile-ci path

* fix: extractMRZ (#938)

* fix: extractMRZ

* yarn nice && yarn types

* fix test: remove unused

* fix mobile ci

* add script

---------

Co-authored-by: Justin Hernandez <[email protected]>

* Move Proving attest and cose (#950)

* moved attest and cose utils to common

with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common

what does cryptoLoader do?

* moved away

* get buff

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* SELF-253 feat: add user email feedback (#889)

* feat: add sentry feedback

* add sentry feedback to web

* feat: add custom feedback modal & fix freeze on IOS

* yarn nice

* update lock

* feat: show feedback widget on NFC scan issues (#948)

* feat: show feedback widget on NFC scan issues

* fix ref

* clean up

* fix report issue screen

* abstract send user feedback email logic

* fixes

* change text to Report Issue

* sanitize email and track event messge

* remove unnecessary sanitization

* add sanitize error message tests

* fix tests

* save wip. almost done

* fix screen test

* fix screen test

* remove non working test

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>

* chore: centralize license header checks (#952)

* chore: centralize license header scripts

* chore: run license header checks from root

* add header to other files

* add header to bundle

* add migration script and update check license headers

* convert license to mobile sdk

* migrate license headers

* remove headers from common; convert remaining

* fix headers

* add license header checks

* update unsupported passport screen (#953)

* update unsupported passport screen

* yarn nice

* Migrate Analytics  (#951)

* setup analytics adapter for self mobile sdk client and use in app

* wrap for context

* fix build

* yarn types is an alias for build when build just compiles ts

* ok unlock

* deeper

* ok this looks to work

* fix license check

* make sure it starts with this line

* someone didnt commit

* fix double analytics bug and builds

* lint

* Read document catalog from selfClient (#936)

* [SELF-676] feat: upgrade React Native from 0.75.4 to 0.76.9 (#943)

* chore: upgrade build tooling to Node 22 and AGP 8.6

* chore: upgrade react-native to 0.76.9

* update lock files and formatting

* fix path

* fix: handle hermes-engine cache mismatch in CI after React Native upgrade

- Add fallback logic to run 'pod update hermes-engine' when pod install fails
- This resolves CocoaPods cache issues that occur after React Native version upgrades
- Fixes CI pipeline failures on codex/update-core-tooling-for-react-native-upgrade branch

* fix: improve hermes-engine cache handling in CI

- Preemptively clear CocoaPods cache before pod install
- This prevents dependency analysis failures that occur when cached podspecs conflict
- Addresses the root cause: cache conflicts during 'Analyzing dependencies' phase
- Keeps fallback logic for additional safety

* fix: handle hermes-engine cache in mobile-bundle-analysis workflow

- Add pod-install-with-cache-fix.sh script to handle hermes-engine cache conflicts
- Update install-app:setup script to use the new cache fix approach
- This fixes the mobile-bundle-analysis.yml workflow failures after React Native upgrade
- Proactively clears CocoaPods cache and has fallback for hermes-engine updates

* formatting

* fix: robust hermes-engine cache handling in CI workflows

- Apply comprehensive cache clearing to mobile-ci.yml and mobile-e2e.yml
- Pre-emptively run 'pod update hermes-engine' before pod install
- Clear multiple cache locations to handle CI environment differences
- This prevents 'hermes-engine differs from Pods/Local Podspecs' errors
- Fixes all workflows affected by React Native 0.76.9 upgrade cache issues

* fixes

* clean up

* update lock files

* fix tests

* sort

* fixes

* fix ci

* fix deployment target

* android fixes

* upgrade fix

* fixes

* fix: streamline mobile CI build and caching (#946)

* fix: streamline mobile CI build and caching

* Enable mobile E2E tests on codex/fix-mobile-ci-workflow-errors branch

* test

* simplify and fix path

* workflow fixes

* fix loading on 0.76.9

* clean up unnecessary comments

* fix readme

* finalize upgrade to 0.76.9

* fix android build and upgrade

* fix bundler caching

* download cli to fix "yarn start" issues

* fix cli build erorr

* fix script path

* better path

* abstract build step to prevent race condition

* fixes

* better cache

* fix corepack build error

* update lock

* update lock

* add yarn cache to workflows

* fix test building

* ci caching improvements

* fix common type check

* fix common ci

* better mobile sdk alpha building logic

* chore: speed up mobile e2e workflow (#962)

* chore: speed up mobile e2e workflow

* chore: disable android e2e job

* chore: speed up ios build

* fix: bundle js for ios debug build

* fix e2e

* fix mobile ci (#964)

* feat: improve mixpanel flush strategy (#960)

* feat: improve mixpanel flush strategy

* fixes

* fix build

* update lock

* refactor methods

* conslidate calls

* update package and lock

* refactor: remove namespace imports (#969)

* refactor: remove namespace imports

* refactor: use named fs imports

* refactor(app): replace path and fs namespace imports

* format

* format

* Mixpanel tweaks (#971)

* udpates

* fox

* update license

* Add DSC parsing check (#836)

* Handle missing dsc parsed

* nice

* fix test

* throw

* fix

* chore(app): upgrade dependencies (#968)

* chore(app): upgrade dependencies

* update package

* update lock files

* fixes

* lock

* fix

* Auth Adapter +  (#958)

* basic auth adapater

* remove SelfMobileSDk, this was another architecture which the adapter patern replaced

* rename to avoid confusion with client.test.ts

* basic auth adapater

* remove SelfMobileSDk, this was another architecture which the adapter patern replaced

* rename to avoid confusion with client.test.ts

* self

* fix

* remove prototypes

* make sure its mounted

* fix tests

* fmt

* require required adapters

* fix types

* not a partial

* adds missing exports

* fix missing data

* Fix nfc configuration scanning issue (#978)

* fix nfc scanning on ios and android

* save test

* fix tests

* fix lint

* Chore fix ios nfc scanning and compiling (#979)

* fixes

* silence error

* fix debugge

* fix nfc scanning

* lint and pipeline fixes

* large runner (#980)

* chore: update to macos latest large runner (#981)

* bump up to macos-latest-large

* fix ci

* Move loadSelectedDocument to SDK (#967)



Co-authored-by: Aaron DeRuvo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* docs: update mobile SDK migration progress (#982)

* docs: record app integration progress

* docs: consolidate mobile SDK migration tracking

* docs: humanize migration tracking and merge prompts

* docs: add common consolidation tasks

* docs: reprioritize migration tasks

* docs: soften migration plan tone

* docs: detail agent prompts with file paths

* docs: catalog Linear tasks for SDK

* updates

* remove artifact management

* moves validateDocument functions into the common package. (#977)

* moves validateDocument functions into the common package.

* fix build issues and lint

* handle bad connections better in nullifiier

* add an abort controler to nullifer fetcher,  ignore fals positives

* import types separately

* take it as an arg

* chore: update yarn.lock

* chore(app): resolve lint warnings (#990)

* chore(app): resolve lint warnings

* update lock

* clean up any types

* fix types

* feedback from cr

* [SELF-703] feat: Migrate mock generator to mobile sdk (#992)

* feat: expose mock generator

* formatting

* fix tests and lint

* rename passport to document

* fix types

* [SELF-698] scaffold mobile sdk demo app (#993)

* chore: scaffold mobile sdk demo app

* test: cover demo app menu

* prettier and types

* sort

* add android app foundation

* fix android loading

* get ios app running

* update script

* cr feedback

* disable fabric

* fixes

* fixes

* fix

* SELF-702: Refactor navigation structure and dev utilities (#994)

* Refactor navigation and dev screens

* refactor: rename passport screens to document

* fixes

* add missing header

* fixes

* type files

* feat: clarify proof verification analytics (#996)

* feat: increase sha256 byte size and add new rsa circuits (#986)

* feat: increase sha256 byte size and add new rsa circuits

* feat: modularise the rsa fp pow mod

* chore: comment signature verifier for testing

* fix: sha256_sha256_sha224_ecdsa_secp224r1

* lint

* chore: implement google play suggestions (#997)

* google play suggestions

* update gitguardian ignore

* remove unused

* chore: address yarn lock issues (#1004)

* address yarn lock issues

* fix postinstall

* skip postinstall for ci (#1005)

* [SELF-654] feat: add native modules (#919)

* feat: add ios native modules

* fix: extractMRZ

* Add android OCR native module

* wire native mrz module with adapter

* wire Native modules and fix tests

* fixes

* fix license header logic

* fix tests

* fix types

* fix: ci test

* fix: android build ci

* fix: ios build CI

* add podfile.lock

* add yarn.lock

* update lock files

* add yarn.lock

* add license

* order methods

* update lock

* pipeline fixes

* prettier

* update lock file

* fix native modules on external apps

* bundle @selfxyz/common into mobile-sdk-alpha

* chore: address yarn lock issues (#1004)

* address yarn lock issues

* fix postinstall

* update lock

* fix build issues

* fix pipeline issue

* fix ci

* fix bad merge

* fix android ci

* fix ci errors

* fix mobile sdk ci. stop gap fix for now until we create a package

* tweaks

* retry aapt2 approach

* use ^0.8.4 instead of ^0.8.0 due to the use of custom errors

* workflow fixes

* fix file

* update

* fix ci

* test ci fix

* fix test

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>

* chore: update dev with staging 09/06/25 (#1007)

* update CI

* bump iOS version

* update readme

* update mobile-deploy ci

* bump version iOS

* update workflow to use workload identity federation (#933)

* update workflow to use workload identity federation

* add token permissions

* correct provider name

* chore: incrementing android build version for version 2.6.4 [github action]

---------

Co-authored-by: Self GitHub Actions <[email protected]>

* update ci

* update ci

* update ci

* update ci

* update ci

* fix ci

* fix ci

* fix ci

* remove fastlane use for android

* bump iOS build version

* update CI python script

* iterate on CI

* iterate on CI

* iterate on CI

* Dev (#941)

* SDK Go version (#920)

* feat: helper functions and constant for go-sdk

* feat: formatRevealedDataPacked in go

* chore: refactor

* feat: define struct for selfBackendVerifier

* feat: verify function for selfBackendVerifier

* feat(wip): custom hasher

* feat: SelfVerifierBacked in go

* test(wip): scope and userContextHash is failing

* test: zk proof verified

* fix: MockConfigStore getactionId function

* chore: refactor

* chore: remove abi duplicate files

* chore: move configStore to utils

* chore: modified VcAndDiscloseProof struct

* chore: more review changes

* feat: impl DefaultConfig and InMemoryConfigStore

* chore: refactor and export functions

* fix: module import and README

* chore: remove example folder

* chore: remove pointers from VerificationConfig

* chore: coderabbit review fixes

* chore: more coderabbit review fix

* chore: add license

* fix: convert attestationIdd to int

* chore: remove duplicate code

---------

Co-authored-by: ayman <[email protected]>

* Moving proving Utils to common (#935)

* remove react dom

* moves proving utils to the common

* need to use rn components

* fix imports

* add proving-utils and dedeuplicate entry configs for esm and cjs.

* must wrap in text component

* fix metro bundling

* fix mock import

* fix builds and tests

* please save me

* solution?

* fix test

* Move proving inputs to the common package (#937)

* create ofactTree type to share

* move proving inputs from app to register inputs in common

* missed reexport

* ok

* add some validations as suggested by our ai overlords

* Fix mock passport flow (#942)

* fix dev screens

* add hint

* rename

* fix path

* fix mobile-ci path

* fix: extractMRZ (#938)

* fix: extractMRZ

* yarn nice && yarn types

* fix test: remove unused

* fix mobile ci

* add script

---------

Co-authored-by: Justin Hernandez <[email protected]>

* Move Proving attest and cose (#950)

* moved attest and cose utils to common

with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common

what does cryptoLoader do?

* moved away

* get buff

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* SELF-253 feat: add user email feedback (#889)

* feat: add sentry feedback

* add sentry feedback to web

* feat: add custom feedback modal & fix freeze on IOS

* yarn nice

* update lock

* feat: show feedback widget on NFC scan issues (#948)

* feat: show feedback widget on NFC scan issues

* fix ref

* clean up

* fix report issue screen

* abstract send user feedback email logic

* fixes

* change text to Report Issue

* sanitize email and track event messge

* remove unnecessary sanitization

* add sanitize error message tests

* fix tests

* save wip. almost done

* fix screen test

* fix screen test

* remove non working test

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>

* chore: centralize license header checks (#952)

* chore: centralize license header scripts

* chore: run license header checks from root

* add header to other files

* add header to bundle

* add migration script and update check license headers

* convert license to mobile sdk

* migrate license headers

* remove headers from common; convert remaining

* fix headers

* add license header checks

* update unsupported passport screen (#953)

* update unsupported passport screen

* yarn nice

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: ayman <[email protected]>
Co-authored-by: Aaron DeRuvo <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* bump version

* bump yarn.lock

* update ci (#966)

* chore: Manually bump and release v2.6.4 (#961)

* update lock files

* bump and build android

* update build artifacts

* show generate mock document button

* update lock

* fix formatting and update failing e2e test

* revert podfile

* fixes

* fix cold start of the app with deeplink

* update ci

* update ci

* Sync MARKETING_VERSION to iOS project files after version bump

* chore: incrementing android build version for version 2.6.4 [github action] (#976)

Co-authored-by: remicolin <[email protected]>

* chore: add build dependencies step for iOS and Android in mobile deploy workflow

* chore: enhance mobile deploy workflow by adding CMake installation step

* bump android build version

* chore: incrementing android build version for version 2.6.4 [github action] (#985)

Co-authored-by: remicolin <[email protected]>

* chore: configure Metro bundler for production compatibility in mobile deploy workflow

* chore: incrementing android build version for version 2.6.4 [github action] (#987)

Co-authored-by: remicolin <[email protected]>

* Revert "chore: configure Metro bundler for production compatibility in mobile deploy workflow"

This reverts commit 60fc1f2580c2f6ad3105d8b904d969412a18bd2e.

* reduce max old space size in mobile-deploy ci

* fix android french id card (#957)

* fix android french id card

* fix common ci cache

* feat: log apdu (#988)

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* unblock ci

* fix merge

* merge fixes

* fix tests

* make ci happy

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: pputman-clabs <[email protected]>
Co-authored-by: Self GitHub Actions <[email protected]>
Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: ayman <[email protected]>
Co-authored-by: Aaron DeRuvo <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: fix yarn format (#1009)

* fix yarn format

* yarn format

* fix lint

* undo temporary disabling

* pipeline fixes

* revert nvmrc change

* add new home screen (#1019)

* add new home screen

* fix typing issue

* yarn nice

* chore: update the cpp build script (#1021)

* chore: install node (#1022)

* chore: use node v22 (#1023)

* chore: install yarn (#1024)

* chore: yarn cache (#1025)

* chore: sanitise node version (#1026)

* remove lazy loading (#1018)

* remove lazy loading

* fix tests

* formatting

* fix imports and web ci

* fix tests

* fix building

* fix

* debug ci

* fix web ci issue

* fix

* fix

* fix ci

* remove web render test

* coderabbit feedback

* fix ci

* use import

* fix lint

* fix compiling

* update lock

* update lock

* fix: update yarn.lock hash for @selfxyz/mobile-sdk-alpha

Resolves CI error where yarn install --immutable failed due to
outdated package hash. The hash changed from b2afc4 to f9ebb9.

* fix: update yarn.lock hash after mobile-sdk-alpha changes

- Hash changed from c0e6b9 to 0d0f72 due to package modifications
- Cleaned caches and regenerated lockfile to ensure consistency
- This resolves CI cache mismatch where old artifacts had stale hash

* fix: update yarn.lock hash after building mobile-sdk-alpha

- Final hash: 89f5a6 (includes built dist artifacts)
- Built mobile-sdk-alpha to ensure package is in stable state
- This should resolve CI immutable install errors

* fix yarn lock and build

* chore(ci): improve mobile e2e caching (#1010)

* chore(ci): improve mobile e2e caching

* chore(ci): restore deriveddata cache

* chore(ci): remove ios deriveddata cache

* chore(ci): cache ios derived data

* chore(ci): optimize mobile deploy caching

* chore(ci): enable ccache for ios e2e builds

* fix(ci): add ccache path for ios e2e

* moves ofac and protocol store (#1012)

* move ofact tree fetch to common

* move protocol store to the msdk, fix some dependencies on msdk

* chore: remove register id from register circuits (#1028)

* chore: remove register id from register circuits

* chore: only use 128ram instance

* Feat/build cpp (#1029)

* chore: remove register id from register circuits

* chore: only use 128ram instance

* chore: build 2 circuits at a time

* Remove navigationRef from provingMachine (#1011)

* SDK: minimize amount of data sent through PROVING_PASSPORT_NOT_SUPPORTED event (#1030)

* Fix mock passport generation (#1031)

* fix mock passport generation

* fix mobile ci tests

* Feat/aadhaar (#949)

* make contract sdk simpler (#514)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

* Revert "make contract sdk simpler (#514)" (#518)

This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b.

* merge dev into main (#576)

* Feat: Show error code in SDK (#500)

* feat: emit `error_code` and `reason` in app

* feat: add `onError` in sdk

* feat: Display reason in app

* lint & fmt

* feat: add scrollview in ProofRequestStatusScreen for long reasons

* Fix input generation for 521bit curves (#481)

* fix EC point padding for 521 bit curves

* rename modulus to point in findStartIndexEC as it is a point

* simplify matching logic

* simplify padding logic

* remove comment

* remove log

removing .only so the CI/CD runs circuit tests

fix disclosure test

fix scope in test

fix scope error in circuit tests

remove .only

fix test

* run ci/cd

* Feat/simpler contract sdk (#519)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

---------

Co-authored-by: motemotech <[email protected]>

* forgot to include package update (#521)

* Bump version to 2.5.1 (#522)

* bump version

* update fastlane

* fix bump version

* bump build and add todo

* disable commit for now

* [SEL-154] Step 1: Scan your passport (#511)

* simplify navigation logic

* use aesop design hook

* save wip

* add new aesop redesign screens

* save wip design

* refactor nav bar logic

* fix paths

* save wip

* stub progress navbar and save wip

* save wip progress bar animation

* save wip progress bar, almost done with design

* fix progress bar design

* fix bottom padding

* disable git commit for now

* fix flaky android downloads that causes pipeline to crash

* update lock for ci

* [SEL-46] FE: Add minimum bottom padding (#510)

* fix bottom padding for smaller screens

* fix podfile post install hook permissions check

* update pod lock and disable git commit action step for now

* update lock

* fix flaky android downloads that causes pipeline to crash

* fix: improve error handling for forbidden countries list mismatch (#494)

* Update SelfBackendVerifier.ts

* Update constants.ts

* Update formatInputs.ts

* Update formatCallData.ts

* DX: Auto format on save (#526)

* save wip

* use elint instead of prettier to sort imports

* set imports to warn

* sync prettier settigns

* update prettier settings

* save working version

* fix export and disable mobile pipeline for now

* limit auto formatting to the app folder

* remove artefacts

* SEL-187: Make bottom layout scrollable on smaller screens (#525)

* fix design check

* add an option to disable local sending of sentry events

* better sentry enable / disable

* fix scan passport height

* make bottom layout scrollable so it doesn't squish top screen

* simpler logic check. don't create new env var

* fix internet connection issues

* readd comment

* use isConnected instead of internet reachable

* use a dynamic bottom panel height

* add missing recovery screens

* move aesop below

* remove dupe export

* fix rebase

* fix android package download issue

* Feat/extend id support (#517)

* refactor proving impleting xstate, speedup proving

* add disclosure proof support

* keep refactoring provingMachine, clean old implementation

* call init method when switching from dsc to register

* rebase with dev to display why the proof verification failed

* refactor ws connexion between front-end and mobile to retrieve self-app

* update the webclient at proofVerification and use selfAppStore in provingMachine

* fix provintStore.init in ProveScreen

* yarn nice

* fetch data correctly in splash screen

* Bump build versions for 2.5.1 (#531)

* release new builds

* fix app and build versions

* fix env check

* display error animation on failure on loading screen (#532)

* display error animation on failure on loading screen

* remove log

---------

Co-authored-by: Justin Hernandez <[email protected]>

* ci: bump actions/checkout to v4 (#529)

* make contract sdk simpler (#514)

* make contract sdk simpler

* reduce root inputs

* delete convert function

* summarize our library

* update npm package

* update package version

* update attestation id

* add util function to get revealed data

* Revert "make contract sdk simpler (#514)" (#518)

This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b.

* ci: bump actions/checkout to v4

---------

Co-authored-by: nicoshark <[email protected]>
Co-authored-by: turnoffthiscomputer <[email protected]>

* fix italy (#530)

* Fix/proving machine endpoint type (#538)

* store endpoint type in proving machine

* yarn nice

* fix splash screen error (#539)

* New bug fix build for v2.5.1 (#540)

* bump new build for dev fixes

* update lock

* reinstall before running local deploy

* SEL-178: Improve haptic feedback library (#535)

* fix dev settings typing

* add dev screens file

* save haptic feedback progress

* change ordedr

* fix initial route and add haptic feedback screen to dev settings options

* add delete scripts (#542)

* update staging registry address (#545)

* feat: Add Disclose history (#533)

* feat: Add Disclose history

* fix: Duplicate history in list

* fix: Outdated disclosures

* Delete app/ios/Self copy-Info.plist

* allow a scale of up to 1.3 (#546)

* allow a scale of up to 1.3

* update lock files

* clean up unused imports

* fix settings

* add common sdk (#537)

* add common sdk

* remove sdk backend api

* remove registry

* regenerate sha256 rsa dsc each time

* download ski-pem dynamically on staging, refactor initpassportDataParsing

* add state machine for button on prove screen, improve ux on splash screen

* fetch ski-pem in production

* fix linter issues

* fix prove screen button bugs

* update podfile.lock and yarn.lock

* run linter in circuits repo

* bump build

* bump version for sentry debugging

* bump ios to version 118

---------

Co-authored-by: Justin Hernandez <[email protected]>

* better connection check (#548)

* Clean up navigation and setup Jest (#549)

* remove dupe account screens and prefer the term home

* organize screen loading better

* sort keys

* rename screen files wip

* fix deleted directory issues

* rename folders

* fix paths and naming

* save working jest import test

* save base working jest navigation test

* finalize navigation refactor and jest test

* update test name and podfile lock

* remove unused packages

* use the correct version of react test renderer

* bump build (#552)

* Eth dublin (#554)

* add mock id card generator

* add genMockIdDoc in common/sdk exports

* onboard developer id using deeplink, allow custom birthdate on mockpassport

* log more dsc info (#558)

* Push notification (#536)

* add push notification feature

* merge new app impl

* change dsc key

* import

* reverse mock dsc

* worked in the ios

* checked in android

* update url and delete console

* delete small changes

* lint

* add yarn.lock

* fix warning message

* add mock notification service for test code

* fix path for the mock implementation

* add mock deeplink to the test code

* nice notificationServiceMock.js

* delete unused firebase related implementation

* fix wording and UI related to notification service

* hotfix on mockdatascreen

---------

Co-authored-by: turnoffthiscomputer <[email protected]>

* Fix deeplink 2 (#560)

* fix deeplink

* fix deeplink

* yarn nice

* feat: Use vision for MRZ scanning (SEL-47) (#557)

* feat: Use vision for MRZ scanning

* modify label to position the smartphone during the OCR scan

---------

Co-authored-by: turnoffthiscomputer <[email protected]>

* SEL-255: improved loading screen with estimated wait times (#550)

* create new loading screen and rename static to misc

* fix route

* save wip loading screen

* save wip animation

* save static wip design

* continue

* splash

* add a loading screen text helper

* add test for loading screen text

* save wip. almost there

* update haptic logic

* better feedback and add dev scren

* save current work

* update text logic and tests

* load passport metadata in loading screen

* simplify and fix tests

* test for additional exponents

* add new animation

* rename file

* consolidate ui useEffect and fix loading screen layout

* fix current state

* remove mockPassportFlow param

* merge new loading screen and new notification logic

* simplify

* update lock

* use passportMetadata instead of metadata

* save simplification

* update loading text based on pr feedback and tests

* Bump v2.5.1: ios 122; android 60 (#561)

* increment build to 120

* bump builds for 2.5.1. ios 121; android 60

* clean up logic

* upgrade react native firebase for privacy manifests

* update react native keychain to fix could not recover issue (#564)

* fix: update ocr corrections (#563)

* Chore: Polish proof history to prep for release (#566)

* clean up nav and home boundaries, passport data screen insets

* migrate proof history screen out of settings

* minor clean up

* save wip

* add new ibm plex mono font and clean up proof detail screen

* remove test data

* remove extra loading screen text

* remove unnecessary ceil

* Bump v2.5.1; ios 123; android 62 (#565)

* bump to build 61

* bump ios version

* update version

* Feature/add prettier formatter (#568)

* Add Prettier configuration and ignore files for code formatting

- Created .prettierignore to exclude specific directories and files from formatting.
- Added .prettierrc.yml with custom settings for print width and trailing commas.
- Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code.

* Run prettier formatting

* fix nationality using mock passports

* SEL-181 & SEL-252: Update mobile app events (#570)

* improve analytics handling

* add error boundary that flushes segment events before error occurs

* upgrade segment analytics package

* flush analytics when user encounters error screen

* track all click events

* add tracking to loading screen

* better init and click event names

* track cloud backup and modal actions

* use __DEV__ for debugging

* add tracking to account recovery, auth, mock data

* return false instead of throwing

* add more tracking events

* save wip event updating

* abstract analytic event names

* update click events

* clean up

* move reasons comment

* add unsupported passport event

* Feature/enhance self verification root (#569)

* Add SelfVerificationConsumer contract for self-verification logic

- Introduced an abstract contract, SelfVerificationConsumer, that extends SelfVerificationRoot.
- Implemented nullifier tracking, verification success events, and customizable validation and update methods for nullifiers.
- Added error handling for nullifier check failures and hooks for derived contracts to implement custom logic after successful verification.

* Add SelfHappyBirthday contract example using SelfVerificationConsumer

- Introduced SelfHappyBirthday contract that allows users to claim USDC on their birthday.
- Integrated SelfVerificationConsumer for handling verification and nullifier tracking.
- Added functions to set claimable amount and window, along with event emissions for state changes.
- Implemented logic to check if the claim is within the user's birthday window and transfer USDC accordingly.

* Refactor imports in HappyBirthday contract for better organization

- Updated import statements in HappyBirthday.sol to use relative paths for ISelfVerificationRoot, SelfCircuitLibrary, and SelfVerificationConsumer.
- Improved code readability and maintainability by organizing imports more logically.

* Refactor Airdrop contract to use SelfVerificationConsumer for registration logic

- Updated Airdrop contract to inherit from SelfVerificationConsumer instead of SelfVerificationRoot.
- Refactored mappings for user identifiers and nullifiers for improved clarity and functionality.
- Enhanced error handling and updated function parameters for consistency.
- Implemented new validation and update methods for nullifiers, streamlining the registration process.
- Removed deprecated verifySelfProof function and integrated logic into new methods.

* Add events and refactor SelfVerificationRoot and related contracts

- Introduced new events in SelfVerificationRoot for verification configuration updates, scope changes, and attestation ID management.
- Updated Airdrop contract to remove deprecated events and added a new event for Merkle root updates.
- Refactored SelfPassportERC721 to inherit from SelfVerificationConsumer, enhancing verification logic and event handling.
- Improved function parameters for consistency and clarity across contracts.

* Refactor contracts to use SelfVerificationRoot and enhance verification logic

- Removed SelfVerificationConsumer contract and updated related contracts to inherit from SelfVerificationRoot.
- Refactored mappings and event emissions in Airdrop, HappyBirthday, and SelfPassportERC721 for improved clarity and functionality.
- Enhanced verification success hooks to include user identifiers and nullifiers for better tracking.
- Updated constructor parameters for consistency across contracts and improved error handling for user registration and claims.

* Refactor constructor in SelfPassportERC721 for improved readability

* Refactor function parameters in SelfVerificationRoot and related contracts

* Refactor constructor parameter names in IdentityVerificationHub, Airdrop, IdentityRegistry, and ProxyRoot contracts for improved clarity and consistency

* fix getCircuitName function (#575)

* fix getCircuitName function

* fix getCircuitName function

* feat: Read ID cards (#571)

* Update GitHub checkout action from v3 to v4 (#544)

* Bump build version 2.5.2 to test react native keychain (#572)

* bump build and version

* bump version 2.5.2

* don't downgrade react native keychain

* update app/README.md toolchain instructions (#140)

* bump build (#580)

---------

Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: turboblitz <[email protected]>
Co-authored-by: motemotech <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: James Niken <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: leopardracer <[email protected]>
Co-authored-by: Olof Andersson <[email protected]>

* feat(wip): register circuit for aadhaar

* chore: add anon aadhar circuits

* chore: remove sc and disclose selfrica test

* feat: extract aadhaar qr data

* test: aadhaar qr data extract circuit

* test: aadhaar register  circuit

* feat: extract pincode and ph no last 4 digit

* fix: register aadhaar nullifier and commitment

* test: Verify commitment circuit of aadhaar

* feat: add photoHash inside commitment

* feat: build Aadhaar OFAC SMT

* feat: ofac check and reveal data (test done)

* test: qr extractor for custom data input

* feat: add state as reveal data inside VC and disclose

* chore: add comments

* fix: num2Ceil component

* chore: review changes

* chore: use passport SignatureVerifier

* fix: signatureVerifier inputs

* feat: extract ascii values of fields

* feat: provide users the flexibility to reveal specific characters of a field

* chore: refactor

* test: register aadhaar for tampered data

* test(wip): should return 0 if in ofac list

* test: ofac check

* test: register aadhaar circuit for different qr data

* merge dev into main (#683)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

* CAN auth - android (#613)

* add missed files

* add NFCMethodSelectionScreen

* bump android build

---------

Co-authored-by: Justin Hernandez <[email protected]>

* feat: add MRZ correction method to NFCMethodSelectionScreen (#627)

* add npm auth token env (#632)

* bump sdk version (#633)

* publish npm package when merging on dev

* bump common sdk version

* replace yarn publish by npm publish

* update common package version

* Simplify dev mode gesture (#635)

* Simplify developer mode gesture

* Enable dev mode on MockData screen with five taps

* add build smt function to common sdk

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* Bump build: ios 133; android 72 and build fixes (#654)

* update gesture version and bump android build

* bump and fix ios build

* update lock files

* fixes

* fix fotoapparat library source

* Update example contracts to include EUID usage (#656)

* refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic

* refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations

* refactor: remove BASIS_POINTS constant from Airdrop contract

* feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721

* fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook

* cherry pick commit from add-test-self-verification...

* block non-dev pr to main branch

* audit fixes (#645)

* merge dev branch into main (#624)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>

* update contracts (#628)

* remove sdk/tests (#622)

* remove sdk/tests

* chore: update yarn.lock

---------

Co-authored-by: Ayman <[email protected]>

* fix: add range check on paddedInLength of shaBytesDynamic (#623)

* fix ci (#626)

* implement self uups upgradeable (#592)

* implement self uups upgradeable

* small changes in identityVerificationHubImplV2

* delete aderyn.toml

* chore: add custom verifier

* chnage return output

* feat: use self structs and a Generic output struct

* feat: add userIdentifier, nullifier, forbiddencountries to returned output

* add root view functions from registry

* fix: build and compilation errors

* add userDefined data into selfVerificationRoot

* "resolve conflicts"

* fix compilation problem

* fix how to register verification config

* test: CustomVerifier

* fix verification root and hub integration

* add scope check in hub impl

* replace poseidon hash to ripemd+sha256

* add todo list

* feat: refactor and add test cases for generic formatter

* add performUserIdentifierCheck in basicVerification

* change how to handle additionalData and fix stack too deep

* start adding test codes

* fix dependency problems in monorepo

* fix: forbidden countries (#612)

LGTM!

* able to run test code

* pass happy path

* delete unused codes

* change error code name, add caller address validation and add scripts to run test and build in monorepo

* add all test cases in vcAndDisclose flow

* remove comment out

* chore: use actual user identifier outputs

* success in registration tests

* cover all cases

* pass contractVersion instead of circuitVersion

* fix disclose test

* chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter

* change val name and remove unused lines

* add val name change

* remove userIdentifier from return data

* feat: use GenericDiscloseOutput struct in verfication hook  fix test cases for user identifier

* chore: change the function order for Hub Impl V2 (#625)

* fix nat specs

* add nat spec in SelfStructs

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* prettier (#629)

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>

* fix: vc_and_disclose_id test (#640)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* fix: check if a config id exists

* chore: change the function where the config not set verification is happening

* fix: add await

* feat: add getConfigId function in SelfVerificationRoot (#650)

* feat: add getConfigId function in SelfVerificationRoot

* update comment

---------

Co-authored-by: motemotech <[email protected]>

* chore: fix ofac end index in eu id cards

* chore: fix tests

* fix: example contracts and tests

---------

Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>

* Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658)

* publish npm-package (#651)

* App/eu id updates (#638)

* fix build issues

* generate disclosure proof with euids

* generate disclosure proof with euids

* Eu id updates 2 (#648)

* update vc_and_disclose_id test (dev branch) (#641)

* fix: vc_and_disclose_id test

* chore: yarn prettier

* Show modal on NFC scan error (#642)

* Add help button and error modal actions

* fix the screen management

* yarn nice

* Bump build v2.5.4: ios 132; android 71 (#631)

* bump version and build numbers

* remove tamagui/toast

* fix marketing version

* fix: update TD1 and TD3 checks (#643)

* bum yarn.lock

* add version and user defined data

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>

* remove the mock user define data

* get the useridentifier as a hash from the user defined data

* chore: add version and userDefinedData

* feat: use the version in register / dsc proofs as well

* update calculateUserIdentifierHash

* yarn nice

* refactor: consolidate user context data handling and update payload structure

* fix typing issues on sha1

* remove console.log(sha1)

* fix sha1 import

* refactor: streamline userDefinedData handling and adjust payload type for circuit

* refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash

* yarn nice

* yarn lint common

* use ts-ignore for sha1 import

* fix app ci tests

* fix typing issue

* remove unused ts-ignore

* cast uuid before calling generateinputs

* bump qrcode version

* add tsup on the qrcode sdk

* fix: exports on selfxyz/qrcode

* update how we define config.version

* fix yarn imports

* yarn format

---------

Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Ayman <[email protected]>

* Hotfix contract compile error (#660)

* Fix previous rebase error

* Refactor deployment module for Identity Verification Hub V2.

* Fix/sdk (#652)

* fix: sdk build configs

* chore: SelfBackendVerifier (WIP)

* feat: add custom verification

* feat: consider destination chain in user defined data

* chore: export attestation id

* chore: export attestation id

* chore: export config storage

* chore: don't throw an error if the proof is not valid

* chore: trim abi and rm typechain types

* refactor

* chore: rm unnecessary exports

* 📝 Add docstrings to `fix/sdk` (#653)

Docstrings generation was requested by @remicolin.

* https://github.com/selfxyz/self/pull/652#issuecomment-2992046545

The following files were modified:

* `sdk/core/src/utils/hash.ts`
* `sdk/core/src/utils/proof.ts`
* `sdk/core/src/utils/utils.ts`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* chore: fix package.json cjs types

* chore: add minor changes to checks

* feat: add InMemoryConfigStore, allIds constant and verificationResult type

* chore: export Verification config

* feat: change the verification config types

* fix: throw issues early if verification config is null

* fix: update yarn.lock file

* chore: lint

* fix: rm ts expect error directive

* fix: contract tests

* use excluded countries instead forbidden countries list

* chore: change types in constnats

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update npm-publish workflow and bump core package version to 1.0.0 (#661)

* update import

* Update get verification config visibility (#664)

* Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands.

* Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment.

* Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access.

* Apply BUSL v1.1 license headers to app (#665)

* Add BSL license headers to app sources

* prettier

* fix license reference - https://spdx.org/licenses/BUSL-1.1.html

* bump build: android 73 (#659)

* Contracts/deploy staging (#668)

* update scripts

* deploy vc and disclose id

* fix the deployment scripts on staging

* update yarn.lock

* bump ios build and version (#669)

* configure coderabbitai (#670)

* tweak coderabbit

* bump

* more thorough test spec

* Apply BSL to app codebase (#639)

* Clean up root license wording

* Simplify SPDX header

* simplify license and rename BSL to BUSL

* fix merge issues

* fix missing method

---------

Co-authored-by: Justin Hernandez <[email protected]>

* SEL-423 apply xcode build suggestions (#671)

* apply recommended app settings from xcode

* stick to portrait orientation and update target settings

* remove app clip references

* Circuit audit fixes  (#644)

* feat: add range checks before use of LessEqThan and SelectSubArray

* fix: Num2Bits_strict to constrain virtualKey

* bump core version

* bump core version and fix ci

* chore: use npm_auth_token in yarnrc

* chroe: rm yarnrc changes

* chore: update npm publish

* chore: run npm publish manually

* chore: change hub contract address (#675)

* Update npm-publish.yml

* chore: use proper secret when publishing

* feat: enable publishing if workflow was triggered manually

* Contracts/update verifier (#673)

* update hardhat config

* update vc and disclose verifier

* update vc and disclose verifier script and run it

* update test self verification root

* update verifier

* bump sdk version and use new hub address

* chore: update zk-kit binary merkle root dep (#674)

* refactor deployment scripts (#678)

* feat: add register eu id instances (#682)

* feat: add register eu id instances

* feat: add new instances

* chore: update scripts

* chore: fix sig alg

* chore: rm circuits

---------

Co-authored-by: Ayman <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: nicoshark <[email protected]>
Co-authored-by: Nesopie <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>

* fix: commitment hash

* fix: register aadhaar test

* chore: refactor

* feat: reveal data in packed bytes

* feat: add constrain on delimiterIndices

* feat: reveal timestamp

* merge main to feat/aadhaar

* fix: tests

* feat: hash pubKey

* feat: add registry contract

* feat: Update HubImplV2 (WIP)

* add functions to generate aadhaar data (WIP)

* modularize aadhaar data generation (WIP)

* fix(wip): register test

* fix: test qr extractor

* fix

* chore: refactor functions

* feat: add age extractor and tested

* feat: add isMiniumAge check

* fix: prepareAadhaarTestData func

* registry contract tests

* feat: registry contract tests

* feat: extract fields from qr data bytes

* chore: refactor mockData

* feat: move minimum age to revealPackedData

* feat: create a constant.ts to retrive fields from unpacked bytes

* chore: refactor

* fix: exports

* rebase

* rebase

* feat: add public signal ,indices mapping

* chore: add public output to indices mapping

* fix:AADHAAR_PUBLIC_SIGNAL_INDICES

* feat: make nullifier public

* fix: nullifier cal for disclose circuits

* feat: merge isMiniumAgeValid and miniumAge signal

* fix: disclsoe test

* feat: support for user identifier and secret

* chore :refactor

* feat: ofac test last name , firstname

* feat: add forbidden_countries_list check

* feat: add tests for aadhaar (WIP)

* failing ofac tests

* feat: finish contract tests

* fix: merge conflicts

* update the common package to be usable in circuits and contracts

* lint everything

* coderabbit fixes

* chore: update name dob,yob aadhaar ofac tree

* feat: merge ofac and reverse ofac check into one

* test: merged ofac constrain

* SELF-253 feat: add user email feedback (#889)

* feat: add sentry feedback

* add sentry feedback to web

* feat: add custom feedback modal & fix freeze on IOS

* yarn nice

* update lock

* feat: show feedback widget on NFC scan issues (#948)

* feat: show feedback widget on NFC scan issues

* fix ref

* clean up

* fix report issue screen

* abstract send user feedback email logic

* fixes

* change text to Report Issue

* sanitize email and track event messge

* remove unnecessary sanitization

* add sanitize error message tests

* fix tests

* save wip. almost done

* fix screen test

* fix screen test

* remove non working test

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>

* chore: centralize license header checks (#952)

* chore: centralize license header scripts

* chore: run license header checks from root

* add header to other files

* add header to bundle

* add migration script and update check license headers

* convert license to mobile sdk

* migrate license headers

* remove headers from common; convert remaining

* fix headers

* add license header checks

* update unsupported passport screen (#953)

* update unsupported passport screen

* yarn nice

* feat: support new ofac trees

* fix: qr extractor tests

* chore: remove unassigned age signal

* chore: modify timestamp func comment

* fix: add constrain on photo bytes delimiter

* fix: add range check on minimumAge within 2^7

* fix: range check for country not in list

* chore: remove dummy constrain

* fix: assert lessthan

* fix: check is photoEOI valid

* fix: replace maxDataLength with qrPaddedLength for valid del indices

* feat: update forbidden countries in disclose and disclose id

* feat: convert name to uppercase

* fix: add constrain between delimiter and photoEOI

* feat: support for phno len 4 and 10

* chore: hard-code attestaion_ID to 3

* feat: calculate nullifier using uppercase name

* feat: add real id support

* fix: rebase error

* chore: refactor

* add new nullifier and commitment calc

* fix: reuse uppercase name from verify commitment

* feat: add a function that will iterate though all pubkeys

* chore: skip real id test

* chore: yarn format

* chore: update yarn.lock

* chore: rm trailing / from import

* chore: add support for issuing state

* chore: linting and types

* chore: rm types script from circuits

* chore: add license header

---------

Co-authored-by: nicoshark <[email protected]>
Co-authored-by: turnoffthiscomputer <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: turboblitz <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: James Niken <[email protected]>
Co-authored-by: Kevin Lin <[email protected]>
Co-authored-by: leopardracer <[email protected]>
Co-authored-by: Olof Andersson <[email protected]>
Co-authored-by: vishal <[email protected]>
Co-authored-by: Vishalkulkarni45 <[email protected]>
Co-authored-by: kevinsslin <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Eric Nakagawa <[email protected]>

* fix: CLA not supported (#1027)

* fix: CLA not supported

* fix "yarn android" building

* remove unnecessary commands

---------

Co-authored-by: Justin Hernandez <[email protected]>

* chore: bump app version v2.6.5 (#1034)

* update gem lock

* bump build and version

* fix app versions

* chore: fix nfc passport reader private repo access (#1042)

* add internal repo pat

* update nfc passport reader location

* update workflows to use PAT to access NFC Passport Reader

* fix ci

* update logic to access private repo

* build(android): support 16KB page size (#1043)

* build(android): support 16KB page size

* fix 16kb

* update lock

* chore: bump v2.6.5 for release (#1036)

* bump build

* update to ssh clone to fix local build

* update podfile lock

* fix version

* Feat/build aadhaar (#1044)

* feat: build aadhaar circuits as well in the ci

* feat: add register aadhaar case handling

* fix aadhaar register output after building the cpp circuit (#1045)

* fix: metro js crypto module build issues (#1047)

* fix sdk build issues

* fix build error

* sort and fix dependencies

* add constants-browserify

* feat: add new verifiers (#1049)

* feat: add new verifiers

* format: contracts

* fix: ofac check to aadhaar (#1050)

* fix: hub-v2 (#1051)

* Add DisclosureVerified event for comprehensive verification tracking (#945)

* Add VerificationPerformed event to track verification calls

- Added VerificationPerformed event with comprehensive tracking fields
- Captures requestor contract, version, attestation ID, chain ID, config ID, user identifier, output, and user data
- Enhanced _executeVerificationFlow to return additional tracking data
- Event emission placed after verification completion for accurate tracking

* chore: run formatter

* chore: rename verify event name to DisclosureVerified

* move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041)

* Move self app store to mobile sdk (#1040)

* chore(mobile-sdk-alpha): remove unused tslib dependency (#1053)

* remove tslib -- seems unused

* remove deps accidentally added to root

* build file

* remove unused imports (#1055)

* fix: sha256 signed attr tests (#1058)

* fix mock screen launch (#1059)

* Hotfix: Belgium ID cards (#1061)

* feat: parse belgium TD1 mrz android

* feat: Parse Belgium TD1 MRZ IOS

* fix: OFAC trees not found (#1060)

* fix: relax OFAC tree response validation

* test: cover OFAC tree edge cases

* fix stateless

* revert and fix types

* fix tests

* [SELF-723] feat: add structured NFC and Proof logging (#1048)

* feat: add structured NFC logging

* fix ci

* Fix: add deps

* logging fixes. use breadcrumbs

* fix android build

* update SeverityLevel

* [SELF-705] feat: add proof event logging (#1057)

* feat: add proof event logging

* refactor: unify sentry event logging

* fix types

* fix mock

* simplify

* code rabbit feedback

* fix tests

---------

Co-authored-by: seshanthS <[email protected]>

* skip on dev (#1063)

* don't get fancy just disable (#1064)

* saw it building so gonna try (#1065)

* Dev (#1074)

* chore: bump v2.6.5 rd2 (#1067)

* commit wip version bump

* remove from building

* chore: update tooling dependencies (#1069)

* chore: update tooling dependencies

* chore: align react typings and node types

* update lock

* chore: minor fixes across monorepo (#1068)

* small fixes

* fixes

* fix gesture handler error

* ci fixes

* fix yarn build; add workflow ci (#1075)

* add new workspace ci

* disable package version check for now

* build before checks

* format

* fix in future pr

* feat: add functions for disclosing aadhaar attributes (#1033)

* feat: add functions for disclosing aadhaar attributes

* format

* chore: update monorepo artifacts (#1079)

* remove unneeded artifacts, skip building circuits

* update md files

* cleans up unused parts of sdk interface, adds inline documentation, (#1078)

* cleans up unused parts of sdk interface, adds inline documentation,

* fix up build

* yolo

* Feat/aadhaar sdk (#1082)

* feat: add aadhaar support to the ts sdk

* feat: aadhaar support to go sdk

* chore: refactor

* move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041)

* Move self app store to mobile sdk (#1040)

* chore(mobile-sdk-alpha): remove unused tslib dependency (#1053)

* remove tslib -- seems unused

* remove deps accidentally added to root

* build file

* remove unused imports (#1055)

* fix: sha256 signed attr tests (#1058)

* fix mock screen launch (#1059)

* Hotfix: Belgium ID cards (#1061)

* feat: parse belgium TD1 mrz android

* feat: Parse Belgium TD1 MRZ IOS

* fix: OFAC trees not found (#1060)

* fix: relax OFAC tree response validation

* test: cover OFAC tree edge cases

* fix stateless

* revert and fix types

* fix tests

* [SELF-723] feat: add structured NFC and Proof logging (#1048)

* feat: add structured NFC logging

* fix ci

* Fix: add deps

* logging fixes. use breadcrumbs

* fix android build

* update SeverityLevel

* [SELF-705] feat: add proof event logging (#1057)

* feat: add proof event logging

* refactor: unify sentry event logging

* fix types

* fix mock

* simplify

* code rabbit feedback

* fix tests

---------

Co-authored-by: seshanthS <[email protected]>

* skip on dev (#1063)

* don't get fancy just disable (#1064)

* saw it building so gonna try (#1065)

* chore: bump v2.6.5 rd2 (#1067)

* commit wip version bump

* remove from building

* chore: update tooling dependencies (#1069)

* chore: update tooling dependencies

* chore: align react typings and node types

* update lock

* chore: minor fixes across monorepo (#1068)

* small fixes

* fixes

* fix gesture handler error

* ci fixes

* fix yarn build; add workflow ci (#1075)

* add new workspace ci

* disable package version check for now

* build before checks

* format

* fix in future pr

* feat: add functions for disclosing aadhaar attributes (#1033)

* feat: add functions for disclosing aadhaar attributes

* format

* chore: update monorepo artifacts (#1079)

* remove unneeded artifacts, skip building circuits

* update md files

* chore: update hub contract address

* format

* fix: add aadhaar in AllIds

* chore: bump to v1.1.0-beta

---------

Co-authored-by: vishal <[email protected]>
Co-authored-by: Leszek Stachowski <[email protected]>
Co-authored-by: Aaron DeRuvo <[email protected]>
Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Seshanth.S🐺 <[email protected]>
Co-authored-by: seshanthS <[email protected]>

* feat: change to gcp attestation verification (#959)

* feat: change to gcp attestation verification

* lint

* fix e2e test

* chore: don't check PCR0 mapping if building the app locally

* fmt:fix

---------

Co-authored-by: Justin Hernandez <[email protected]>

* Mobile SDK: move provingMachine from the app (#1052)

* Mobile SDK: move provingMachine from the app

* lint, fixes

* fix web build?

* lint

* fix metro build, add deps

* update lock files

* move the status handlers and proving machine tests

* may it be

* fix up

* yolo

---------

Co-authored-by: Justin Hernandez <[email protected]>
Co-authored-by: Aaron DeRuvo <[email protected]>

* Revert "Mobile SDK: move provingMachine from the app (#1052)" (#1084)

This reverts commit 8983ac22688f731bca8890cbf9be9c85b4ac2bf…
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.

2 participants