# Issue a Fungible Token

Anyone can issue various types of tokens in the XRP Ledger, ranging from informal "IOUs" to fiat-backed stablecoins, purely digital fungible and semi-fungible tokens, and more. This tutorial shows the technical steps of creating a token in the ledger. For more information on how XRP Ledger tokens work, see [Issued Currencies](/es-es/docs/concepts/tokens); for more on the business decisions involved in issuing a stablecoin, see [Stablecoin Issuer](/es-es/docs/use-cases/tokenization/stablecoin-issuer). 

## Prerequisites

- You need two funded XRP Ledger accounts, each with an address, secret key, and some XRP. For this tutorial, you can generate new test credentials as needed.
  - Each address needs enough XRP to satisfy the [reserve requirement](/es-es/docs/concepts/accounts/reserves) including the additional reserve for a trust line.
- You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing.
- You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following:
  - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](/es-es/docs/tutorials/get-started/get-started-javascript) for setup steps.
  - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](/es-es/docs/tutorials/get-started/get-started-python) for setup steps.
  - **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](/es-es/docs/tutorials/get-started/get-started-java) for setup steps.
  - You can also read along and use the interactive steps in your browser without any setup.


script
script
## Example Code

Complete sample code for all of the steps of these tutorials is available under the [MIT license](https://github.com/XRPLF/xrpl-dev-portal/blob/master/LICENSE).

- See [Code Samples: Issue a Fungible Token](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/issue-a-token/) in the source repository for this website.


## Steps

### 1. Get Credentials

To transact on the XRP Ledger, you need an address and secret key, and some XRP. You also need one or more recipients who are willing to hold the tokens you issue: unlike in some other blockchains, in the XRP Ledger you cannot force someone to hold a token they do not want.

The best practice is to use ["cold" and "hot" addresses](/es-es/docs/concepts/accounts/account-types). The cold address is the **issuer** of the token. The hot address is like a regular user's address that you control. It receives tokens from the cold address, which you can then transfer to other users. A hot address is not strictly necessary, since you could send tokens directly to users from the cold address, but it is good practice for security reasons. In production, you should take extra care of the cold address's cryptographic keys (for example, keeping them offline) because it is much harder to replace a cold address than a hot address.

In this tutorial, the hot address receives the tokens you issue from the cold address. You can get the keys for two addresses using the following interface.

Generate
Get Testnet credentials

div
Ripple provides the [Testnet and Devnet](/es-es/docs/concepts/networks-and-servers/parallel-networks) for testing purposes only, and sometimes resets the state of these test networks along with all balances. As a precaution, **do not** use the same addresses on Testnet/Devnet and Mainnet.

When you're building production-ready software, you should use an existing account, and manage your keys using a [secure signing configuration](/es-es/docs/concepts/transactions/secure-signing).

### 2. Connect to the Network

You must be connected to the network to submit transactions to it. The following code shows how to connect to a public XRP Ledger Testnet server with a supported [client library](/es-es/docs/references/client-libraries):

JavaScript

```js
// You can also use a <script> tag in browsers or require('xrpl') in Node.js
import xrpl from 'xrpl'

// Define the network client
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
await client.connect()

// ... custom code goes here

// Disconnect when done (If you omit this, Node.js won't end the process)
client.disconnect()
```

Python

```py
# Connect ----------------------------------------------------------------------
import xrpl
testnet_url = "https://s.altnet.rippletest.net:51234"
client = xrpl.clients.JsonRpcClient(testnet_url)
```

Java

```java
    // Construct a network client ----------------------------------------------
    HttpUrl rippledUrl = HttpUrl
      .get("https://s.altnet.rippletest.net:51234/");
    XrplClient xrplClient = new XrplClient(rippledUrl);
    // Get the current network fee
    FeeResult feeResult = xrplClient.fee();
```

The JavaScript code samples in this tutorial use the [`async`/`await` pattern](https://javascript.info/async-await). Since `await` needs to be used from within an `async` function, the remaining code samples are written to continue inside the `main()` function started here. You can also use Promise methods `.then()` and `.catch()` instead of `async`/`await` if you prefer.

For this tutorial, click the following button to connect:

Connect to Testnet

div
strong
Connection status: 
span
Not connected
### 3. Configure Issuer Settings

First, configure the settings for your cold address (which will become the issuer of your token). Most settings can be reconfigured later, with the following exceptions: 

- [Default Ripple](/es-es/docs/concepts/tokens/fungible-tokens/rippling): **This setting is required** so that users can send your token to each other. It's best to enable it *before* setting up any trust lines or issuing any tokens.
- [Authorized Trust Lines](/es-es/docs/concepts/tokens/fungible-tokens/authorized-trust-lines): (Optional) This setting (also called "Require Auth") limits your tokens to being held *only* by accounts you've explicitly approved. You cannot enable this setting if you already have any trust lines or offers for *any* token.
To use authorized trust lines, you must perform additional steps that are not shown in this tutorial.


Other settings you may want to, optionally, configure for your cold address (issuer):

| Setting | Recommended Value | Summary |
|  --- | --- | --- |
| [Require Destination Tags](/es-es/docs/tutorials/compliance-features/require-destination-tags) | Enabled or Disabled | Enable if you process withdrawals of your token to outside systems. (For example, your token is a stablecoin.) |
| Disallow XRP | Enabled or Disabled | Enable if this address isn't meant to process XRP payments. |
| [Transfer Fee](/es-es/docs/concepts/tokens/fungible-tokens/transfer-fees) | 0–1% | Charge a percentage fee when users send your token to each other. |
| [Tick Size](/es-es/docs/concepts/tokens/decentralized-exchange/ticksize) | 5 | Limit the number of decimal places in exchange rates for your token in the [decentralized exchange](/es-es/docs/concepts/tokens/decentralized-exchange). A tick size of 5-6 reduces churn of almost-equivalent offers and speeds up price discovery compared to the default of 15. |
| [Domain](/es-es/docs/references/protocol/transactions/types/accountset#domain) | (Your domain name) | Set to a domain you own so can [verify ownership of the accounts](/es-es/docs/references/xrp-ledger-toml#account-verification). This can help reduce confusion or impersonation attempts. |


You can change these settings later as well.

Many issuing settings apply equally to all tokens issued by an address, regardless of the currency code. If you want to issue multiple types of tokens in the XRP Ledger with different settings, you should use a different address to issue each different token.

The following code sample shows how to send an [AccountSet transaction](/docs/references/protocol/transactions/types/accountset) to enable the recommended cold address settings:

JavaScript

```js
  // Configure issuer (cold address) settings ----------------------------------
  const cold_settings_tx = {
    "TransactionType": "AccountSet",
    "Account": cold_wallet.address,
    "TransferRate": 0,
    "TickSize": 5,
    "Domain": "6578616D706C652E636F6D", // "example.com"
    "SetFlag": xrpl.AccountSetAsfFlags.asfDefaultRipple,
    // Using tf flags, we can enable more flags in one transaction
    "Flags": (xrpl.AccountSetTfFlags.tfDisallowXRP |
             xrpl.AccountSetTfFlags.tfRequireDestTag)
  }

  const cst_prepared = await client.autofill(cold_settings_tx)
  const cst_signed = cold_wallet.sign(cst_prepared)
  console.log("Sending cold address AccountSet transaction...")
  const cst_result = await client.submitAndWait(cst_signed.tx_blob)
  if (cst_result.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${cst_signed.hash}`)
  } else {
    throw `Error sending transaction: ${cst_result}`
  }
```

Python

```py
# Configure issuer (cold address) settings -------------------------------------
cold_settings_tx = xrpl.models.transactions.AccountSet(
    account=cold_wallet.address,
    transfer_rate=0,
    tick_size=5,
    domain=bytes.hex("example.com".encode("ASCII")),
    set_flag=xrpl.models.transactions.AccountSetAsfFlag.ASF_DEFAULT_RIPPLE,
)

print("Sending cold address AccountSet transaction...")
response = xrpl.transaction.submit_and_wait(cold_settings_tx, client, cold_wallet)
print(response)
```

Java

```java
    // Configure issuer settings -----------------------------------------------
    UnsignedInteger coldWalletSequence = xrplClient.accountInfo(
      AccountInfoRequestParams.builder()
        .ledgerSpecifier(LedgerSpecifier.CURRENT)
        .account(coldWalletKeyPair.publicKey().deriveAddress())
        .build()
    ).accountData().sequence();

    AccountSet setDefaultRipple = AccountSet.builder()
      .account(coldWalletKeyPair.publicKey().deriveAddress())
      .fee(feeResult.drops().minimumFee())
      .sequence(coldWalletSequence)
      .signingPublicKey(coldWalletKeyPair.publicKey())
      .setFlag(AccountSet.AccountSetFlag.DEFAULT_RIPPLE)
      .lastLedgerSequence(computeLastLedgerSequence(xrplClient))
      .build();

    SignatureService<PrivateKey> signatureService = new BcSignatureService();
    SingleSignedTransaction<AccountSet> signedAccountSet = signatureService.sign(
      coldWalletKeyPair.privateKey(), setDefaultRipple
    );

    submitAndWaitForValidation(signedAccountSet, xrplClient);
```

Configure Issuer
form
div
div
input
label
Default Ripple
div
div
input
label
Require Destination Tags
div
div
input
label
Disallow XRP
div
label
Transfer Fee
div
input
div
div
%
div
label
Tick Size
div
input
div
label
Domain
div
div
input
small
(text)
div
div
label
6578616D706C652E636F6D
small
(hexadecimal)
button
Configure issuer
div
### 4. Wait for Validation

Most transactions are accepted into the next ledger version after they're submitted, which means it may take 4-7 seconds for a transaction's outcome to be final. You should wait for your earlier transactions to be fully validated before proceeding to the later steps, to avoid unexpected failures from things executing out of order. For more information, see [Reliable Transaction Submission](/es-es/docs/concepts/transactions/reliable-transaction-submission).

The code samples in this tutorial use helper functions to wait for validation when submitting a transaction:

- **JavaScript:** The `submit_and_verify()` function, as defined in the [submit-and-verify code sample](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/submit-and-verify).
- **Python:** The `submit_and_wait()` [method of the xrpl-py library](https://xrpl-py.readthedocs.io/en/stable/source/xrpl.transaction.html#xrpl.transaction.submit_and_wait).
- **Java:** The `submitAndWaitForValidation()` method in the [sample Java class](https://github.com/XRPLF/xrpl-dev-portal/blob/master/_code-samples/issue-a-token/java/IssueToken.java).


Technically, you can configure the hot address in parallel with configuring the issuer address. For simplicity, this tutorial waits for each transaction one at a time.

table
tbody
tr
th
Transaction ID:
td
(None)
tr
th
Latest Validated Ledger Index:
td
(Not connected)
tr
th
Ledger Index at Time of Submission:
td
(Not submitted)
tr
th
Transaction 
code
LastLedgerSequence
:
td
(Not prepared)
tr
### 5. Configure Hot Address Settings

The hot address does not strictly require any settings changes from the default, but the following are recommended as best practices:

| Setting | Recommended Value | Summary |
|  --- | --- | --- |
| [Default Ripple](/es-es/docs/concepts/tokens/fungible-tokens/rippling) | Disabled | Leave this setting **disabled.** (This is the default.) |
| [Authorized Trust Lines](/es-es/docs/concepts/tokens/fungible-tokens/authorized-trust-lines) | Enabled | Enable this setting on the hot address—and never approve any trust lines to the hot address—to prevent accidentally issuing tokens from the wrong address. (Optional, but recommended.) |
| [Require Destination Tags](/es-es/docs/tutorials/compliance-features/require-destination-tags) | Enabled or Disabled | Enable if you process withdrawals of your token to outside systems. (For example, your token is a stablecoin.) |
| Disallow XRP | Enabled or Disabled | Enable if this address isn't meant to process XRP payments. |
| [Domain](/es-es/docs/references/protocol/transactions/types/accountset#domain) | (Your domain name) | Set to a domain you own so can [verify ownership of the accounts](/es-es/docs/references/xrp-ledger-toml#account-verification). This can help reduce confusion or impersonation attempts. |


The following code sample shows how to send an [AccountSet transaction](/docs/references/protocol/transactions/types/accountset) to enable the recommended hot address settings:

JavaScript

```js
  // Configure hot address settings --------------------------------------------

  const hot_settings_tx = {
    "TransactionType": "AccountSet",
    "Account": hot_wallet.address,
    "Domain": "6578616D706C652E636F6D", // "example.com"
    // enable Require Auth so we can't use trust lines that users
    // make to the hot address, even by accident:
    "SetFlag": xrpl.AccountSetAsfFlags.asfRequireAuth,
    "Flags": (xrpl.AccountSetTfFlags.tfDisallowXRP |
              xrpl.AccountSetTfFlags.tfRequireDestTag)
  }

  const hst_prepared = await client.autofill(hot_settings_tx)
  const hst_signed = hot_wallet.sign(hst_prepared)
  console.log("Sending hot address AccountSet transaction...")
  const hst_result = await client.submitAndWait(hst_signed.tx_blob)
  if (hst_result.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${hst_signed.hash}`)
  } else {
    throw `Error sending transaction: ${hst_result.result.meta.TransactionResult}`
  }
```

Python

```py
# Configure hot address settings -----------------------------------------------
hot_settings_tx = xrpl.models.transactions.AccountSet(
    account=hot_wallet.address,
    set_flag=xrpl.models.transactions.AccountSetAsfFlag.ASF_REQUIRE_AUTH,
)

print("Sending hot address AccountSet transaction...")
response = xrpl.transaction.submit_and_wait(hot_settings_tx, client, hot_wallet)
print(response)
```

Java

```java
    // Configure hot address settings ------------------------------------------
    UnsignedInteger hotWalletSequence = xrplClient.accountInfo(
      AccountInfoRequestParams.builder()
        .ledgerSpecifier(LedgerSpecifier.CURRENT)
        .account(hotWalletKeyPair.publicKey().deriveAddress())
        .build()
    ).accountData().sequence();

    AccountSet setRequireAuth = AccountSet.builder()
      .account(hotWalletKeyPair.publicKey().deriveAddress())
      .fee(feeResult.drops().minimumFee())
      .sequence(hotWalletSequence)
      .signingPublicKey(hotWalletKeyPair.publicKey())
      .setFlag(AccountSet.AccountSetFlag.REQUIRE_AUTH)
      .lastLedgerSequence(computeLastLedgerSequence(xrplClient))
      .build();

    SingleSignedTransaction<AccountSet> signedSetRequireAuth = signatureService.sign(
      hotWalletKeyPair.privateKey(), setRequireAuth
    );
    submitAndWaitForValidation(signedSetRequireAuth, xrplClient);
```

Configure Hot Address
form
div
div
input
label
Default Ripple
div
div
input
label
Authorized Trust Lines
div
div
input
label
Require Destination Tags
div
div
input
label
Disallow XRP
div
label
Domain
div
div
input
small
(text)
div
div
label
6578616D706C652E636F6D
small
(hexadecimal)
button
Configure hot address
div
### 6. Wait for Validation

As before, wait for the previous transaction to be validated by consensus before continuing.

table
tbody
tr
th
Transaction ID:
td
(None)
tr
th
Latest Validated Ledger Index:
td
(Not connected)
tr
th
Ledger Index at Time of Submission:
td
(Not submitted)
tr
th
Transaction 
code
LastLedgerSequence
:
td
(Not prepared)
tr
### 7. Create Trust Line from Hot to Cold Address

Before you can receive tokens, you need to create a [trust line](/es-es/docs/concepts/tokens/fungible-tokens) to the token issuer. This trust line is specific to the [currency code](/es-es/docs/references/protocol/data-types/currency-formats#currency-codes) of the token you want to issue, such as USD or FOO. You can choose any currency code you want; each issuer's tokens are treated as separate in the XRP Ledger protocol. However, users' balances of tokens with the same currency code can [ripple](/es-es/docs/concepts/tokens/fungible-tokens/rippling) between different issuers if the users enable rippling settings.

The hot address needs a trust line like this before it can receive tokens from the issuer. Similarly, each user who wants to hold your token must also create a trust line[¹](#footnotes). Each trust line increases the [reserve requirement](/es-es/docs/concepts/accounts/reserves) of the hot address, so you must hold enough spare XRP to pay for the increased requirement. Your reserve requirement goes back down if you remove the trust line.

A trust line has a "limit" on how much the recipient is willing to hold; others cannot send you more tokens than your specified limit. For community credit systems, you may want to configure limits per individual based on how much you trust that person. For other types and uses of tokens, it is normally OK to set the limit to a very large number.

To create a trust line, send a [TrustSet transaction](/docs/references/protocol/transactions/types/trustset) from the **hot address** with the following fields:

| Field | Value |
|  --- | --- |
| `TransactionType` | `"TrustSet"` |
| `Account` | The hot address. (More generally, this is the account that wants to receive the token.) |
| `LimitAmount` | An object specifying how much, of which token, from which issuer, you are willing to hold. |
| `LimitAmount.currency` | The currency code of the token. |
| `LimitAmount.issuer` | The cold address. |
| `LimitAmount.value` | The maximum amount of the token you are willing to hold. |


The following code sample shows how to send a [TrustSet transaction](/docs/references/protocol/transactions/types/trustset) from the hot address, trusting the issuing address for a limit of 1 billion FOO:

JavaScript

```js
  // Create trust line from hot to cold address --------------------------------
  const currency_code = "FOO"
  const trust_set_tx = {
    "TransactionType": "TrustSet",
    "Account": hot_wallet.address,
    "LimitAmount": {
      "currency": currency_code,
      "issuer": cold_wallet.address,
      "value": "10000000000" // Large limit, arbitrarily chosen
    }
  }

  const ts_prepared = await client.autofill(trust_set_tx)
  const ts_signed = hot_wallet.sign(ts_prepared)
  console.log("Creating trust line from hot address to issuer...")
  const ts_result = await client.submitAndWait(ts_signed.tx_blob)
  if (ts_result.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${ts_signed.hash}`)
  } else {
    throw `Error sending transaction: ${ts_result.result.meta.TransactionResult}`
  }

    // Create trust line from customer_one to cold address --------------------------------
  const trust_set_tx2 = {
    "TransactionType": "TrustSet",
    "Account": customer_one_wallet.address,
    "LimitAmount": {
      "currency": currency_code,
      "issuer": cold_wallet.address,
      "value": "10000000000" // Large limit, arbitrarily chosen
    }
  }

  const ts_prepared2 = await client.autofill(trust_set_tx2)
  const ts_signed2 = customer_one_wallet.sign(ts_prepared2)
  console.log("Creating trust line from customer_one address to issuer...")
  const ts_result2 = await client.submitAndWait(ts_signed2.tx_blob)
  if (ts_result2.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${ts_signed2.hash}`)
  } else {
    throw `Error sending transaction: ${ts_result2.result.meta.TransactionResult}`
  }


  const trust_set_tx3 = {
    "TransactionType": "TrustSet",
    "Account": customer_two_wallet.address,
    "LimitAmount": {
      "currency": currency_code,
      "issuer": cold_wallet.address,
      "value": "10000000000" // Large limit, arbitrarily chosen
    }
  }

  const ts_prepared3 = await client.autofill(trust_set_tx3)
  const ts_signed3 = customer_two_wallet.sign(ts_prepared3)
  console.log("Creating trust line from customer_two address to issuer...")
  const ts_result3 = await client.submitAndWait(ts_signed3.tx_blob)
  if (ts_result3.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${ts_signed3.hash}`)
  } else {
    throw `Error sending transaction: ${ts_result3.result.meta.TransactionResult}`
  }
```

Python

```py
# Create trust line from hot to cold address -----------------------------------
currency_code = "FOO"
trust_set_tx = xrpl.models.transactions.TrustSet(
    account=hot_wallet.address,
    limit_amount=xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount(
        currency=currency_code,
        issuer=cold_wallet.address,
        value="10000000000", # Large limit, arbitrarily chosen
    )
)

print("Creating trust line from hot address to issuer...")
response = xrpl.transaction.submit_and_wait(trust_set_tx, client, hot_wallet)
print(response)
```

Java

```java
    // Create trust line -------------------------------------------------------
    String currencyCode = "FOO";
    ImmutableTrustSet trustSet = TrustSet.builder()
      .account(hotWalletKeyPair.publicKey().deriveAddress())
      .fee(feeResult.drops().openLedgerFee())
      .sequence(hotWalletSequence.plus(UnsignedInteger.ONE))
      .limitAmount(IssuedCurrencyAmount.builder()
        .currency(currencyCode)
        .issuer(coldWalletKeyPair.publicKey().deriveAddress())
        .value("10000000000")
        .build())
      .signingPublicKey(hotWalletKeyPair.publicKey())
      .build();

    SingleSignedTransaction<TrustSet> signedTrustSet = signatureService.sign(
      hotWalletKeyPair.privateKey(), trustSet
    );

    submitAndWaitForValidation(signedTrustSet, xrplClient);
```

Make Trust Line
form
p
Currency code:
div
div
div
div
input
label
Standard:
input
div
div
div
input
label
Non-standard:
input
div
label
Limit:
input
button
Create Trust Line
div
If you use [Authorized Trust Lines](/es-es/docs/concepts/tokens/fungible-tokens/authorized-trust-lines), there is an extra step after this one: the cold address must approve the trust line from the hot address. For details of how to do this, see [Authorizing Trust Lines](/es-es/docs/concepts/tokens/fungible-tokens/authorized-trust-lines#authorizing-trust-lines).

### 8. Wait for Validation

As before, wait for the previous transaction to be validated by consensus before continuing.

table
tbody
tr
th
Transaction ID:
td
(None)
tr
th
Latest Validated Ledger Index:
td
(Not connected)
tr
th
Ledger Index at Time of Submission:
td
(Not submitted)
tr
th
Transaction 
code
LastLedgerSequence
:
td
(Not prepared)
tr
### 9. Send Token

Now you can create tokens by sending a [Payment transaction](/docs/references/protocol/transactions/types/payment) from the cold address to the hot address. This transaction should have the following attributes (dot notation indicates nested fields):

| Field | Value |
|  --- | --- |
| `TransactionType` | `"Payment"` |
| `Account` | The cold address issuing the token. |
| `Amount` | An [token amount](/es-es/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts) specifying how much of which token to create. |
| `Amount.currency` | The currency code of the token. |
| `Amount.value` | Decimal amount of the token to issue, as a string. |
| `Amount.issuer` | The cold address issuing the token. |
| `Destination` | The hot address (or other account receiving the token) |
| `Paths` | Omit this field when issuing tokens. |
| `SendMax` | Omit this field when issuing tokens. |
| `DestinationTag` | Any whole number from 0 to 232-1. You must specify *something* here if you enabled [Require Destination Tags](/es-es/docs/tutorials/compliance-features/require-destination-tags) on the hot address. |


You can use [auto-filled values](/es-es/docs/references/protocol/transactions/common-fields#auto-fillable-fields) for all other required fields.

The following code sample shows how to send a [Payment transaction](/docs/references/protocol/transactions/types/payment) to issue 88 FOO from the cold address to the hot address:

JavaScript

```js
  // Send token ----------------------------------------------------------------
  let issue_quantity = "3800"

  const send_token_tx = {
    "TransactionType": "Payment",
    "Account": cold_wallet.address,
    "DeliverMax": {
      "currency": currency_code,
      "value": issue_quantity,
      "issuer": cold_wallet.address
    },
    "Destination": hot_wallet.address,
    "DestinationTag": 1 // Needed since we enabled Require Destination Tags
                        // on the hot account earlier.
  }

  const pay_prepared = await client.autofill(send_token_tx)
  const pay_signed = cold_wallet.sign(pay_prepared)
  console.log(`Cold to hot - Sending ${issue_quantity} ${currency_code} to ${hot_wallet.address}...`)
  const pay_result = await client.submitAndWait(pay_signed.tx_blob)
  if (pay_result.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${pay_signed.hash}`)
  } else {
    console.log(pay_result)
    throw `Error sending transaction: ${pay_result.result.meta.TransactionResult}`
  }


  issue_quantity = "100"
  const send_token_tx2 = {
    "TransactionType": "Payment",
    "Account": hot_wallet.address,
    "DeliverMax": {
      "currency": currency_code,
      "value": issue_quantity,
      "issuer": cold_wallet.address
    },
    "Destination": customer_one_wallet.address,
    "DestinationTag": 1 // Needed since we enabled Require Destination Tags
                        // on the hot account earlier.
  }

  const pay_prepared2 = await client.autofill(send_token_tx2)
  const pay_signed2 = hot_wallet.sign(pay_prepared2)
  console.log(`Hot to customer_one - Sending ${issue_quantity} ${currency_code} to ${customer_one_wallet.address}...`)
  const pay_result2 = await client.submitAndWait(pay_signed2.tx_blob)
  if (pay_result2.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${pay_signed2.hash}`)
  } else {
    console.log(pay_result2)
    throw `Error sending transaction: ${pay_result2.result.meta.TransactionResult}`
  }


  issue_quantity = "12"
  const send_token_tx3 = {
    "TransactionType": "Payment",
    "Account": customer_one_wallet.address,
    "DeliverMax": {
      "currency": currency_code,
      "value": issue_quantity,
      "issuer": cold_wallet.address
    },
    "Destination": customer_two_wallet.address,
    "DestinationTag": 1 // Needed since we enabled Require Destination Tags
                        // on the hot account earlier.
  }

  const pay_prepared3 = await client.autofill(send_token_tx3)
  const pay_signed3 = customer_one_wallet.sign(pay_prepared3)
  console.log(`Customer_one to customer_two - Sending ${issue_quantity} ${currency_code} to ${customer_two_wallet.address}...`)
  const pay_result3 = await client.submitAndWait(pay_signed3.tx_blob)
  if (pay_result3.result.meta.TransactionResult == "tesSUCCESS") {
    console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${pay_signed3.hash}`)
  } else {
    console.log(pay_result3)
    throw `Error sending transaction: ${pay_result3.result.meta.TransactionResult}`
  }
```

Python

```py
# Send token -------------------------------------------------------------------
issue_quantity = "3840"
send_token_tx = xrpl.models.transactions.Payment(
    account=cold_wallet.address,
    destination=hot_wallet.address,
    amount=xrpl.models.amounts.issued_currency_amount.IssuedCurrencyAmount(
        currency=currency_code,
        issuer=cold_wallet.address,
        value=issue_quantity
    )
)

print(f"Sending {issue_quantity} {currency_code} to {hot_wallet.address}...")
response = xrpl.transaction.submit_and_wait(send_token_tx, client, cold_wallet)
print(response)
```

Java

```java
    // Send token --------------------------------------------------------------
    Payment payment = Payment.builder()
      .account(coldWalletKeyPair.publicKey().deriveAddress())
      .fee(feeResult.drops().openLedgerFee())
      .sequence(coldWalletSequence.plus(UnsignedInteger.ONE))
      .destination(hotWalletKeyPair.publicKey().deriveAddress())
      .amount(IssuedCurrencyAmount.builder()
        .issuer(coldWalletKeyPair.publicKey().deriveAddress())
        .currency(currencyCode)
        .value("3840")
        .build())
      .signingPublicKey(coldWalletKeyPair.publicKey())
      .build();

    SingleSignedTransaction<Payment> signedPayment = signatureService.sign(
      coldWalletKeyPair.privateKey(), payment
    );

    submitAndWaitForValidation(signedPayment, xrplClient);
```

Send Token
form
div
div
label
Send amount:
input
div
span
FOO
div
div
div
div
input
label
DestinationTag:
input
button
Send Token
div
### 10. Wait for Validation

As before, wait for the previous transaction to be validated by consensus before continuing.

table
tbody
tr
th
Transaction ID:
td
(None)
tr
th
Latest Validated Ledger Index:
td
(Not connected)
tr
th
Ledger Index at Time of Submission:
td
(Not submitted)
tr
th
Transaction 
code
LastLedgerSequence
:
td
(Not prepared)
tr
### 11. Confirm Token Balances

You can check the balances of your token from the perspective of either the token issuer or the hot address. Tokens issued in the XRP Ledger always have balances that sum to 0: negative from the perspective of the issuer and positive from the perspective of the holder.

Use the [account_lines method](/docs/references/http-websocket-apis/public-api-methods/account-methods/account_lines) to look up the balances from the perspective of the holder. This lists each trust line along with its limit, balance, and settings.

Use the [gateway_balances method](/docs/references/http-websocket-apis/public-api-methods/account-methods/gateway_balances) to look up balances from the perspective of a token issuer. This provides a sum of all tokens issued by a given address.

Since the XRP Ledger is fully public, you can check the balances of any account at any time without needing any cryptographic keys.

The following code sample shows how to use both methods:

JavaScript

```js
  // Check balances ------------------------------------------------------------
  console.log("Getting hot address balances...")
  const hot_balances = await client.request({
    command: "account_lines",
    account: hot_wallet.address,
    ledger_index: "validated"
  })
  console.log(hot_balances.result)

  console.log("Getting cold address balances...")
  const cold_balances = await client.request({
    command: "gateway_balances",
    account: cold_wallet.address,
    ledger_index: "validated",
    hotwallet: [hot_wallet.address]
  })
  console.log(JSON.stringify(cold_balances.result, null, 2))

  client.disconnect()
}
```

Python

```py
# Check balances ---------------------------------------------------------------
print("Getting hot address balances...")
response = client.request(xrpl.models.requests.AccountLines(
    account=hot_wallet.address,
    ledger_index="validated",
))
print(response)

print("Getting cold address balances...")
response = client.request(xrpl.models.requests.GatewayBalances(
    account=cold_wallet.address,
    ledger_index="validated",
    hotwallet=[hot_wallet.address]
))
print(response)
```

Java

```java
    // Check balances ----------------------------------------------------------
    List<TrustLine> lines = xrplClient.accountLines(
      AccountLinesRequestParams.builder()
        .account(hotWalletKeyPair.publicKey().deriveAddress())
        .ledgerSpecifier(LedgerSpecifier.VALIDATED)
        .build()
    ).lines();
    System.out.println("Hot wallet TrustLines: " + lines);
  }
```

Confirm Balances
Confirm Balances

div
### Next Steps

Now that you've created the token, you can explore how it fits into features of the XRP Ledger:

- Send tokens from the hot address to other users.
- Trade it in the decentralized exchange.
- Monitor for incoming payments of your token.
- Create an [xrp-ledger.toml file](/es-es/docs/references/xrp-ledger-toml) and set up domain verification for your token's issuer.
- Learn about other [features of XRP Ledger tokens](/es-es/docs/concepts/tokens).


## Footnotes

¹ Users can hold your token without explicitly creating a trust line if they buy your token in the [decentralized exchange](/es-es/docs/concepts/tokens/decentralized-exchange). Buying a token in the exchange [automatically creates the necessary trust lines](/es-es/docs/concepts/tokens/decentralized-exchange/offers#offers-and-trust). This is only possible if someone is selling your token in the decentralized exchange.