|
| 1 | +--- |
| 2 | +blurb: Deep Freeze ensures that frozen token holders can neither send nor receive frozen funds until their trust line is unfrozen. |
| 3 | +labels: |
| 4 | + - Tokens |
| 5 | + - Freeze |
| 6 | + - Deep Freeze |
| 7 | +--- |
| 8 | +# Deep Freeze |
| 9 | + |
| 10 | +Deep Freeze lets token issuers on the XRP Ledger prevent token misuse by frozen account holders. It enhances interactions between frozen assets and payments, ensuring that frozen token holders cannot receive funds until or unless their trust line is unfrozen. These changes enable token issuers to more easily comply with regulations on the XRPL. For example, it prevents tokens from flowing to wallets identified on sanctions lists, thereby enhancing regulatory compliance for use cases such as regulated stablecoins and real-world assets (RWA). |
| 11 | + |
| 12 | +Deep Freeze impacts trust lines that interact with payments, offers, DEX, and AMM. Issuers can block sending and receiving of funds for holders in deep freeze. |
| 13 | + |
| 14 | +## Deep Freeze Mechanism |
| 15 | + |
| 16 | +Deep Freeze is a setting on a trust line. It requires that the issuer implement a standard freeze on the trust line before enacting a deep freeze. The issuer cannot enact a deep freeze if they have enabled `No Freeze` on their account. |
| 17 | + |
| 18 | +When an issuer enacts a deep freeze, the following rules apply to the tokens in that trust line: |
| 19 | + |
| 20 | +- Payments can still occur directly between the two parties of the deep-frozen trust line. |
| 21 | +- The counterparty of that trust line can no longer increase or decrease its balance on the deep-frozen trust line, except in direct payments to the issuer. The counterparty can only send the deep-frozen currencies directly to the issuer. |
| 22 | +- The counterparty can neither send nor receive from others on the deep-frozen trust line. |
| 23 | +- The counterparty's offers to buy or sell the tokens in the deep-frozen trust line are considered unfunded. |
| 24 | + |
| 25 | +An individual address can deep freeze its trust line to an issuer or financial institution. This has no effect on transactions between the institution and other users. However, it does the following: |
| 26 | + |
| 27 | +- It prevents other addresses from sending that financial institution's tokens to the individual address. |
| 28 | +- It also prevents the individual address from sending the token to other non-issuer addresses. |
| 29 | + |
| 30 | +### RippleState Object |
| 31 | + |
| 32 | +Deep Freeze introduces two flags, `lsfLowDeepFreeze` and `lsfHighDeepFreeze`, in the `RippleState` (trust line) object. |
| 33 | + |
| 34 | +| Flag Name | Flag Value | Description | |
| 35 | +|-----------|-------------|-------------| |
| 36 | +| `lsfLowDeepFreeze` | `0x02000000` | The low account has deep-frozen the trust line, preventing the high account from sending and receiving the asset. | |
| 37 | +| `lsfHighDeepFreeze` | `0x04000000` | The high account has deep-frozen the trust line, preventing the low account from sending and receiving the asset. | |
| 38 | + |
| 39 | +See [High vs. Low Account](../../../references/protocol/ledger-data/ledger-entry-types/ripplestate.md#high-vs-low-account). |
| 40 | + |
| 41 | +### TrustSet Transaction |
| 42 | + |
| 43 | +Deep Freeze introduces two flags, `tfSetDeepFreeze` and `tfClearDeepFreeze`, in the `TrustSet` transaction. |
| 44 | + |
| 45 | +| Flag Name | Flag Value | Description | |
| 46 | +|-----------|-------------|-------------| |
| 47 | +| `tfSetDeepFreeze` | `0x00400000` | Deep freeze the trust line. | |
| 48 | +| `tfClearDeepFreeze` | `0x00800000` | Clear a deep-freeze on the trust line. | |
| 49 | + |
| 50 | +A `TrustSet` transaction trying to set `tfSetDeepFreeze` succeeds if and only if one of the following is true: |
| 51 | + |
| 52 | +- The holder is already frozen, indicated by `lsfLowFreeze`/`lsfHighFreeze` on the trust line. |
| 53 | +- `tfSetFreeze` is also set in the same `TrustSet` transaction. |
| 54 | + |
| 55 | +Deep Freeze introduces an additional restriction on `TrustSet`: |
| 56 | + |
| 57 | +If the trust line is deep-frozen by the issuer (indicated by `lsfLowDeepFreeze`/`lsfHighDeepFreeze`), the `TrustSet` transaction fails if the issuer sets the `tfClearFreeze` flag without also setting the `tfClearDeepFreeze` flag. In other words, the issuer cannot clear the regular freeze on a trust line without also clearing the deep freeze. |
| 58 | + |
| 59 | +## Payment Engine |
| 60 | + |
| 61 | +Payment Engine executes paths that are made of steps to connect the sender to the receiver. In general, funds can be deposited into a trust line through one of two steps: |
| 62 | + |
| 63 | +- [Rippling](#rippling) |
| 64 | +- [Order book or AMM](#order-book) |
| 65 | + |
| 66 | +### Rippling |
| 67 | + |
| 68 | +Receipt of funds in a deep-frozen trust line as a result of a rippling step will fail. |
| 69 | + |
| 70 | +### Order Book |
| 71 | + |
| 72 | +If an offer owner is deep-frozen for the `TakerPays` token (buy amount), any offer is considered to be unfunded and the offer fails. |
| 73 | + |
| 74 | +## OfferCreate transaction |
| 75 | + |
| 76 | +Deep Freeze requires a change to the `OfferCreate` transaction: |
| 77 | + |
| 78 | +`OfferCreate` returns `tecFROZEN` if the `TakerPays` (buy amount) token has been deep-frozen by the issuer. |
| 79 | +Moreover, any existing offers where the owner has been deep-frozen on the `TakerPays` token can no longer be consumed. It is considered an unfunded offer that is implicitly cancelled by new offers that cross it. |
| 80 | + |
| 81 | +## How does MPT freeze/lock behavior differ from IOU? |
| 82 | + |
| 83 | +The Multi-Purpose Token (MPT) freeze/lock functionality differs somewhat from how IOUs work. When an MPT holder is locked, they cannot send or receive MPT payments, so a single flag is sufficient. |
| 84 | + |
| 85 | +For IOUs, the regular freeze only disallows sending. If the issuer wants to block receiving as well, they must apply a deep freeze. |
0 commit comments