- 📃 Read the paper
- Coming later: Interactive demo dApp on public mainnet!
This repository contains the implementation of Liquefaction, a smart-contract based, key-encumbered wallet platform that systematically overturns the assumption that private keys are controlled by individuals or individual entities.
Liquefaction demonstrates the inherent fragility of this assumption and its sweeping repercussions, both destructive and constructive. This platform enables the cryptocurrency credentials and assets of a single end-user address to be freely rented, shared, or pooled, all while maintaining privacy.
Liquefaction uses trusted execution environments (TEEs) to encumber private keys, allowing for rich, multi-user policies to be attached to their use. An encumbered key is not known by a user or administrator. Instead, it is generated by an application (running in a TEE) that enforces an access-control policy over access to signatures made with the key.
Liquefaction enables a wide range of applications:
- Dark DAOs: privately sell or trade DAO votes (which cannot be overridden by the account owner) without making any public DAO token transfers or using public delegation.
- Trading locked tokens: buy or sell locked tokens while keeping the appearance of respecting their vesting schedules.
- Mitigating dusting attacks: prove that you don't own, and never did own, illicit assets that were sent to your account.
- Private DAO treasuries: privately commit funds to a fundraising DAO without transferring any assets on-chain.
- Token-gated ticketing: lend or sell your access to an in-person event or metaverse character to someone who doesn't own the required token.
- Soulbound tokens: sell an account which owns a soulbound token or sell access to signatures proving ownership of such an account.
See the table on page 12 of our paper for more details!
For those who are interested in using Liquefaction on mainnet today, please note the following limitations:
- We do not yet expose encumbrance history to new encumbrance policies, which makes pre-signing attacks trivial to perform (signing messages and holding onto signatures intended to be used after access is lost). Thus, encumbrance policies do not yet have a way to reject encumbered accounts which have previously used an untrusted policy that had broad access. We encourage your support in designing a specification for this feature. We think this can be resolved by having several critical encumbrance policies in use "from birth" of each encumbered account. You can implement this "encumbrance from birth" yourself (a complete mitigation to this issue) by wrapping our Liquefaction wallet with a smart contract access manager which enrolls encumbered accounts as soon as they are created and checking that the accounts you are interacting with originated from this access manager.
- Our Ethereum transaction policy relies on the liveness of a trusted oracle of Ethereum block hashes, i.e. a trusted smart contract which maps block numbers to block hashes. You could implement one as an Ethereum light client on Oasis to minimize trust assumptions, but we have not designed such a feature.
- Smart contract programming on Oasis Sapphire and in Liquefaction is slightly different from that on Ethereum. Specifically, storage access patterns are not hidden by the TEE and therefore might leak how a code path was taken. We have tried to limit information exposure where possible in our smart contracts, but our proof of concept does not take advantage of ORAM techniques or other critical mitigations to access pattern leaks. Also, even view functions often need authorization, and
msg.senderis always authenticated.
Requirements:
- NodeJS
- Docker
- Kurtosis for cross-chain tests (Ethereum inclusion/state proofs)
First, install the dependencies:
npm iRun an Oasis Sapphire dev network:
# For linux/x86_64 based systems
docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic
# For other systems (e.g., ARM-based Macs)
docker run -it -p8545:8545 -p8546:8546 --platform linux/x86_64 ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonicCheck that the contracts compile:
npx hardhat compileCheck that the TypeScript source files compile:
npx tscFor cross-chain test cases, run geth using Kurtosis:
kurtosis run github.com/ethpandaops/ethereum-package --args-file ./devnet/network_params.yaml --image-download always --enclave liquefaction-pub-devnet
# To stop the enclave:
kurtosis enclave stop liquefaction-pub-devnet
# Destroy the enclave:
kurtosis enclave rm liquefaction-pub-devnetRun test cases:
npx hardhat test --network devFormat code with
npx prettier -w .We've released our code under the permissive MIT License. Please ensure you include the copyright notice and permission notice (found in the LICENSE file) in copies or substantial portions of the software.
We use a modified version of Proveth, available under the MIT license, to verify transaction inclusion and state proofs inside encumbrance policies.
The source code contained in this repository has not been audited. It is an academic prototype. Our smart contracts might contain serious bugs. Key-encumbered wallets and encumbrance policies are novel concepts, so there are not yet any established standards or best practices to assist with safe deployment.