Introducing ChainLocker:
• customizable, non-custodial smart contract escrow •
ChainLocker seeks to optimize intermediary-free conditional digital asset escrow. Users customize and deploy their own “ChainLockers”: non-custodial escrow smart contracts with immutable parameters, including the option to make execution contingent on external data. Each ChainLocker is a unique address, ensuring funds of different counterparties are not commingled and that execution is dictated strictly via code.
The ChainLocker smart contracts are open source[1] and have been audited by Zellic.[2] ChainLockers can lock native gas tokens (an “EthLocker”) or ERC20-compliant tokens (a “TokenLocker”) on EVM chains,[3] with the following other immutable feature options:
- Refundable Deposit: Choose whether any amount of deposited assets is refundable following expiry. Make the total amount non-refundable, partially refundable, or fully refundable to the depositing address at expiry.[4]
- Expiry Time: Set a deadline for the ChainLocker’s execution. If not executed before expiry, the refundability rules apply. Incentivize timely deal execution or, alternatively, combine an expiry time with a lack of refundability to create a ‘timelock’ (or time-delayed transfer).
- Counterparty or Open Offer: Identify a specific counterparty address or create an open offer, permitting any counterparty to transfer funds to the ChainLocker. Parties may update their own address, and the ultimate receiving party (‘seller’) may reject any depositor, enabling such rejected depositor to withdraw their funds.[5]
- “Value Condition” Contingency: Ensure locked funds are only released if a certain value or other objective data condition,[6] such as a minimum or maximum exchange rate or price of an underlying asset, or other exact value, is satisfied at the time of execution.
Users have the option to print an immutable US dollar-value “receipt” for the value of certain assets,[7] which may help recordation and accounting.
Reimagining Escrow
By replacing some roles of escrow agents with smart contracts, value can be received, held, and transferred under a predetermined set of objective conditions without entrusting a third-party intermediary or custodian.[8] Even the simplest adaptation of a ChainLocker — locking funds contingent on the digitally-signed consent of both parties to transfer before some mutually-agreed expiration time — is cheaper, more secure, and more responsive than using a third-party escrow agent who is subject to a fee schedule, human error, account freezes, and local banking hours.
Users may add data contingencies such as exchange rate or price limits to effectively automate the multi-step complex computational processes upon which deal closings are conditioned, while mitigating the deal’s human error vectors and professionals’ billable hours. With immutable refundability rules one can use a ChainLocker to deterministically enforce terminations instead of relying on subjective agent instructions, breakage cost calculations, and legal agreements such as refund letters.
ChainLocker improves on existing EVM smart contract escrow options[9] by introducing the flexibility of user-defined value conditions to execution, using contemporary and optimized solidity, supporting a broad range of ERC20-compliant tokens, and facilitating composability and easy abstraction via a factory contract model.
Use Cases Beyond Escrow
Automated contingent transfers proffer a primary promise of programmable money: deals which execute deterministically rather than probabilistically. The flexibly-designed but immutably-deployed nature of ChainLockers enables numerous middleman-free usecases beyond simple escrow including contingent sales and bounties, open offer marketplaces, parametric insurance payouts, and asset price/exchange rate hedging and incentives.
ChainLockers can be tailored to provide a fully automated and user-friendly dealflow: use ERC4337 and paymasters to pay for deployment and approval bundles in tokens, arrange custom value conditioned execution via bespoke dataFeedProxy contracts, use the address replacement functions to direct transfers to splitting[10] contracts or automated fiat off-ramps.[11] The prevalence of ERC20-compliant tokens further extends the possibilities, enabling ChainLocked tokenized asset and liquidity positions, ERC4626 vaults,[12] ‘streaming’ payment escrow,[13] and more.
ChainLockers can be used on a P2P or B2B basis or as a building block for protocols that leverage non-custodial conditioned transfers. Traditional intermediaries can be disrupted; existing businesses can cut transactional costs while gaining security, predictability, and liquidity; new businesses and markets can be established upon the bedrock of deterministic execution.
Business Model
ChainLocker has no investors to appease, nor licensing fees, nor a token, but will offer consults under a more tradition open-source software business model (including design, implementation, and strategy consults, assistance with integrating and verifying ChainLockers, training, and documentation support) and may seek development grants.[14] While hopefully some of the development and audit costs will be recouped, neither permission nor payment is necessary to deploy and use ChainLocker’s open source code.
The ChainLocker website uses React + wagmi + ethers and is initially tailored towards crypto-wallet-familiar users with trusted third parties to disintermediate. Escrowed payments and conditional transfers are often low-volume and high-value, touching industry sectors which tend to adapt at a glacial pace, so initial adoption is anticipated to be slow. The intention is for later iterations of the website to be substantially more complexity-abstracted (potentially natively offering account abstraction, paymasters, and other service integrations) as well as the ability to run a fully client-side front end package and generally become an open-source avenue of choice for contingent value transfer with intuitive UX, but one step at a time.
There is no ChainLocker token, Discord, nor Telegram channel.
Website: https://chainlocker.org/
Email: contact@chainlocker.xyz
Follow on the app formerly known as Twitter, and peruse the GitHub.
[1] https://github.com/ChainLockerLLC/smart-contracts.
[2] https://github.com/ChainLockerLLC/smart-contracts/blob/main/reports/Zellic%20-%20ChainLocker%20Audit%20Report.pdf.
[3] https://github.com/ChainLockerLLC/smart-contracts/blob/main/deployments/Contract%20Addresses.md.
[4] Pass ‘_refundable’ as ‘false’ to make a ChainLocker non-refundable; otherwise, the refundable amount at expiry will be the ‘deposit’ amount, which can be initialized as any amount up to the ‘totalAmount’.
[5] This ‘rejectDepositor()’ function enables a party to reject a paying counterparty (for noncompliance, breach, or any other reason) without handling the funds. The function updates an ‘amountWithdrawable’ mapping so such rejected counterparty can subsequently reclaim their own funds by calling ‘withdraw()’.
[6] Value conditions are designed to read an int224 value and uint32 timestamp from a data feed proxy contract’s ‘read()’ view function, modeled after API3’s dAPI proxies (see: https://docs.api3.org/guides/dapis/read-a-dapi/). The proxy contract address is an immutable parameter passed at deployment.
[7] ChainLocker’s Receipt.sol contracts are designed to read from API3’s dAPIs, which must be adequately funded (see https://market.api3.org/dapis) and added to the applicable tokenToProxy mapping in Receipt.sol.
[8] For more on data-rich smart escrow contracts, see https://medium.com/api3/redefining-trust-smart-escrow-contracts-975a8ee26703.
[9] For example https://smartescrow.raidguild.org/, https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.1/contracts/utils/escrow/ConditionalEscrow.sol (removed in OpenZeppelin’s Contracts 5.0, https://github.com/OpenZeppelin/openzeppelin-contracts/blob/149e1b79fecb9db32f732c8c9f05ac2d8fa97471/CHANGELOG.md?plain=1#L40).
[10] E.g. https://splits.org/, https://github.com/PopPunkLLC/gaslite-core/blob/main/src/GasliteSplitter.sol.
[11] E.g. https://developers.circle.com/developer/docs/crypto-payouts, https://www.ansiblelabs.xyz/, https://www.utopialabs.com/features/offramps, etc.
[13] https://docs.superfluid.finance/superfluid/developers/super-tokens/super-tokens-solidity#erc20-functions.
[14] See https://chainlocker.org/#/consult. Legal counsel contacts for open source form agreement (https://github.com/ChainLockerLLC/forms) review and adaptations, as well as bespoke agreements and other support, are available upon request.