dojoengine / dojo.js

dojo.js - enter the dojo via js
https://dojoengine.github.io/dojo.js/
MIT License
21 stars 45 forks source link

[Feature]: Deterministic burner accounts #172

Closed rsodre closed 5 months ago

rsodre commented 5 months ago

Feature Request

Problem: New burner accounts are always created with a random keys and address, stored on the browser.

That causes many drawbacks:

We don't want to expose players to another security risk and we don't want players to lose assets.

From one seed phrase, Ethereum and Starknet wallets always create the same account address sequence wherever they are recovered. Understanding the importance of their seed phrase and storing them securely is something every user needs to understand and be comfortable with before starting to interact with on-chain games.

Proposed Solution

I propose implementing Deterministic Burner Accounts, from a a seed and an index, similar to Ethereum and Starknet wallet accounts.

Obviously, we don't want access to players' seeds and keys! This is the proposed workflow:

The solution I'm working on includes:

Alternatives

None, currently we can only create random burner accounts.

Related Code

Additional context

No response

If the feature is accepted, would you be willing to contribute it?

rsodre commented 5 months ago

This solution is already working on this branch, to be pulled soon: https://github.com/rsodre/dojo.js/tree/deterministic-burners

If this feature is accepted, please assign it to me.