Skip to content
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

32-bytes addresses as reserve account #200

Closed
4 tasks
dongsam opened this issue Oct 27, 2021 · 1 comment
Closed
4 tasks

32-bytes addresses as reserve account #200

dongsam opened this issue Oct 27, 2021 · 1 comment
Assignees
Labels
dependencies enhancement New feature or request test and simulation test and simulation

Comments

@dongsam
Copy link
Contributor

dongsam commented Oct 27, 2021

Addresses of 32 bytes length proposed in ADR are now available from SDK v0.43.x. If 32 byte is used, it has higher security for birthday attacks as mentioned in #3685, ADR, and 32byte addresses are adopted on this module because large funds are preserved in one reserve account due to the characteristics of the module.

Currently, this module uses below 32-bytes addresses as Reserve Account

DefaultFarmingFeeCollector = sdk.AccAddress(address.Module(ModuleName, []byte("FarmingFeeCollectorAcc"))).String()

StakingReserveAcc = sdk.AccAddress(address.Module(ModuleName, []byte("StakingReserveAcc")))
RewardsReserveAcc = sdk.AccAddress(address.Module(ModuleName, []byte("RewardsReserveAcc")))

As a drawback of 32-bytes, functionality as a module account of 32-bytes in cosmos-sdk is not yet supported, so it cannot be registered as a module account.

The advantage of registering as the module account is that

  1. The action can be performed by allocating the necessary permission.
  2. It is possible to prevent the send to the corresponding module account.

In the case of 1, it is okay because the module does not require permission, and in the case of 2, there will be no problem other than the residue remaining in the account when sent. In this part, an additional test code will be created to further confirm that there is no problem that causes unexpected logic flow.

Therefore, unless using 32 bytes address causes fatal errors in cosmos-sdk dependency, front-end, or third-party apps, keeping current use of 32-bytes, but if any problem It can be changed to 20 bytes address which is relatively vulnerable to birthday attacks.

Test scenario

  • Is there any problem when the address of 32-byte is set to the address of DelegatorWithdrawAddr? SetDelegatorWithdrawAddr, SetWithdrawAddr
  • Other external modules that can set address or change the balance accordingly test the case.
  • ...

References


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@dongsam
Copy link
Contributor Author

dongsam commented Nov 24, 2021

So far, no problem with the 32bytes address has been found, so the ReserveAddressType was set as AddressType32Bytes. If we find a problem in the future, we can change it to AddressType20Bytes and apply it immediately.

#229

@dongsam dongsam closed this as completed Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies enhancement New feature or request test and simulation test and simulation
Projects
None yet
Development

No branches or pull requests

2 participants