LSP0 - ERC725 Account
LSP0, the ERC725 Account standard, is at the heart of creating digital identities on the LUKSO blockchain. Think of it as a digital passport that represents you, your organization, or even your smart devices in the digital world. It is built on a combination of LUKSO standards, allowing for a wide array of functionalities — from executing transactions and storing diverse data to verifying digital signatures.
An ERC725 Account overcomes the limitations of traditional blockchain accounts by enabling more secure, flexible, and user-friendly identities. Whether it is about holding assets, interacting with decentralized apps, or participating in digital governance, LSP 0 empowers users to do it all under one roof, with full control and enhanced security. It is not just an account; it is a comprehensive digital identity system designed for the future of Web3.
Introduction
Externally Owned Accounts (EOAs) are the primary type of account in Ethereum, controlled by a private key. If the private key is compromised, anyone can execute transactions from the account and access any assets it holds. EOAs have no built-in mechanism for attaching any information or data, making identifying the person or entity using the account challenging. They can only perform simple interactions using the CALL opcode and create contracts using the CREATE opcode.
These issues can be addressed by the ERC725 standard, which provides more operations to execute and a flexible way to attach data for the contract even after it has been deployed.
However, for a smart contract-based account to be viable in the long term, it should have much more functionalities than the ability to execute and to attach data. The features that makes a smart contract an account are:
- the ability to verify signed messages
- be notified of incoming tokens, followers, and other types of transactions,
- be able to be extended after deployment to support functions and standards that will be adopted in the future.
Additionally, it should have a secure ownership management system to ensure the protection of valuable assets.
What does this standard represent ?
An ERC725Account is a blockchain account system that can be utilized by individuals, machines, or other smart contracts. It is made up of various standards that enable the functionalities mentioned above. It is formed from:
-
ERC165 allows to register and detect the standard interfaces and standards that the contract implements, or will implement in the future.
-
ERC725X is a generic executor that enables calling external contracts with different operations such as CALL, STATICCALL and DELEGATECALL. It also allows deploying new contracts with CREATE or CREATE2, or transferring value to any address (EOA or smart contracts).
-
ERC725Y is a generic key-value store that enables it to attach any information to the smart contract even after it's been deployed.
-
ERC1271 helps to verify the validity of a message and signature.
-
LSP1-UniversalReceiver enables notifications about incoming or outgoing transactions and adds custom handling and behavior based on these transactions.
-
LSP14-Ownable2Step enables a secure ownership management system.
-
LSP17-ContractExtension enables the contract to be extended after deployment to support new standard and functionalities.
-
LSP20-CallVerification provides a unified and standard way for all addresses to interact directly with the account. This streamlines the interaction process considering the ownership setup, and enhancing accessibility and developer experience.
ERC725X - Generic Executor
See the ERC725 standard for more information.
Check the execute functions provided by ERC725X that allows the contract to execute multiple operations.
Check the javascript guides to know How to Send native tokens or How to Call other contract's function using the execute function.
The ERC725X standard enables the account to perform generic calls on other smart contracts, including transferring native tokens. External actions can be executed using the smart contract's generic execute(...)
function and multi-calls can be done with the execute(..)
batch function, but only the account owner can perform these operations.
Additionally, it also allows for the deployment of new smart contracts by providing the bytecode of the new contract to deploy as an argument to the execute(...)
function. Contracts can be deployed using either the CREATE or CREATE2 opcodes.
The following types of calls (operation types) are available:
Operation number | Operation type | Description |
---|---|---|
0 | CALL | Transfer native tokens or calls smart contract functions. |
1 | CREATE | Create a new smart contract based on the contract address and nonce. |
2 | CREATE2 | Create a new smart contract based on the contract address, bytecode and the salt. The address can be predetermined. |
3 | STATICCALL | Calls another smart contract while disallowing any modification to the state during the call. |
4 | DELEGATECALL | Runs the function from another contract, but use the context of the current contract. |