User account
Accounts in Folks Finance are designed to manage users' positions and facilitate lending functionality across multiple blockchains. Each account is uniquely identified and allows for efficient cross-chain operations.
Account Structure
Unique Identifier: Each account has a unique
bytes32
identifier.Blockchain Addresses: Accounts are managed using blockchain addresses, uniquely identified by the tuple
(chain identifier, chain address)
.
Key Features
Single Address per Chain:
Each account can have at most one address registered per spoke chain. This simplification ensures that operations are streamlined and user-friendly.
For example, if a user is borrowing ETH, they will receive it in their registered Ethereum address without needing to specify which address to use.
Unique Address Registration:
The same
(chain identifier, chain address)
pair cannot be registered to multiple accounts. This prevents confusion and ensures that users do not unintentionally interact with the wrong account.The concept of inviting and accepting is used to manage address registrations. An existing registered address can invite another address from a different spoke chain to join the account. The invited address must then accept the invitation to be registered.
Delegated Addresses:
To enhance composability and allow other protocols to build on top of Folks Finance, accounts can add "delegated addresses." These addresses can manage accounts from the hub chain.
Multiple delegated addresses can be added to a single account, and the same address can be delegated to by multiple accounts. This feature is intended for use by other smart contracts on the hub chain that leverage the Folks Finance protocol.
Account Operations
Invite and Accept:
An address from one spoke chain can invite another address from a different spoke chain to join the account.
The invitee must accept the invitation for the registration to be completed.
Manage Account:
Once registered, addresses can manage the account, including withdrawing, inviting other addresses, and more.
Delegation:
Delegated addresses are given privileges to manage the account, allowing for seamless integration with other protocols and services.
Security Considerations
Denial of Service Protection:
To prevent denial of service attacks, the same
(chain identifier, chain address)
pair cannot be registered to multiple accounts. This ensures that malicious actors cannot add an address to their account to block its use elsewhere.
Trusted Integrators:
It is crucial for users to verify the addresses they delegate to. Malicious addresses can steal funds, so users must be cautious and only delegate to trusted integrators.
Last updated