# Ethereum Sepolia

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

## Overview

Sepolia is a permissioned public testnet for Ethereum, used by developers to test smart contracts and protocol upgrades before deploying to Ethereum mainnet. It uses Proof of Stake (PoS) consensus, mirroring mainnet Ethereum's account model and ECDSA signature algorithm. Sepolia ETH (sepETH) has no monetary value and is only available for testing and development purposes.

> 📘 **Note:** Sepolia is a test/staging network only - BitGo does not support a corresponding mainnet asset under this coin.

## Explorer

<a href="https://sepolia.etherscan.io/" target="_blank" rel="noreferrer">https://sepolia.etherscan.io/</a>

## Wallets Types

BitGo enables holding sepETH in the following wallet types:

| | Multisig Cold | Multisig Hot | MPC Cold | MPC Hot |
|-| ------------- | ------------ | -------- | ------- |
| **Custody** | ✅ | ❌ | ✅ | ❌ |
| **Self-Custody** | ✅ | ✅ | ✅ | ✅ |

## Ticker Symbols

| Mainnet | Testnet |
| ------- | ------- |
| N/A     | sepeth  |

## Faucet

You can use a faucet to obtain free sepETH for development and testing purposes.

**Faucet:** <a href="https://cloud.google.com/application/web3/faucet/ethereum/sepolia" target="_blank" rel="noreferrer">https://cloud.google.com/application/web3/faucet/ethereum/sepolia</a>

## Units

sepETH is divisible by 10<sup>18</sup> and the base unit is a wei:

- 1 sepETH = 1,000,000,000,000,000,000 wei
- 1 wei = 0.000000000000000001 sepETH

sepETH denotes gas fees in gwei. Gwei are divisible by 10<sup>9</sup> and the base unit is also a wei:

- 1 gwei = 1,000,000,000 wei
- 1 wei = 0.000000001 gwei

Therefore:

- 1 sepETH = 1,000,000,000 gwei
- 1 gwei = 0.000000001 sepETH

sepETH balances are only in string format.

## Tokens

The Sepolia testnet natively supports the ERC20 token standard, used to test ERC20 token integrations before deploying to Ethereum mainnet.

## Fees

Sepolia fees are dynamic - there are no minimum or default fee rates. Instead, Sepolia uses:

- **Units of gas used:** The more complex the transaction is, the more gas it uses.
- **Base fee:** A fee set by the network to pay for a transaction.
- **Priority fee:** An optional tip that incentivizes node operators to include your transaction.

The following equation determines the dynamic gas fee:
`units of gas used * (base fee + priority fee)`

## Create Wallet

You can create a Sepolia wallet using the [Generate wallet](/reference/expresswalletgenerate) Express endpoint. To learn more about creating wallets, see the [Create Wallets](/docs/wallets-create-wallets) guide.

> 📘 **Note:** Sepolia wallets and addresses must initialize on chain before you can use them. Do not try to deposit into a wallet or address until it's confirmed on chain. Attempting to deposit while still pending on-chain initialization can result in loss of assets.

```shell cURL
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>"
export COIN="sepeth"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export LABEL="<YOUR_WALLET_NAME>"
export PASSPHRASE="<YOUR_BITGO_LOGIN_PASSPHRASE>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"

curl -X POST \
  http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/generate \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "label": "'"$LABEL"'",
    "passphrase": "'"$PASSPHRASE"'",
    "enterprise": "'"$ENTERPRISE_ID"'",
    "walletVersion": 4
}'
```
```js JavaScript
async function createHotWalletSimple() {
    const newWallet = await bitgo.coin('sepeth').wallets().generateWallet({
        label: '<YOUR_WALLET_NAME>',
        passphrase: '<YOUR_BITGO_LOGIN_PASSPHRASE>',
        enterprise: '<YOUR_ENTERPRISE_ID>',
        walletVersion: 4,
    });
    console.log(JSON.stringify(newWallet, undefined, 2));
}
```

## Create Address

You can create a Sepolia address using the [Create address](/reference/v2walletnewaddress) endpoint. To learn more about creating addresses, see the [Create Addresses](/docs/wallets-create-addresses) guide.

```shell cURL
export COIN="sepeth"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/address \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
```js JavaScript
bitgo
  .coin('sepeth')
  .wallets()
  .getWallet({ id: '<YOUR_WALLET_ID>' })
  .then(function (wallet) {
    return wallet.createAddress();
  })
  .then(function (newAddress) {
    // print new address details
    console.dir(newAddress);
  });
```

## Consolidate Balance

sepETH held in a native MPC wallet (`"walletVersion": 4`) requires consolidating to the base address to use the maximum spendable amount. sepETH held in other wallet versions doesn't require manual consolidations, because those wallets use automatic forwarder smart contracts.

Consolidation transactions require gas, and therefore require sufficient sepETH in your gas tank. You can consolidate only one asset at a time. When making multiple consolidations, you must wait for confirmation of the prior consolidation before initiating a new consolidation transaction.

You can manually consolidate your balances to the base address using the [Consolidate account (simple)](/reference/expresswalletconsolidateaccount) Express endpoint. To learn more about consolidating, see the [Consolidate Account Balance](/docs/wallets-consolidate) guide.

```shell cURL
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>"
export COIN="sepeth"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ADDRESS_1="<RECEIVE_ADDRESS_1>"
export ADDRESS_2="<RECEIVE_ADDRESS_2>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"

curl -X POST \
  http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/$WALLET_ID/consolidateAccount \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "consolidateAddresses": [
    {
      "address": "'"$ADDRESS_1"'"
    },
    {
      "address": "'"$ADDRESS_2"'"
    }
  ],
    "walletPassphrase": "'"$WALLET_PASSPHRASE"'"
}'
```

## Estimate Fee

You can estimate transaction fees using the [Get Fee Estimate](/reference/v2txgetfeeestimate) endpoint. To learn more about estimating fees, see the [Estimate Fees](/docs/withdraw-estimate-fees) guide.

```shell cURL
export COIN="sepeth"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X GET \
  https://app.bitgo-test.com/api/v2/$COIN/tx/fee \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
```js JavaScript
const BitGoJS = require('../../../src/index.js');
const bitgo = new BitGoJS.BitGo({ env: 'test' });
const accessToken = '<YOUR_ACCESS_TOKEN>';
const coin = 'sepeth';

async function getFeeEstimate() {
  try {
    await bitgo.authenticateWithAccessToken({ accessToken });
    const res = await bitgo.coin(coin).feeEstimate({ numBlocks: 2 });
    console.dir(res);
  } catch (err) {
    console.error('Error fetching fee estimate:', err);
  }
}

getFeeEstimate();
```

## Transact

You can use the `sendMany` function to send sepETH to multiple recipients in one transaction. However, this feature is unavailable for ERC-20 tokens, which only support single-recipient transactions.

For [simple](/docs/withdraw-wallet-type-self-custody-mpc-simple) MPC flows, this feature uses the BitGo JavaScript SDK, to invoke the [Create a signature share for the transaction request](/reference/v2wallettxrequestsignaturesharecreate) and [Get transaction requests by wallet](/reference/v2wallettxrequestget) endpoints. To learn more about transacting, see the [Withdraw](/docs/withdraw-overview) guide.

```js JavaScript
import { BitGoAPI } from '@bitgo/sdk-api';
import { Sepeth } from '@bitgo/sdk-coin-eth';

const bitgo = new BitGoAPI({ env: 'test' });
bitgo.register('sepeth', Sepeth.createInstance);

async function main() {
  await bitgo.authenticateWithAccessToken({ accessToken: '<YOUR_ACCESS_TOKEN>' });
  const wallet = await bitgo.coin('sepeth').wallets().get({ id: '<YOUR_WALLET_ID>' });
  const res = await wallet.sendMany({
    walletPassphrase: '<YOUR_WALLET_PASSPHRASE>',
    recipients: [{ address: '<DESTINATION_ADDRESS>', amount: '<AMOUNT_IN_BASE_UNITS>' }],
    type: 'transfer',
  });
  console.log(res);
}

main().catch((err) => console.error(err));
```
```shell cURL
export BITGO_EXPRESS_HOST="<YOUR_LOCALHOST>"
export COIN="sepeth"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ADDRESS="<DESTINATION_ADDRESS>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"

curl -X POST \
 http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/$WALLET_ID/sendcoins \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "address": "'"$ADDRESS"'",
    "amount": "'"$AMOUNT"'",
    "walletPassphrase": "'"$WALLET_PASSPHRASE"'"
}'
```

## Stake

You can stake sepETH in multiples of 32 sepETH to a whitelisted validator node for testing purposes. Validators propose and attest blocks, earning test rewards for securing the network.

You can stake sepETH from your self-custody wallets using the [Create staking request](/reference/v1stakingrequestcreate) endpoint. To learn more about staking, see the [Staking](/docs/stake-overview) guide.

```shell cURL
export COIN="sepeth"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export CLIENT_ID="<CLIENT_ID>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"
export GAS_PRICE="<GAS_PRICE>"
export TYPE="STAKE"

curl -X POST \
  http://api/staking/v1/$COIN/wallets/$WALLET_ID/requests \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "clientId": "'$CLIENT_ID'",
    "amount": "'$AMOUNT'",
    "gasPrice": "'$GAS_PRICE'",
    "type": "STAKE"
}'
```
```js JavaScript
const stakingWallet = wallet.toStakingWallet();
const stakingRequest = await stakingWallet.stake({
  amount: '<AMOUNT>',
  clientId: '<CLIENT_ID>'
});
```
