πCollateral
Assets have to be somewhere
Last updated
Assets have to be somewhere
Last updated
Supporting composability and increasing security requires collateral to be stored in contracts provided by the user. The KeyVault
, Locksmith
, Notary
, and Ledger
provide a permission and asset ledger system that Vaults can leverage for facilitating deposits, storage, and withdrawals.
Each ICollateralProvider
will take two explicit Locksmith infrastructure dependencies:
ILocksmith
. The implementation requires that the vaults can enforce key permissions. The Locksmith interface instance is used to determine if the message senders into the vault are in possession of the required key.
ILedger
. Each vault transaction results in a deposit or a withdrawal on the Ledger. The Ledger will keep track of key balances and total collateral balance, which is verified-or-reverted by the vault in any discrepancy. Internal contract balances are managed to avoid selfdestruct
jamming but contract balance can also in-variant protected.
The ICollateralProvider
interface is very simple, and only supports gaining access to the Ledger reference and the ability to withdrawal an asset amount using a specific key.
There are two default collateral provider implementations that we will cover, along with how assets move between keys in this section.