Smart Contracts

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

See the repository here.

Keyring is updating to a new contract infrastructure in the near future and recommends integrating via the KeyringCredentialViewer contract at this time. Using this contract will ensure a smooth transition to the new contracts in the near future without any additional changes required in an integrating partners code.

Contract Breakdown

TypeContractDescription

access

KeyringAccessControl.sol

Checks for roles

consent

Consent.sol

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

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

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)

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

keyringZkVerifier

KeyringMerkleAuthZkVerifier.sol

Verifies members and authorization in proofs posted by users

keyringCredentialUpdater

KeyringMerkleAuthZkCredentialUpdater.sol

Receives new credentials from attested users and updates the keyringCredentials cache

merkleAuthVerifier

MerkleAuthVerifier.sol

Internal library contract used to verify Merkle proofs

Deployments

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

Current Deployments

Governance

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

Last updated