Skip to content

feat(vesting): support vesting account creation via new module x/vauth#144

Merged
VictorTrustyDev merged 12 commits into
mainfrom
feat/support-vesting-account-creation
Sep 5, 2024
Merged

feat(vesting): support vesting account creation via new module x/vauth#144
VictorTrustyDev merged 12 commits into
mainfrom
feat/support-vesting-account-creation

Conversation

@VictorTrustyDev
Copy link
Copy Markdown

@VictorTrustyDev VictorTrustyDev commented Sep 5, 2024

Closes: #143

Problem:

Vesting account creation can select account to create vesting, this leading to security issue that attacker can create vesting account on future-contract-address therefore contract cannot be created.

This this why Evmos needs to implement a custom x/vesting module and some chains need to disable this feature or implement a whitelist granter.

Solution:

So the problem is how to prove that the grantee account is External Owned Account and if either (granter, grantee) can prove it, problem solved.

x/vauth is a new module added by this PR, based on Ethereum signed message.

  • Grantee sign an offline message via CLI/UI
  • Someone else submit the signed message to the blockchain via x/vauth tx.
  • x/vauth module verify the signature and set flag **verified** for the address delivered from the signature (grantee).
  • Granter submit a legacy tx that create vesting account
  • VestingMessagesAuthorizationDecorator check if grantee has proved via x/vauth
    • If NO proof then reject the message
    • If grantee has proof recorded by x/vauth, allow the message to pass through

Sample CLI:

# Generate proof
evmd tx vauth gen-proof --from employee
## Output:
## Address: evm1xx2enpw8wzlr64xkdz2gh3c7epucfdftnqtcem
## Signature: 0xe665110439b1d18002ef866285f7e532090065ad74274560db5e8373d0cdb6297afefc70a5dd46c23e74bd3f0f262195f089b2923242a14e8e0791f4b0621a2c00

# Submit proof
evmd tx vauth submit-proof evm1xx2enpw8wzlr64xkdz2gh3c7epucfdftnqtcem 0xe665110439b1d18002ef866285f7e532090065ad74274560db5e8373d0cdb6297afefc70a5dd46c23e74bd3f0f262195f089b2923242a14e8e0791f4b0621a2c00 --from co-worker

# Submit tx create vesting account by using Cosmos `x/auth` module
evmd tx vesting create-vesting-account evm1xx2enpw8wzlr64xkdz2gh3c7epucfdftnqtcem 100wei 1778899999 --from accountant

cc: @yihuang @omritoptix @fedekunze

@VictorTrustyDev VictorTrustyDev added the new-feature New feature/request label Sep 5, 2024
@VictorTrustyDev VictorTrustyDev self-assigned this Sep 5, 2024
@VictorTrustyDev VictorTrustyDev force-pushed the feat/support-vesting-account-creation branch from cbd3f3d to a9536c6 Compare September 5, 2024 17:26
@VictorTrustyDev VictorTrustyDev merged commit a0f0056 into main Sep 5, 2024
@VictorTrustyDev VictorTrustyDev deleted the feat/support-vesting-account-creation branch September 5, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature/request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem: vesting account creation is disabled

2 participants