npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@openpassport/core

v0.0.24

Published

You can install with this command ``` npm i @openpassport/core ```

Readme

How to use this SDK

Install

You can install with this command

npm i @openpassport/core

Initialize

You should have CELO_RPC_URL and SCOPE in your environment or somewhere in your code.

import { SelfBackendVerifier } from "@openpassport/core";

const selfBackendVerifier = new SelfBackendVerifier(
    process.env.CELO_RPC_URL as string,
    process.env.SCOPE as string,
);

Setup

You can setup which data you want to verify in this sdk

// Set minimum age verification
selfBackendVerifier.setMinimumAge(20);
// Set nationality verification
selfBackendVerifier.setNationality('France')
// Set exclude countries verification
// At most 40
selfBackendVerifier.excludeCountries('Country Name1', 'Country Name2', 'Coutry Name3', 'etc...');
// Enable if you want to do passport number ofac check
// Default false
selfBackendVerifier.enablePassportNoOfacCheck();
// Enable if you want to do name and date of birth ofac check
// Default false
selfBackendVerifier.enableNameAndDobOfacCheck();
// Enable if you want to do name and year of birth ofac check
// Default false
selfBackendVerifier.enableNameAndYobOfacCheck();

Verification

You can do the verification with this

const result = await selfBackendVerifier.verify(
    request.body.proof,
    request.body.publicSignals
);

Result

Result from the verify function is like this

export interface SelfVerificationResult {
    // Check if the whole verification is succeeded
    isValid: boolean;
    isValidDetails: {
        // Verifies that the proof is generated under the expected scope.
        isValidScope: boolean;
        // Checks that the attestation identifier in the proof matches the expected value.
        isValidAttestationId: boolean;
        // Verifies the cryptographic validity of the proof.
        isValidProof: boolean;
        // Ensures that the revealed nationality is correct (when nationality verification is enabled).
        isValidNationality: boolean;
    };
    // User Identifier which is included in the proof
    userId: string;
    // Application name which is showed as scope
    application: string;
    // A cryptographic value used to prevent double registration or reuse of the same proof.
    nullifier: string;
    // Revealed data by users
    credentialSubject: {
        // Merkle root which is used to generate proof.
        merkle_root?: string;
        // Proved identity type, for passport this value is fixed as 1.
        attestation_id?: string;
        // Date when the proof is generated
        current_date?: string;
        // Revealed issuing state in the passport
        issuing_state?: string;
        // Revealed name in the passport 
        name?: string;
        // Revealed passport number in the passport 
        passport_number?: string;
        // Revealed nationality in the passport
        nationality?: string;
        // Revealed date of birth in the passport
        date_of_birth?: string;
        // Revealed gender in the passport
        gender?: string;
        // Revealed expiry date in the passport
        expiry_date?: string;
        // Result of older than
        older_than?: string;
        // Result of passport number ofac check
        passport_no_ofac?: string;
        // Result of name and date of birth ofac check
        name_and_dob_ofac?: string;
        // Result of name and year of birth ofac check
        name_and_yob_ofac?: string;
    };
    proof: {
        // Proof which is used for this verification
        value: {
            proof: Groth16Proof;
            publicSignals: PublicSignals;
        };
    };
}

When you run the tests

First you need to copy the abi files to the sdk/core/src/abi folder.

cd ../sdk/core
yarn run copy-abi

Then you need to run the local hardhat node.

cd contracts
npx hardhat node

Then you need to run the tests in the contract dir.

yarn run test:sdkcore:local