Skip to main content

WIP Transfer Native Cryptocurrency

In this tutorial, we will walk you through the process of transferring native cryptocurrency between two wallets using the Eniblock SDK.

Overview

Creating a wallet using the Eniblock SDK is a straightforward process that involves instantiating the SDK, creating a new wallet instance, and managing the accounts within the wallet.

  1. Login (responsibility of the application creator): Your customer accesses your decentralized application (dApp) and "Login" or "Sign in".
  2. Transfer cryptocurrency (responsibility of the application creator): The customer sends some cryptocurrency, entering the recipient's wallet address, the amount of cryptocurrency to send, and any additional transaction details (e.g., fees). The user confirms the transaction details and proceeds to the next step.
  3. Load secret share (responsibility of Eniblock): The application securely retrieves the user's secret share from their chosen cloud storage provider. The secret share is temporarily loaded into the application to apply the transaction signing process (cf Store and retrieve a Wallet).
  4. Check identity (responsibility of Eniblock): Eniblock services verify the identity of the end-user based on the authentication performed by your IDP
  5. Generate the (TSS) signature (responsibility of Eniblock): Upon the user's initiation of the transaction, the user's secret share, combined with the shares of Eniblock, is used to create a valid signature without revealing the complete private key.
  6. Submit transaction (responsibility of the application creator): The application submits the signed transaction to the relevant blockchain network for processing and confirmation. The user receives a notification about the transaction status and can monitor the progress within the wallet interface (cf Get notified of Incoming Cryptocurrency Transactions.

Step 1 - Create a wallet

Live Editor

Step 2 - Top up the wallet

To top up your wallet:

  1. Run the code of the Step 1 section and collect the address of the wallet.
  2. Follow this FAQ entry: How to top up a wallet on the Polygon Testnet?

Step 3 - Check the balance

Verify the balance of your account. After topping up the wallet, you will have the ability to send MATIC tokens.

Live Editor

Step 4 - Send crypto currency and get confirmation

Here we retrieve the wallet, build a transfer transaction, send it and wait for a notification that confirms it is mined. Indeed, a transaction must be mined (i.e. integrated into the blockchain) with enough confirmation blocks to be considered as effective.

Live Editor

API References

  1. Eniblock class
  2. Wallet namespace
  3. Wallet class
  4. Account namespace
  5. Account class
  6. Account address
  7. Account getNativeBalance
  8. BalanceResult
  9. Account.buildTransfer() method
  10. TransferParams type
  11. NativeTransferParams interface
  12. TransactionExecutor class
  13. TransactionExecutor.estimate() method
  14. EstimateResult interface
  15. TransactionExecutor.send() method
  16. Ethers TransactionResponse class