Smart Contracts

Keyring Network's smart contract library is used to operate different parts of the protocol. Contracts are written in Solidity (version 0.8.14) and released under a BUSL license. Standard contracts leverage the OpenZeppelin Library (version 4.6.0).

See the repository here.

Contract Breakdown

TypeContractDescription

access

KeyringAccessControl.sol

Checks for roles

consent

Consent.sol

Manages user consent (grant and revoke) and the related deadlines

credentialUpdater

KeyringZkCredentialUpdater.sol

Checks client-generated zero-knowledge proofs of attestations about admission policy eligibility, enforces the given policy and updates the cache if the request is acceptable

degradable

Degradable.sol

Allows services to specify how to mitigate service interruptions, set policy degradation params and handle degraded services policy enforcement

exemptions

ExemptionsManager.sol

Manages the exemptions (i.e. whitelists) for the policy engine. It allows an admin to manage global exemptions and policy admins to manage policy-specific exemptions, approve exemptions and retrieve existing ones

forwarder

NoImplementation.sol

Placeholder for a paymaster/trusted forwarder left for a future implementation

identityTree

IdentityTree.sol

Holds the history of identity tree merkle roots published by the aggregator and provides methods to retrieve and verify merkle roots

integration

KeyringGuard.sol

Methods to consult Keyring Cache and retrieve authorisation status for a wallet on a given policy (provided at constructor time)

keyringCredentials

KeyringCredentials.sol

Holds the time-limited credential cache (dynamic whitelist), offering methods to update (generate a cache key for a wallet and policyId) and inspect it

keyringZkVerifier

KeyringZkVerifier.sol

Binds the on-chain zero-knowledge verifiers together and applies . Includes a set of functions to inspect identity commitments and confirm correct construction

policyManager

PolicyManager.sol

Holds the policies managed by the protocol admin and exposes methods to create, update and disable a policy and its dependencies (wallet checker, backdoor, attestor)

ruleRegistry

RuleRegistry.sol

Holds the global list of existing Policy rules. Clients can create composite Rules with the Rule Builder, only admins can create Base Rules or mark them as toxic

tokens

KycERC20.sol

Example of KeyringGuard can be wrapped around a standard ERC20 token (e.g. DAI Token) to permission transfers

userPolicies

UserPolicies.sol

Handles user policy and counterparty selection

walletCheck

WalletCheck.sol

On-chain whitelist containing information gathered by off-chain processes. Policies specify if wallets must be checked on a just-in-time basis. This contract establishes the base interface that all wallet check contracts must implement

Deployments

The protocol is currently live on mainnet and deployment on additional chains will follow. Get in touch if you have any requests.

pageCurrent Deployments

Governance

Keyring implements admin-upgradable proxies to manage core protocol updates.

Last updated