-
Notifications
You must be signed in to change notification settings - Fork 87
BSIP65: Fix Locked Accounts #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
6ba1f10
7c0363d
5655920
3c99c15
6cc3a57
44b4712
0ef008e
a52f2d1
7579612
9571127
b242bee
dce5b2e
5d807b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| BSIP: 0061 | ||
OpenLedgerApp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Title: Fix locked accounts with circular dependencies | ||
| Authors: OpenLedgerApp <https://github.com/OpenLedgerApp> | ||
| Status: Draft | ||
| Type: Protocol | ||
| Created: 2019-22-02 | ||
| Updated: | ||
| Discussion: https://github.com/bitshares/bsips/issues/94 | ||
| Worker: | ||
|
|
||
|
|
||
| # Abstract | ||
| BitShares allow to change permissions of account A to account A. See *Cycles* paragraph of https://bitshares.org/technology/dynamic-account-permissions for details. More information can be found here: https://steemit.com/blockchain/@hipster/sad-story-how-i-lost-bitshares-account | ||
OpenLedgerApp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Motivation | ||
OpenLedgerApp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| We offer to develop additional functionality "Prevent to create cycled accounts". This functionality will avoid to create or update account authority with circular dependencies in the future. | ||
|
|
||
| # Rationale | ||
OpenLedgerApp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| According to our investigation, BitShares has about 384 locked accounts with circular dependencies. Most of these accounts are locked by mistake. | ||
|
|
||
| # Specifications | ||
|
|
||
| ## Prevent circular dependencies | ||
| We must extend create and update account evaluators adding code that detect cycled authorities and throws exception in do_evaluate() method if cycle detected. | ||
OpenLedgerApp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| To avoid any misunderstanding of existing authorization mechanism we propose to reuse actual code of sign_state::check_authority(). Make template class traverse_authorities_state and parametrize it with approve() method. By default approve = signed_by(), an existing method of sign_state class. We add keys_available() method to resolve signing path. So, check_authority() returns true, if signing path fully ends with existing keys. | ||
|
|
||
| ## Fix locked accounts | ||
| There are two approaches here: | ||
|
||
|
|
||
| 1) Automatic (unconditional) | ||
| - Detect all locked accounts in first maintenance after hard-fork. | ||
| - Find latest operation ("lock"-operation) among operations of cycled accounts. Do it for each cycle. | ||
| - Undo all "lock"-operations. Find previous account update/create operation that changes authorities and redo it. | ||
|
|
||
| 2) Manual (on-demand) | ||
OpenLedgerApp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Check if account is locked. | ||
| - Find latest operation ("lock"-operation) in cycle. | ||
| - Undo "lock"-operation. | ||
|
|
||
| # Discussion | ||
| Should we identify authority as locked in case of cycle only? Bitshares has *max_authority_depth* parameter. So, authorities with delegetion depth > *max_authority_depth* are potentially locked. Should we prevent this? | ||
|
||
|
|
||
| ## Examples | ||
| Account A has key. Account B delegates it's authority to A - ok. C -> B - ok. D -> C - fail. | ||
| Transaction can never be signed by D. D exceed depth limit. Current depth limit in Bitshares = 2. | ||
|
||
|
|
||
| # Summary for Shareholders | ||
OpenLedgerApp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a cost/benefit discussion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cost/benefit discussion? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please most specific what is required here - the cost/benefit? We have put the benefits previously. Finally, it does not matter how does it costs if it influences on the Bitshares major functionality and many users faced with this issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We decided to change the search algorithm according to the comments - #94 As a result, the number of locked accounts has decreased. List of the locked balances - https://docs.google.com/document/d/1Dmcr9QzSWnCbSKcpaN08iENJyn6AWogbKjZ_iHH4OM0/edit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have summarised the most liquid currencies of locked accounts. Here the list: Total locked budget is 144,619.841 bitUSD As you can see the total budget is huge. We offer to unlock these accounts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. That is indeed significant. How about taking 10% from each account as payment for the implementation? (Seriously. The accounts are locked which means a 100% loss for the owner. We're offering to return 90%.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It makes sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At unlock time, walk through the account balances and auto-transfer 10% from each non-zero balance to a specific account, e. g. committee-account. That's pretty straightforward. The non-technical side may be more tricky. :-/ |
||
| # Copyright | ||
| This document is placed in the public domain. | ||
|
|
||
| # See Also | ||
| https://github.com/bitshares/bitshares-core/issues/269 | ||
Uh oh!
There was an error while loading. Please reload this page.