"Limited scope account" concept
Introduction
In Microchain Labs, we’re developing new techniques and approaches to make the best trade-offs between having a more user-friendly blockchain experience and ensuring users' safety and security. This blog post introduces a new approach called “limited scope account”.
Externally Owned Accounts(EOAs) and Smart Contract Accounts(SCAs) default behavior:
In Ethereum, we have two account types: EOAs and SCAs. EOA is controlled via the ownership of a private. SCA is controlled via something programmable. We can program any business logic with SCA.
EOAs and SCAs are designed per default to do any interaction on-chain. We introduce a ”limited scope account” concept that applies to SCAs. Instead of having an SCA that can interact with anything on-chain as the default behavior, we will have an SCA that cannot do anything on-chain as its default behavior. Then, over time and based on the user usage, it defines the scope and capabilities of its SCA.
The “limited scope account” concept lets users control and govern their on-chain interactions.
”Limited scope account” concept:
The default approach to limit the user’s account capabilities on-chain is to define a list of the smart contract addresses that the user account can interact with and another list of addresses that the user account can transfer to the native coin.
With a “Limited scope account”, the user can also define its account governance rules and expected behavior with any on-chain protocol. The user defines its expected behavior when he uses a trading on-chain protocol like Uniswap. So, its SCA will not accept any operation outside the expected behavior.
Timeline:
at t=0: the account cannot do anything on-chain
at t=1: we add the behavior that the account can interact with the USDC on-chain protocol.
at t=2: we add the behavior that the account can interact with the Uniswap on-chain trading protocol.
…
Over time, the user constructs its on-chain behavior and its governance rules. We can share safe behavior usage of on-chain protocols between users.
With the “Limited scope account”, we have a better and more secure human on-chain experience.
Technical implementation:
We developed a proof of concept(POC) of the “Limited scope account” approach. We used ZK program(ZK circuit and Merkle trees) to limit the scope of SCA and define its default behavior.
limited-scope-account-circuits: https://github.com/MicrochainLabs/limited-scope-account-circuits
limited-scope-account-contract: https://github.com/MicrochainLabs/limited-scope-account-contract
limited-scope-account-demo: https://github.com/MicrochainLabs/limited-scope-account-demo
Example usage:
1- Enterprises: an admin configures employees' accounts to function based on the enterprise rules. Employees will use their SCAs on-chain based on the governance rules of the enterprise.
2- “Limited scope account” as a public good on-chain identity for citizens by the government. The account is configured to function with government on-chain protocols or with the regulated ones.
3- Gaming account: each game has its on-chain protocol, users can add to their “Limited scope account” which games(on-chain protocols) they play(interact with) and their expected behavior.