BEPs icon indicating copy to clipboard operation
BEPs copied to clipboard

Whitelist Script for BEP12

Open wjmelements opened this issue 5 years ago • 6 comments

Changes

Transactions can send money to the wrong address, causing immediate loss of value. A whitelist could be useful for a wallet or service to protect against mistake transfers, as an additional safeguard. This also proposes transactions for adding to the whitelist or removing from it. Reviewers @huangsuyu

wjmelements avatar Jul 28 '19 23:07 wjmelements

I pushed a commit to make the parameters plural, which I see as an improvement, though it may complicate the fee structure. git revert be37795 if unwanted.

Proposed fee structure

To account for the increase in state size, adding whitelisted addresses should cost more per-account. However, because removing whitelisted accounts trims the state size, removing blacklisted accounts should have a smaller, flat fee.

wjmelements avatar Jul 29 '19 01:07 wjmelements

Overhead would depend on the node implementation. If the account is amino-encoded, for example, there is no extra space for null fields.

On Tue, Jul 30, 2019 at 1:13 AM huangsuyu [email protected] wrote:

@huangsuyu commented on this pull request.

In BEP12.md https://github.com/binance-chain/BEPs/pull/41#discussion_r308588239:

  • }
  • if ! isSender(tx, addr) {
  •    return nil
    
  • }
  • if ! isRecipientWhitelisted(addr, tx) {
  •    return err("recipient not whitelisted")
    
  • }
  • return nil +} +```

+#### New Transaction: WhitelistRecipients +A node should reject the transaction if any of the accounts are already whitelisted by this sender. + +Parameters for adding whitelisted recipients:

We need to allocate extra space for whitelist storage. It will be a scability issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/binance-chain/BEPs/pull/41?email_source=notifications&email_token=AAGDGVKOK4BL3QDCPENOH53QB7Z2JA5CNFSM4IHNW35KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB76MLEA#pullrequestreview-268223888, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGDGVK6IQBC32WNCSWN2ZTQB7Z2JANCNFSM4IHNW35A .

wjmelements avatar Jul 30 '19 08:07 wjmelements

Overhead would depend on the node implementation. If the account is amino-encoded, for example, there is no extra space for null fields.

@huangsuyu means that this feature requires not only a validation script but also extra storage for saving whitelist.

abelliumnt avatar Jul 31 '19 12:07 abelliumnt

Overhead would depend on the node implementation. If the account is amino-encoded, for example, there is no extra space for null fields.

@huangsuyu means that this feature requires not only a validation script but also extra storage for saving whitelist.

added

wjmelements avatar Jul 31 '19 19:07 wjmelements

why cannot this be implemented on client side, i.e. wallets or signing service? They are more flexible to add more features, e.g. different group of white list can accept different size of fund, or an address book that can associate address with monikers to select.

Storing on chain cost token and actually exposes more privacy information of the addresses relationship. I don't think many people are interested.

darren-liu avatar Aug 27 '19 00:08 darren-liu

@darren-liu We (TrustToken) are interested in this as an additional layer of defense for our mint security, and have used a similar system on Ethereum in the past.

wjmelements avatar Aug 27 '19 01:08 wjmelements

outdate, archive it.

brilliant-lx avatar Dec 02 '22 01:12 brilliant-lx