clarify nonstandard currency codes

This commit is contained in:
Oliver Eggert
2025-02-07 16:33:01 -08:00
parent ce7868fdf7
commit a8166bd0fe
2 changed files with 6 additions and 3 deletions

View File

@@ -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.

View File

@@ -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).