# Enable No Freeze

If you [issue tokens](/docs/concepts/tokens) in the XRP Ledger, can enable the [No Freeze setting](/docs/concepts/tokens/fungible-tokens/freezes#no-freeze) to permanently limit your own ability to use the token freezing features of the XRP Ledger. (As a reminder, this only applies to issued tokens, not XRP.) This tutorial shows how to enable the No Freeze setting on your issuing account.

## Prerequisites

- 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](/docs/tutorials/get-started/get-started-javascript) for setup steps.
- You don't need to have [issued a token](/docs/tutorials/tokens/fungible-tokens/issue-a-fungible-token) in the XRP Ledger to enable No Freeze, but the main reason you would do so is if you intend to or have already issued such a token.


script
script
## Example Code

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

- See [Code Samples: Freeze](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/freeze/) 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. If you use the best practice of having separate ["cold" and "hot" addresses](/docs/concepts/accounts/account-types), you need the **master keys** to the *cold address*, which is the **issuer** of the token. Only the issuer's No Freeze setting has any effect on a token.

You cannot use a [regular key pair](/docs/concepts/accounts/cryptographic-keys) or [multi-signing](/docs/concepts/accounts/multi-signing) to enable the No Freeze setting.

For this tutorial, you can get credentials from the following interface:

Get Testnet credentials

div
Ripple provides the [Testnet and Devnet](/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](/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 a supported [client library](/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()
```

For this tutorial, click the following button to connect:

Connect to Testnet

div
strong
Connection status: 
span
Not connected
### 3. Send AccountSet Transaction

To enable the No Freeze setting, send an [AccountSet transaction](/docs/references/protocol/transactions/types/accountset) with a `SetFlag` field containing the [`asfNoFreeze` value (`6`)](/docs/references/protocol/transactions/types/accountset#accountset-flags). To send the transaction, you first *prepare* it to fill out all the necessary fields, then *sign* it with your account's secret key, and finally *submit* it to the network.

For example:

JavaScript

```js
  // Submit an AccountSet transaction to enable No Freeze ----------------------
  const accountSetTx = {
    TransactionType: "AccountSet",
    Account: wallet.address,
    // Set the NoFreeze flag for this account
    SetFlag: xrpl.AccountSetAsfFlags.asfNoFreeze
  }

  // Best practice for JS users - validate checks if a transaction is well-formed
  xrpl.validate(accountSetTx)

  console.log('Sign and submit the transaction:', accountSetTx)
  await client.submitAndWait(accountSetTx, { wallet: wallet })
```

WebSocket

```json
{
  "id": 12,
  "command": "submit",
  "tx_json": {
    "TransactionType": "AccountSet",
    "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
    "Fee": "12",
    "Flags": 0,
    "SetFlag": 6,
    "LastLedgerSequence": 18124917,
    "Sequence": 4
  },
  "secret": "s████████████████████████████"
}
```

Send AccountSet
Send AccountSet

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. If the XRP Ledger is busy or poor network connectivity delays a transaction from being relayed throughout the network, a transaction may take longer to be confirmed. (For information on how to set an expiration for transactions, see [Reliable Transaction Submission](/docs/concepts/transactions/reliable-transaction-submission).)

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. Confirm Account Settings

After the transaction is validated, you can check your account's settings to confirm that the No Freeze flag is enabled. You can do this by calling the [account_info method](/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info) and checking the value of the account's `Flags` field to see if the [`lsfNoFreeze` bit (`0x00200000`)](/docs/references/protocol/ledger-data/ledger-entry-types/accountroot#accountroot-flags) is enabled.

JavaScript

```js
  // Request account info for my_address to check account settings ------------
  const response = await client.request(
    {command: 'account_info', account: my_address })
  const settings = response.result
  const lsfNoFreeze = xrpl.LedgerEntry.AccountRootFlags.lsfNoFreeze

  console.log('Got settings for address', my_address);
  console.log('No Freeze enabled?',
    (settings.account_data.Flags & lsfNoFreeze) 
    === lsfNoFreeze)
```

WebSocket

```json
Request:

{
  "id": 1,
  "command": "account_info",
  "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
  "ledger_index": "validated"
}

Response:

{
  "id": 4,
  "status": "success",
  "type": "response",
  "result": {
    "account_data": {
      "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
      "AccountTxnID": "41320138CA9837B34E82B3B3D6FB1E581D5DE2F0A67B3D62B5B8A8C9C8D970D0",
      "Balance": "100258663",
      "Domain": "6D64756F31332E636F6D",
      "EmailHash": "98B4375E1D753E5B91627516F6D70977",
      "Flags": 12582912,
      "LedgerEntryType": "AccountRoot",
      "MessageKey": "0000000000000000000000070000000300",
      "OwnerCount": 4,
      "PreviousTxnID": "41320138CA9837B34E82B3B3D6FB1E581D5DE2F0A67B3D62B5B8A8C9C8D970D0",
      "PreviousTxnLgrSeq": 18123095,
      "Sequence": 352,
      "TransferRate": 1004999999,
      "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
      "urlgravatar": "http://www.gravatar.com/avatar/98b4375e1d753e5b91627516f6d70977"
    },
    "ledger_hash": "A777B05A293A73E511669B8A4A45A298FF89AD9C9394430023008DB4A6E7FDD5",
    "ledger_index": 18123249,
    "validated": true
  }
}
```

Confirm Settings
Confirm Settings

div
## See Also

- **Concepts:**
  - [Freezing Issued Currencies](/docs/concepts/tokens/fungible-tokens/freezes)
  - [Trust Lines](/docs/concepts/tokens/fungible-tokens)
- **Tutorials:**
  - [Enact Global Freeze](/docs/tutorials/tokens/fungible-tokens/enact-global-freeze)
  - [Freeze a Trust Line](/docs/tutorials/tokens/fungible-tokens/freeze-a-trust-line)
- **References:**
  - [account_lines method](/docs/references/http-websocket-apis/public-api-methods/account-methods/account_lines)
  - [account_info method](/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info)
  - [AccountSet transaction](/docs/references/protocol/transactions/types/accountset)
  - [TrustSet transaction](/docs/references/protocol/transactions/types/trustset)
  - [AccountRoot Flags](/docs/references/protocol/ledger-data/ledger-entry-types/accountroot#accountroot-flags)
  - [RippleState (trust line) Flags](/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate#ripplestate-flags)