# Celestia

Source: https://developers.bitgo.com/docs/celestia

## Celestia

Celestia can be accessed with the following coin types:

| Environment            | Coin Type | Faucet                                                                                                                                                                                |
| :------------------    | :-------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Celestia Testnet        | tia       | <a href="https://docs.celestia.org/operate/networks/mocha-testnet/#mocha-testnet-faucet" target="_blank" rel="noreferrer">https://docs.celestia.org/operate/networks/mocha-testnet/#mocha-testnet-faucet</a>|

### Explorer
<a href="https://www.mintscan.io/celestia/" target="_blank" rel="noreferrer">https://www.mintscan.io/celestia/</a>

### Generating wallets

To create a Celestia wallet using BitGoJS:

```javascript
bitgo
  .coin('tia')
  .wallets()
  .generateWallet({
    label: 'My Test Wallet',
    passphrase: 'secretpassphrase1a5df8380e0e30',
  })
  .then(function (wallet) {
    // print the new wallet
    console.dir(wallet);
  });
```

To create a Celestia wallet using the platform API:

```shell
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/api/v2/tia/wallet/generate
```

### Creating addresses

```javascript
bitgo
  .coin('tia')
  .wallets()
  .getWallet({ id: '585c51a5df8380e0e3082e46' })
  .then(function (wallet) {
    return wallet.createAddress();
  })
  .then(function (newAddress) {
    // print new address details
    console.dir(newAddress);
  });
```
```shell
WALLET=585c51a5df8380e0e3082e46

curl -X POST \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://app.bitgo-test.com/api/v2/tia/wallet/$WALLET/address
```

### Staking
- Celestia supports staking. Celestia uses a delegated proof-of-stake (DPoS) consensus mechanism. Celestia holders can stake their tokens to validators.
- Validators participate in consensus to produce new blocks and validate transactions.
- By staking Celestia, holders can earn rewards.

### Balances
The base unit of Celestia is `utia` (microtia).
- 1 tia = 1,000,000 utia
- 1 utia = 0.000001 tia

To check the balance of a wallet:

```javascript
const address = yield walletInstance.getAddress({ address: 'celestia1mlxcf06y3lumezyf79n0p4hkpg26ycdr8prjnw' });
const bal = address.balance;
return bal;
```

### Tokens
Celestia does not support tokens transactions.

### Consolidation
BitGo supports memo based addresses. Therefore, consolidation is not required.

### Fee rate
The default gas fee is 0.07 tia
