Skip to content

Commit

Permalink
Merge pull request #2988 from XRPLF/currency-code-updates
Browse files Browse the repository at this point in the history
Clarify Nonstandard Currency Codes
  • Loading branch information
oeggert authored Feb 12, 2025
2 parents 2969d81 + 6c0b27a commit 36e080f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/_snippets/data_types/currency_code.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The [HTTP / WebSocket APIs](../../references/http-websocket-apis/index.md) support two formats of currency code:

- **[Standard Currency Codes](../../references/protocol/data-types/currency-formats.md#standard-currency-codes):** As a 3-character string such as `"EUR"` or `"USD"`.
- **[Nonstandard Currency Codes](../../references/protocol/data-types/currency-formats.md#nonstandard-currency-codes):** As a 160-bit hexadecimal string, such as `"0158415500000000C1F76FF6ECB0BAC600000000"`. This is uncommon.
- **[Nonstandard Currency Codes](../../references/protocol/data-types/currency-formats.md#nonstandard-currency-codes):** As a 160-bit hexadecimal string, such as `"444F4C4C415259444F4F00000000000000000000"`.

Tokens with the same code can [ripple](../../concepts/tokens/fungible-tokens/rippling.md) across connected trust lines. Currency codes have no other behavior built into the XRP Ledger.
7 changes: 5 additions & 2 deletions docs/references/protocol/data-types/currency-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ At the protocol level, this format is [serialized](../binary-format.md#currency-

### Nonstandard Currency Codes

You can also use a 160-bit (40-character) hexadecimal string such as `015841551A748AD2C1F76FF6ECB0CCCD00000000` as the currency code. To prevent this from being treated as a "standard" currency code, the first 8 bits MUST NOT be `0x00`.
You can also use a 160-bit (40-character) hexadecimal string, such as `444F4C4C415259444F4F00000000000000000000` as the currency code. To prevent this from being treated as a "standard" currency code, the first 8 bits MUST NOT be `0x00`. When using or reading a nonstandard currency code, consider the following:

**Deprecated:** Some previous versions of [ripple-lib](https://github.com/XRPLF/xrpl.js) supported an "interest-bearing" or "demurraging" currency code type. These codes have the first 8 bits `0x01`. Demurraging / interest-bearing currencies are no longer supported, but you may find them in ledger data. For more information, see [Demurrage](../../../concepts/tokens/fungible-tokens/demurrage.md).
- Most interfaces that read currency codes translate them into ASCII when the currency code is nonstandard.
- Not all hexadecimal strings have a direct, human-readable format. See: [Normalize Currency Codes](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/normalize-currency-codes).

**Deprecated:** Some previous versions of [ripple-lib](https://github.com/XRPLF/xrpl.js) supported an "interest-bearing" or "demurraging" currency code type, such as `015841551A748AD2C1F76FF6ECB0CCCD00000000`. These codes have the first 8 bits `0x01`. Demurraging / interest-bearing currencies are no longer supported, but you may find them in ledger data. For more information, see [Demurrage](../../../concepts/tokens/fungible-tokens/demurrage.md).

0 comments on commit 36e080f

Please sign in to comment.