1

i need create wallet for user in substrate pallet .

for example i need create wallet for user and return the wallet info for user also use can use that info for transfer money to other wallets .

now i need to know what should i do for that ?

actually i need create wallet for user programmatically .

2
  • 3
    you don't create a wallet inside a pallet, that is a misconception... you should read more on the substrate architecture Aug 17, 2022 at 23:22
  • 1
    Please provide some context and an example of what exactly you are trying to do. Sep 14, 2022 at 12:06

2 Answers 2

0

https://docs.substrate.io/reference/command-line-tools/subkey/ - subkey generate will show you how to create a private key. As demonstrated by recent solana hacks it would be a very bad idea to log the private seed anywhere.

0

Opinion: It's almost always a bad idea to manage keys for users directly and by default. This is anti-ethos in Web3.

There are plenty of suggestions to start listed here for users to create wallets: https://wiki.polkadot.network/docs/build-wallets

Checkout https://polkadot.network/blog/introducing-polkadot-kusama-gifts/ - this tool can be used to allow users to claim assets into a wallet they create. Source: https://github.com/hamidra/dotdrop

Also worth a read to understand how you might manage a more complicated accounting setup: https://www.parity.io/blog/building-a-hot-wallet-with-substrate-primitives/

Not the answer you're looking for? Browse other questions tagged or ask your own question.