
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@zk-email/jwt-tx-builder-contracts
Advanced tools
This directory contains verifier contracts for handling JSON Web Tokens(JWTs) proofs.
This directory contains verifier contracts for handling JSON Web Tokens(JWTs) proofs.
JWTRegistry contract is used to store and manage JWTs. It keeps track of all issued tokens and their statuses.JWTVerifier contract is responsible for verifying the authenticity of JWTs. It checks the proof and ensures the token is valid.To build the project, run the following command:
yarn build
To run unit tests, use the following command:
yarn test:unit
To run integration tests, use the following command:
yarn test:integration
To deploy, run the following commands:
foundryup
source .env
forge script script/Deploy_jwtRegistry.s.sol:DeployScript --rpc-url $RPC_URL --broadcast --verify -vvvv --sender $ETH_FROM
Installation: First, install the package using yarn. Run the following command in your project directory:
yarn add @zk-email/jwt-tx-builder-contracts
Integration:
@zk-email/jwt-tx-builder-contracts=../../node_modules/@zk-email/jwt-tx-builder-contracts/src
Solidity: Import the contracts in your Solidity files using the following syntax:
// Import necessary contracts for JWT verification
import {JwtVerifier} from "@zk-email/jwt-tx-builder-contracts/utils/JwtVerifier.sol";
import {JwtGroth16Verifier} from "@zk-email/jwt-tx-builder-contracts/utils/JwtGroth16Verifier.sol";
import {JwtRegistry} from "@zk-email/jwt-tx-builder-contracts/utils/JwtRegistry.sol";
You can use the imported contracts as follows:
IVerifier jwtVerifier;
JwtRegistry jwtRegistry;
// Create jwt registry and set DKIM public key hash
jwtRegistry = new JwtRegistry(deployer);
jwtRegistry.setDKIMPublicKeyHash(
"12345|https://example.com|client-id-12345",
publicKeyHash
);
// Create JwtVerifier and initialize with proxy
{
JwtVerifier verifierImpl = new JwtVerifier();
console.log(
"JwtVerifier implementation deployed at: %s",
address(verifierImpl)
);
JwtGroth16Verifier groth16Verifier = new JwtGroth16Verifier();
ERC1967Proxy verifierProxy = new ERC1967Proxy(
address(verifierImpl),
abi.encodeCall(
verifierImpl.initialize,
(msg.sender, address(groth16Verifier))
)
);
jwtVerifier = IVerifier(address(verifierProxy));
}
Here are some example addresses where the contracts have been deployed on Base Sepolia test network:
0x60Dd906E3D1d827d23Bd393aa3224fb38cac1A110x020FD65080C114AB55Cdeb018db197f3A8751B7F0xD3863Ad6AD48e3dEc3736d335967b4117f64ce49If you encounter a CreateCollision error, it means the salt in your .env file is already used. Try using a different salt value.
Error:
script failed: <empty revert data>
This error indicates a problem with the deployment script. Check your environment variables and try again.
FAQs
This directory contains verifier contracts for handling JSON Web Tokens(JWTs) proofs.
The npm package @zk-email/jwt-tx-builder-contracts receives a total of 6 weekly downloads. As such, @zk-email/jwt-tx-builder-contracts popularity was classified as not popular.
We found that @zk-email/jwt-tx-builder-contracts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.