Universal Profiles
The Learn Section will take you through the process of creating a Universal Profile and deploying it on the LUKSO Testnet.
You can also browse the already deployed Universal Profiles on universalprofile.cloud.
Introduction
Building an identity on top of keys is almost impossible because keys are likely to be leaked or lost forever. Holding assets and building a reputation on these keys makes it worse. A better representation of identity would be with blockchain-based accounts.
Blockchain-based accounts can change the way of interacting on-chain, allowing the usage of multiple components together. Used in combination with a Controller (see LSP6 - Key Manager), they could allow any entity to execute or set some data on your profile directly or via relay execution. Finally, developers could use contracts for social recovery if keys are lost. All these components together can enhance the blockchain experience.
Universal Profile Architecture
The diagram below shows the standard architecture used by LUKSO for Universal Profile.
The architecture is based on the combination of multiple standards and smart contracts to provide extensive and extensible functionality. This modularity allows for logic updates without altering the code of the main contract. This provides flexibility and facilitates the development and maintenance of this complex system, as changes or improvements can be made independently in each module without affecting others.
Universal Profiles Standards
Standard | Description |
---|---|
LSP0 - ERC725Account: This standard represents the core account contract. It consists of ERC725X, allowing a contract to interact with any address or smart contract on the blockchain, and ERC725Y, a generic key-value store that allows storing an unlimited amount of data in the smart contract. It also contains ERC1271 to verify if messages were signed by the ERC725Account's owner. If the owner is a Key Manager supporting ERC1271, it will delegate the call to the KeyManager. Lastly, it contains the LSP1 - UniversalReceiver, which allows this contract to be notified of any incoming asset. Using the LSP1 - UniversalReceiverDelegate logic, you can delegate the universal receiver call that an asset will do to an external contract, customizing the behaviour you want towards the asset. More on that below. | |
LSP6 - KeyManager: A standard representing a smart contract that can act as the owner of an LSP0 - ERC725Account. It reads permissions of addresses from the ERC725Account's key-value store, and restricts access based on these permissions. Transactions can be executed directly by permissioned users or by anyone with the help of a signed message by permissioned users. | |
LSP1 - UniversalReceiverDelegate: By setting the LSP1 - UniversalReceiverDelegate data key in your ERC725Account to a contract address, you can delegate any call to the universalReceiver(...) function of the account to this contract, which allows you to revert on certain incoming assets or add other logic. The standard LSP1 - UniversalReceiverDelegate implementation will write every LSP7 and LSP8 asset you receive into your ERC725Account using the LSP5 - ReceivedAsset standard. This allows any interface to list all token contracts that hold a balance of your account, right from the smart contract. |
An LSP0-ERC725Account can work standalone and doesn't require a Key Manager or a Universal Receiver Delegate, but this will limit the user experience.
Adding profile information
Each data on a Universal Profile is stored into a generic key-value ERC725Y store which allows storing an unlimited amount of data in the smart contract.
ERC725Y standardizes a mapping of data keys to data values in order to have the ability to add or remove data across time without the need of redeploying the contract. It gives flexibility to the contract storage. On the smart contract, data keys are represented as bytes32 values and data values under these keys are stored as bytes.
LSP2 - ERC725YJSONSchema is the standard used by the LSPs to organize how the data should be represented as bytes32 => bytes
data key / value pairs.
The LSP0 - ERC725Account standard represents a blockchain-based account that does not contain any metadata describing the account. It's important to standardize specific data keys to give the account a unique character and look like a typical Web2 profile.
LSP3 - Profile Metadata is a standard used to add profile information by setting its defined data keys in the account storage. The combination of these two standards forms a Universal Profile.
The guide Edit Profile Data may interest you.
References
- LUKSO Standards Proposals: LSP0 - ERC725 Account (Standard Specification, GitHub)
- LUKSO Standards Proposals: LSP3 - Profile Metadata (Standard Specification, GitHub)
- LUKSO Standards Proposals: LSP6 - Key Manager (Standard Specification, GitHub)
- LSP1 Universal Receiver: Solidity implementations (GitHub)