Wallets
Elements supports implementation of a custodial Wallet system to facilitate user transactions with your game or application.
Last updated
Elements supports implementation of a custodial Wallet system to facilitate user transactions with your game or application.
Last updated
Wallets are at the heart of any blockchain. A Wallet typically contains multiple accounts, which is typically a public/private key pair. The wallet identifies the user or organization on the blockchain and uses the information to generate the digital signature required to execute transactions.
Elements provides a custodial wallet system that permits you to store user's crypto assets within Elements. In addition to full custodial wallets, Elements also allows the storage of the public address only, permitting users to receive crypto assets, but not to sign transactions. This can be useful for users who wish to bring their own wallets.
The general Wallet properties are as follows.
user - The user which owns the Wallet
vault - The Vault which owns the Wallet
api - The API with which this wallet is compatible. See Supported Blockchain APIs for more information.
networks - A set of networks with which this wallet is compatible. See Supported Blockchain Networks for a list of supported values.
preferredAccount - As a single Wallet may contain multiple accounts, this indicates the preferred account. In cases where a Wallet may
accounts - A list of all accounts contained within the Wallet.
Blockchain APIs and Blockchain Networks must be compatible in all cases. For example, it is not possible to specify a Wallet that uses the Ethereum API on the Solana Network, as they are incompatible networks.
A Wallet may contain several accounts, each of which is a separate identity on the blockchain. Most blockchains support multiple accounts per Wallet. Practically speaking, most users will have a single account per wallet. However, it is possible to support multiple accounts per wallet.
The wallet account properties are as follows:
address - the public address of the account. This field is mandatory.
privateKey - the private key of the wallet. This field is optional. However, if left unspecified, then the wallet may not be used to sign transactions. Rather it may be only used to receive currency and NFTs.
encrypted - a boolean value to indicate whether or not the private key in the wallet is encrypted.