Skip to content

Commit

Permalink
Update eth-demls.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsesfv committed Oct 8, 2024
1 parent 0c967a5 commit f686b60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vac/raw/eth-demls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ and deploy when compared to the above MPC description.
In order to avoid security issues like replay attacks and DDoS,
one needs to have the following aspects in mind:

1. Nonce uniqueness: this can be guaranteed using a map to track used nonces for each signature.
1. Nonce uniqueness: this can be guaranteed tracking used nonces for each signature.
This would prevent replay attacks as it provides proofs
that a nonce was used only once by a particular address.
2. Temporal uniqueness: timestamps allow checkings to prevent the reuse of old signatures.
Expand All @@ -1043,25 +1043,29 @@ while the core function is `authenticate`.
Timestamps and nonce tracking are recommended to avoid replay attacks and DDoS attacks.

### Initial Setup

used_nonces = empty map of address to set of bytes32
group_members = empty set of addresses
admin = creator_address

### Function `add_group_member`

Input: member_address

If the caller is not admin, return an error:
"Only admin can perform this action"
Add member_address to the group_members set

### Function `remove_group_member`

Input: member_address

If the caller is not admin, return an error:
"Only admin can perform this action"
Remove member_address from the group_members set

### Function `authenticate`

Inputs: nonce, timestamp, signature

Generate the message:
Expand All @@ -1087,6 +1091,7 @@ If caller_address is not in group_members, return an error:
Add the nonce to used_nonces[caller_address]

### Helper Function `recover_signer`

Inputs: message, signature

Convert message to bytes:
Expand Down

0 comments on commit f686b60

Please sign in to comment.