-
Notifications
You must be signed in to change notification settings - Fork 525
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
BEP-255: Beacon Chain Asset Reconciliation for Security Enhancement #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding 3.4 APIs
All sub title numbers are incorrect.
3.1.1 should be 3.4.1 etc
|
|
|
BEP-255: Beacon Chain Asset Reconciliation for Security Enhancement
1. Summary
This BEP proposes implementing on-chain asset reconciliation on BNB Beacon Chain to improve security.
2. Motivation
As a beacon chain, the BNB Beacon Chain plays a vital role in securing the BNB chain ecosystem. Although some
enhancements have been made to improve cross-chain security, such as BEP171, the security of assets on the BNB Beacon
Chain itself should also be guaranteed, especially after the bridge exploitation. Therefore, this BEP proposes implementing on-chain asset reconciliation.
Specification
3.1 Asset Reconciliation
There are many tokens issued on the BNB Beacon Chain, and they are highly valued assets to users. Therefore,
reconciliation mainly focuses on the balances of all users. However, with millions of users on the BNB Beacon Chain, it
is impossible to review all accounts and reconcile their balances. Therefore, the following approach is proposed, by
only reconciling the accounts changed in each block:
Firstly, the IAVL store is updated to track the storage keys that have been updated in a block. For example, if there
is a transfer transaction in a block, the related sender and receiver's storage keys will be tracked.
Secondly, in each EndBlocker, changes in account balances (e.g., transfers) will be calculated as balance changes for
all related accounts, and the related token supply changes (e.g., minting) will be calculated as token supply changes,
by comparing the related values in the current state and previous state with the IAVL trees, which are versioned.
equal. If there is a reconciliation error (i.e., unbalanced asset changes), the height will be written to the chain
state, and the blockchain will panic.
3.2 Halt on Reconciliation Error
If a reconciliation error occurs, the blockchain will stop producing new blocks, impacting downstream services such as
bridges, deposits, and withdrawals on exchanges. This drastic action is necessary to protect the chain and its users, so
core developers and community members should investigate the issue as soon as possible. Validators and node operators
should contact the core developers or be prepared to resume the network.
To bring the blockchain back online, a hard fork is needed. In the fork, the reconciliation error must be addressed
correctly; for example, if exploitation exists, related accounts should be blacklisted or corrected. Once the blockchain
is resumed, downstream services can be brought back up as well.
License
The content is licensed under the CC0 license.