Hedera Hashgraph

Hedera Hashgraph

Hedera (HBAR) can be accessed with the following coin types:

EnvironmentCoin TypeFaucet
Hedera Productionhbarhttps://portal.hedera.com/register
Hedera Testnetthbarhttps://portal.hedera.com/register

Generating wallets

To create a HBAR wallet using BitGoJS:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 bitgo .coin('thbar') .wallets() .generateWallet({ label: 'My Test Wallet', passphrase: 'secretpassphrase1a5df8380e0e30', }) .then(function (wallet) { // print the new wallet console.dir(wallet); // print the new wallets address to send to console.dir(wallet.coinSpecific.baseAddress); });

Creating HBAR wallets is restricted to enterprise customers. In production, there is limit of 100 wallets total per enterprise. In testnet, there is no limit.

Note: To inquire about increasing your limit, contact BitGo at support@bitgo.com.

Before you can use an HBAR wallet, it must be initialized on the Hedera blockchain. A funding transaction must first be sent to the wallet's address. When BitGo detects this funding transaction, it automatically sends another initialization transaction to set up the signers and the home domain of the account. There is a fee associated with creating HBAR wallets that BitGo covers for the user.

Until the initialization transaction is confirmed, the wallet is not ready for use, and the receive address is not exposed in the API. This is to protect users from losing funds by sending to a wallet that does not exist on the network.

Warning: Do not use an HBAR wallet while it is being initialized or you may lose funds.

1 2 3 4 5 6 7 8 LABEL="My Test Wallet" PASSPHRASE="secretpassphrase1a5df8380e0e30" curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d "{ \"label\": \"$LABEL\", \"passphrase\": \"$PASSPHRASE\" }" \ http://$BITGO_EXPRESS_HOST:3080/api/v2/thbar/wallet/generate

Creating addresses

1 2 3 4 5 6 7 8 9 10 11 bitgo .coin('thbar') .wallets() .getWallet({ id: '585c51a5df8380e0e3082e46' }) .then(function (wallet) { return wallet.createAddress(); }) .then(function (newAddress) { // print new address details console.dir(newAddress); });
1 2 3 4 5 WALLET=585c51a5df8380e0e3082e46 curl -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/thbar/wallet/$WALLET/address

HBAR receive addresses are defined as a memo which can be attached to a transaction. For each BitGo wallet, an incrementing string number value is used as the memo. Whenever a new address is created, the incremented memoId and is returned in the coinSpecific property of the address.

Balances

HBAR (HBAR) is the native asset of the Hedera blockchain. The base unit of HBAR is tinybar:

  • 1 tinybar is (10-8) or 0.00000001 HBAR.
  • 1 HBAR is (108) or 100000000 tinybars (100 million).

Balances are supported in string format: balanceString, confirmedBalanceString, and spendableBalanceString.