[feature] implement transfer limits for new account creations
Closed this issue · 1 comments
Summary:
Propose the addition of a safety feature in the ol_account::transfer()
function to set a default transfer limit for new accounts not already present on the chain. This feature aims to prevent accidental large transfers to new accounts, which could potentially lead to loss of assets due to user errors. A complementary function, ol_account::transfer_scary()
, could be introduced to bypass this limit for users aware of the risks and willing to proceed with larger transfers.
Problem Statement:
Currently, there's no built-in restriction on the amount that can be transferred to a new account via ol_account::transfer()
. This lack of limitation poses a risk of significant asset loss due to typographical errors or other mistakes. Users might accidentally transfer large amounts to a new or incorrect account, leading to potential challenges in asset recovery.
Proposed Solution:
-
Introduce Transfer Limit for New Accounts: Implement a default transfer limit (e.g., 1,000 coins) in the
ol_account::transfer()
function for transactions directed to accounts that do not exist on the chain. This limit would act as a safeguard against large accidental transfers to new accounts. -
Override Option for Unrestricted Transfers: For users who need to transfer larger amounts and are aware of the risks, introduce an alternative function,
ol_account::transfer_scary()
, which allows for transferring amounts above the default limit without restrictions. -
User Confirmation for Large Transfers: Optionally, incorporate a confirmation step or additional authentication for transfers exceeding the default limit through
ol_account::transfer_scary()
, enhancing security and user awareness of the transaction's implications.
Code Repository Proposal:
The proposed changes could be integrated into the existing Libra Framework codebase, specifically within the ol_account.move
module. The relevant section of the code can be found here: ol_account.move Line 226.
Benefits:
- Enhanced Security: Reduces the risk of accidental large transfers to new accounts, enhancing the overall security of asset management within the Libra ecosystem.
- User-Friendly: Provides a safer default transaction path for the majority of users while still offering flexibility for advanced users through an override function.
- Error Mitigation: Helps in preventing common mistakes that could lead to financial loss, improving user trust and confidence in the platform.
Considerations:
- User Education: It will be essential to clearly communicate the existence of these features and their intended use to the users to ensure they understand the options available.
- Risk of Overriding: The
ol_account::transfer_scary()
function should be used cautiously, and measures should be in place to ensure users are fully aware of the implications of bypassing the default transfer limit. - Carpe Integration: Create some UI around the creation of accounts, form validation, and error handling
closed with #187