dojoengine/dojo.js

[Enhancement] BurnerManager improvements

Closed this issue · 9 comments

I'm proposing improvements to the Burner Manager to give a better experience...

  • a function to check if an address is valid or not. If the account does not exist (wrong network or wrong cookies), we have a warning on the console, but there's no way to know if an account exists or not. That response should be stored and accessible from the client.

  • A property that returns the number of burner accounts created (I need it to refresh React hooks after add/delete)

  • A method to unselect burner, and select the master account. Once we select a burner, it's impossible to go back to master.

  • A way to restore deployed burners but not on cookies (if that's possible)

good ideas! Agree with them.

The last one is tricky, since we only store the burners in cookies. The only other option would be if they were downloaded into a json, then restored from that. There is actually a copy function which allows this already.

I was thinking about storing the accounts on-chain, but what about the private keys? Can’t have them exposed like that. Maybe if they are derived from a specific message signature, but I don't know if that’s secure enough.

Is this so people can transfer accounts between clients?

I think this may be important to restore lost accounts. If the player did not export and lost their cookies, burner funds will be lost forever

ah no not exactly - in production you use Argent or similar as the Master account, and the master account can update the public key, and restore the account (look how loot survivor does it). Also the Cartridge controller will handle this in the future.

ah no not exactly - in production you use Argent or similar as the Master account, and the master account can update the public key, and restore the account (look how loot survivor does it). Also the Cartridge controller will handle this in the future.

Loot Survivor requires the address to restore an arcade account. what if it is lost?

I've been researching if we can derive a deterministic key pair, similar to how Ethereum wallets create always the same sequence of accounts, and want to try something based on this:
https://github.com/amanusk/starknet-cli-wallet/blob/main/src/keyDerivation.ts
https://community.starknet.io/t/account-keys-and-addresses-derivation-standard/1230

The wallet account would sign a message including the game name and the account index, and the signature is used as seed for key generation. That account could be restored anywhere the wallet is connected.

As a side effect, if we use adventurer as the game name, for example, the same account can be used on multiple games.

address - the master account will also have a transaction that deployed the account, so you can always find it.

yes - it's all deterministic. Loot Survivor has solved this problem - have you looked at it?

I did, it looks random

https://github.com/BibliothecaDAO/loot-survivor/blob/main/ui/src/app/lib/burner.ts#L191

I was trying on testnet, every time I create a new account it has a new address.

Sorry you are right - but the master still deploys it, and master can update the keypair, so you can never loose it