Token Wrapper

Description

Instead of gating the smart contract of the underlying token, we apply Keyring permissioning on a token wrapper. Keyring's token wrapper acts like a digital shield, permitting asset transfer only if smart contracts can verify compliance on both sides. This solution maximises extensibility as it can be applied to assets and leverage existing market primitives, creating a mirrored compliant version.

How It Works

The wrapper is built with the industry-standard OpenZeppelin's ERC20wrapper. Its sole purpose is to permission the transfer function of the wrapped token based on the rules set by an Admission Policy. A transfer (and its derivation, transferFrom) is only possible if both the sender and the recipient (the "from" and "to") are valid under the chosen Policy i.e. have valid Credentials and are on the WalletChecker Whitelist.

Once a User has successfully verified they comply, they come to Keyring’s frontend (or another interface, or directly on-chain) and wrap their existing $ERC20s into $ERC20.k[PolicyID], protected by the compliance guard corresponding to a given Admission Policy.

Note that permissioning is applied to the transfer function only in this example, so wrapping/unwrapping is always allowed to all users. There could be Rules applied to wrapping/unwrapping (e.g. only a set of given addresses are allowed to touch the unwrapped version).

Another layer of protection for users lies in the fact that wrapped assets can only directly interact with smart contracts that have been whitelisted by the Policy Owner. This further limits hacking risks.

Integration Example

A simple use case example would be a Lending Protocol that wants to set up both permissioned and unpermissioned pools. Users can freely lend $USDC into an unpermissioned pool, or go through onboarding and lend in the KYC’d pool ($USDC.k1).

The Protocol doesn’t have to deploy an alternate version of their platform or change any existing code but can add permissioning simply by adding a new ERC20 token.

Self-Custody

The wrapped underlying $ERC20s are deposited directly into OpenZeppelin's ERC20wrapper contract, which does not have any admin function. Therefore, the solution preserves the self-custody of tokens deposited. Keyring Network never gains control of/access to user funds.

The smart contract ensures that at all times the totalSupplyof the $ERC20s is equal to the totalSupply of the wrapper, very much like what WETH does with ETH.

Last updated