Wallet Creation
Last updated
Last updated
As defined in our core wallet module, a Wallaby wallet consists of three parts:
a set of (multiple) used to sign onchain transactions
a master
associated with your wallet
The first thing we need to do is create keys for your wallet holders to sign transactions. Our HD wallet architecture means that a wallet holder will have multiple key pairs as part of their wallet.
When your user creates a wallet, a private key pair for signing is created as needed for each supported blockchain. The different signing keys all roll up to a single seed phrase as described in Key Architecture Overview.
Once the wallet creation operation is complete, the seed phrase is encrypted and sent to the client. Then all other keys are discarded. We do not store or transport private keys.
Within our cross chain key architecture, the mnemonic is at the heart of our key management system. In addition to private keys, when the wallet is initialized, the mnemonic aka the seed phrase for that wallet is created. When a wallet is created (not imported), our seed phrases are 24 words.
Unlike the private keys, the mnemonic is transported. However, it is not stored.
Finally, once your seed and key pairs are set up, we initialize assets that belong to a wallet. The assets that are setup by default can be configured in the enterprise portal as described in Getting Started..
Because any tokenized asset can be associated with a user's wallet, the point in which it makes the most sense for a user to create a wallet can be custom to your platform.
Our wallet is designed to be embedded into your existing product wherever it makes sense. In some cases, it may make sense to add it directly into your account creation process. In other cases, it may make sense to delay it to a later step such as when a user is creating their first character in a game or when a user is making their first investment.
If you proceed with creating a wallet from scratch, you will create a new seed phrase for the user. If instead you would like to...
create a new wallet from an existing seed phrase, please use Wallet Import.
fetch a user's preexisting wallet, please use Wallet Recovery.
To actually get started, you'll need to determine whether you want to use our SDK or our APIs directly. In order to determine which product is right for you, take a look at SDK vs API.
With our SDK, you will always use the create function with a unique identifier from your system to represent the user. Implementation is described in more detail in in the developer docs: Creating a wallet with the SDK.
You should expect the following behavior when using this function:
If we detect that a user with this unique identifier does not already exist, then we will create a new account and a new wallet.
If we detect that a user with this unique identifier does already exist, but does not have a wallet, then we sign them in and create a wallet for that user.
If we detect that a user with this unique identifier does already exist and has a wallet, then we sign them in and create an additional wallet for that user.
If you would like to restrict a user from having multiple wallets, you will need to create this restriction on your end.
When creating a wallet, each of these items need to be generated. However, what we do with them post-generation is different for each item and dependent on your user experience. to see what the UX might be like for your users.