Binance Smart Chain

Wallet Structure

The semi-custodial wallet of Binance Smart Chain has the following structure.

  • Main Address
  • Fee Address
  • Child Address

TIP
The fee address is used to recharge the child address with the fees (BNB) if necessary.






Child Address

Generates child addresses by calling the Generate Child Address API. Generally, one child address is given to each end user. Generated child addresses can be checked from [Child Address Information] from the console or by calling the Access Child Address List API.

Response example

[
  {
    "address": "0x236c41418f0320DC7233C8c9dC99EEa5930341D9",
    "name": "test address 001"
  }
]





Deposit

Deposit Status

When an asset from the outside arrives at the main or a child address, Octet recognizes it as a deposit. However, the deposit is not finalized even if the deposit transaction is included in the blocks. Additional blocks must be generated to finalize(FINALIZED) the transaction to ensure the integrity of the transaction. When an asset is sent to a main or a child address but has not arrived, that transaction is not recognized. Therefore, there is no FAILED status for the deposit transaction.

Status nameDescription
UNFINALIZEDDeposit transaction is included in the blocks
FINALIZEDDeposit transaction is included in the blocks and the next block is generated

The number of blocks required to finalize the deposit is different depending on the network. Both testnet and mainnet require additional 20 blocks to finalize the transaction.

TestnetMainnet
20 block (about 1 minute)20 block (about 1 minute)


Deposit Confirmation

1. Checking from the Console

You can check the deposit status from [Transaction History] on the console. UNFINALIZED deposits are displayed as ‘Processing’, and FINALIZED deposits are displayed as ‘Completed’.


2. Checking with Webhooks

When a deposit is finalized to a main or a child address, a deposit webhook will be sent. You can check the deposit status from the received webhook. For more information about how to use webhooks and their data structure, check the 'Webhook' page.






Withdrawal

Withdrawal Process

Semi-custodial wallet withdraws assets from the main and child addresses to the outside. In this case, gathering fees will be deducted from the address to be withdrawn. For example, when withdrawing from ‘child address A’, a fee will be deducted from ‘child address A’. Therefore, the address to be withdrawn should have assets (BNB) to pay the fee. Withdrawal will not proceed if the withdrawal fee is insufficient.

  1. Request withdrawal.
  2. Generate transaction.
  3. Calculates the optimal fees and propagates the transactions.
  4. Withdrawal is completed when the transactions are confirmed in the blocks.


Withdrawal Status

Unlike a deposit, a withdrawal is finalized(FINALIZED) at the moment when the transaction is included in the blocks.

Status nameDescription
AWAITING_DECISIONAwaiting withdrawal approval
REJECTEDWithdrawal is denied
AWAITING_WITHDRAWALApproved and awaiting withdrawal
PENDINGWithdrawal transaction is generated
FINALIZEDWithdrawal transaction is included in the blocks
FAILEDWithdrawal transaction failed


Withdraw

You can request a withdrawal from the main or child address to the outside by calling the Request Withdrawal API. The uuid value will be returned when the withdrawal request is successful. The value can be used to access the withdrawal process.


Response example

{
  "uuid": "18012e3f-07f3-45ec-862b-f020c0ca935a"
}


Withdrawal Confirmation

1. Checking from the Console

You can check the withdrawal status from [Transaction History] on the console. AWAITING_WITHDRAWAL or PENDING withdrawals are displayed as ‘Processing’, and FINALIZED withdrawals are displayed as ‘Completed’.


2. Checking with API

You can check the progress of a specific withdrawal transaction by calling the Access Withdrawal Transaction Information API.

Response example

{
  "idx": 490,
  "uuid": "07efdcb2-b3fd-4fe7-bf47-c0b460b289e3",
  "fromAddress": "0x71b5De2970A32eEf6362AE7Bc3B73103b4392bB0",
  "toAddress": "0x295909dC67B76f936BD4119aDd877088602cCaD3",
  "amount": "2.00000000000000000000",
  "memo": null,
  "requestId": "25",
  "type": "API",
  "description": "",
  "requiredApprovalCount": 1,
  "useApiAutoApproval": true,
  "status": "SENT",
  "createdDate": "2022-01-25T09:25:02.383Z",
  "modifiedDate": "2022-01-25T09:25:10.000Z",
  "rejectedDate": null
}

3. Checking with Webhooks

When the withdrawal from the main address is finished, a withdrawal webhook will be sent. You can check the withdrawal status from the webhook. For more information about how to use webhooks and their data structure, check the Webhook page.






Balance Access Criteria

You can check the balance of the asset stored in a specific address by calling the Access Address Balance API. The accessed balances are specified into total balances and liquid balances.

  • Total balance is all assets with a confirmation of 1 or above.
  • Liquid balance is assets that can be withdrawn in each address.





Fees

Estimated Fees

Estimated fees are calculated by multiplying the gas price’s FASTEST value and the gas limit. Octet sets the gas limit of BNBs to 21,000. The gas limit for tokens is set to 100,000 since it varies depending on how the tokens are implemented. The gas limit is the maximum value, so the actual gas usage could be less than that, and the fees are charged for the actual gas usage.

Estimated Fees = Gas Limit x Gas Price

Transaction Fees

You can access the gas price in real-time by calling the Fee/Gas API. Fees charged for a transaction are calculated by multiplying the gas price’s FASTEST value and the amount of used gas.

Transaction Fees = Usage by Txn x Gas Price





Faucet

In the case of the testnet, you must obtain a testing BNB from the faucet website and deposit it. When an actual BNB is deposited in the testnet, it will not be recognized.