Wallets can be generated by the card during production, according to the personalization config, or directly using the CreateWallet command.
CreateWallet command creates a wallet on the card. At this moment, by using a certified true random number generator (TRNG), the chip generates a random private key and then computes a corresponding public key from it. No one from outside the chip, including Tangem, can ever know what the private key is.
Each wallet on the card contains a pair of public and private keys. A public key is used to compute a unique address in the blockchain. A private key is used to sign transactions originating from this address. So only the owner of the private key can initiate the transfer of funds from this address.
Regardless of where and when the wallet was generated, neither Tangem nor anyone else has access to the private key. The private key cannot under any circumstances be declassified. This is one of the main advantages of the Tangem cards. In other words, whoever owns the private key owns the crypto funds.
You can generate up to 40 wallets on one card with different curves.
cardId <String>
CID, Unique Tangem card ID number.
initialMessage<Message> [optional]
This message will be shown in the NFC session dialog.
Default: "Tap the card to your phone exactly as it shown above".
Response
This command will return the Card.Wallet(click to see more) object in response.
Example
let curve = EllipticCurve.secp256k1 //Check supported curves in Card.supportedCurveslet cardId = card.cardIdtangemSdk.createWallet(curve: curve, cardId: cardId) { result inswitch result {case .success(let response):let newWallet = response.walletprint(newWallet)case .failure(let error):print(error) }}