MetaMask / MetaMask/smart-accounts-kit

Consider generating random salt when creating a delegation

Open
#207 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
63
Forks
45
Avg merge
4d 15h
Merged PRs (30d)
2

Description

### **Description**

When no `salt` is specified in calls to `createDelegation` and `createOpenDelegation`, the default value `0x00` is used.

Generating a random salt would be safer as a caller creating a delegation would not expect two delegations created with the same arguments to be considered _the same delegation_ which is the current behaviour.

### **Technical Details**

Consider exporting a `generateSalt` function from @metamask/delegation-core so that core consumers don't need to reproduce this function.

### **Acceptance Criteria**

- Are metrics required?
- Are translations required?
- Cases to satisfy
- XYZ should work
- Etc.

Scenario: xxxx
- GIVEN a user is in x state
- WHEN a user does x
- AND a user does x
- THEN x should occur

### **References**

- References go here.
- Issue numbers. Links.
- Slack threads.
- Etc.

Contributor guide

Open the contributing guide

Research direction

Start by locating createDelegation and createOpenDelegation in the TypeScript project, then inspect how their default salt is set. Check the @metamask/delegation-core API for where a generateSalt export would belong. Done should be defined by an agreed random-salt behavior and an explicit set of acceptance scenarios; the current criteria are placeholders.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.