# runes\_etch

Use the `runes_etch` method to execute a Rune etch order, and prompt your user to sign the funding transaction required to process the order.

{% hint style="info" %}
You can use the [`runes_estimateEtch`](https://docs.xverse.app/sats-connect/bitcoin-methods/etch-runes/runes_estimateetch) method to estimate the cost of a Rune mint order for your user, before executing it.
{% endhint %}

You can specify the characteristics of the Runes etch order you wish to execute, by passing a `RunesEtchParams` object to the method, with the below properties:

<table><thead><tr><th width="262">RunesEtchParams Property </th><th>Description</th></tr></thead><tbody><tr><td><code>runeName</code></td><td>a string representing the <a href="https://docs.ordinals.com/runes.html#name">name of the Rune </a>to etch</td></tr><tr><td><code>divisibility</code> <br>(<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a number representing the rune's <a href="https://docs.ordinals.com/runes.html#divisibility">divisibility</a>, i.e. how finely it may be divided into its atomic units. Divisibility is expressed as the number of digits permissible after the decimal point in an amount of runes. The default value is 0.</td></tr><tr><td><code>symbol</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a string representing the rune's currency <a href="https://docs.ordinals.com/runes.html#symbol">symbol</a> as a single <a data-footnote-ref href="#user-content-fn-1">Unicode code point</a>. If a rune does not have a symbol, the generic currency sign <code>¤</code>, also called a scarab, should be used</td></tr><tr><td><code>premine</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional) </td><td>a string representing rune <a href="https://docs.ordinals.com/runes.html#premine">premine</a>: the amount of rune units which the etcher can optionally allocate to themselves.</td></tr><tr><td><code>isMintable</code> </td><td>a boolean indicating if the rune may have an open mint, allowing anyone to create and allocate units of that rune for themselves.</td></tr><tr><td><code>terms</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional) </td><td><p>an object describing the <a href="https://docs.ordinals.com/runes.html#terms">terms</a> governing minting if the rune is mintable, with the below properties:</p><ul><li><code>amount</code> a string representing the fixed amount of new units of the rune that each mint transaction creates</li><li><code>cap</code> a string representing the number of times a rune may be minted.</li><li><code>heightStart</code> the mint is open starting in the block with the given start height.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>Optional</li><li><code>heightEnd</code> the rune may not be minted in or after the block with the given end height.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>Optional</li><li><code>offsetStart</code> the mint is open starting in the block whose height is equal to the start offset plus the height of the block in which the rune was etched.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>Optional</li><li><code>offsetEnd</code> the rune may not be minted in or after the block whose height is equal to the end offset plus the height of the block in which the rune was etched.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>Optional</li></ul></td></tr><tr><td><code>inscriptionDetails</code> <br>(<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional) </td><td><p>You can optionally use the Rune etching transactions to <strong>create an inscription</strong>:<br>- the etched Runes will be <strong>linked</strong> to the inscription, which marketplaces and apps can use as logo<br>-  the inscription will be sent to the specified <code>destinationAddress</code>, along with  the premined Runes<br><br>If  you wish to use that option, pass an <code>inscriptionDetails</code> object with the below properties to specify the content to inscribe:</p><ul><li><code>contentType</code> a string representing the content/mime type of the content being inscribed. Make sure you extract and pass the correct content type for the content you wish to inscribe</li><li><code>contentBase64</code> a string representing the content you wish to inscribe, encoded in Base64 format</li></ul></td></tr><tr><td><code>delegateInscriptionId</code> <br>(<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional) </td><td><p>If you wish to use the Rune etching transactions to create an inscription, you can optionally nominate a <a href="https://docs.ordinals.com/inscriptions/delegate.html">delegate</a> for your inscription, as an <strong>alternative</strong> to specifying its content with <code>inscriptionDetail</code> (see above)</p><p></p><p>You can <strong>instead</strong> choose to pass a <code>delegateInscriptionId</code> string representing the inscription ID of the delegate.</p></td></tr><tr><td><code>turbo</code> <br>(<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a boolean marking the rune etching as opting into future rune protocol changes if set to <code>true</code> <br>According to the <a href="https://docs.ordinals.com/runes/specification.html">Runes specifications</a>: <em>These protocol changes may increase light client validation costs, or just be highly degenerate</em> <br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>the default value is <code>false</code> </td></tr><tr><td><code>destinationAddress</code></td><td><p>The Bitcoin address to which the minted runes should be allocated.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>If minting Runes for your user, you can fetch their wallet addresses with the <a href="../../wallet-methods/wallet_getaccount">getAccounts</a> method. </p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> We recommend managing runes holdings on taproot/ordinal addresses.</p></td></tr><tr><td><code>feeRate</code></td><td>a number representing the desired fee rate to set for the Rune etch transactions, in sats per vbytes</td></tr><tr><td><code>appServiceFee</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a number representing the sats value of the fee to charge your user for your service. </td></tr><tr><td><code>appServiceFeeAddress</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a string representing the Bitcoin address which will receive the  <code>appServiceFee</code>, if a fee is specified</td></tr><tr><td><code>refundAddress</code></td><td>The Bitcoin address to which the amount of the funding transaction should be returned, should the etch order fail.<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> If etching Runes for your user, you can fetch their wallet addresses with the <a href="../../wallet-methods/wallet_getaccount">getAccounts</a> method.<br><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> We recommend managing refunds on Bitcoin <strong>payment</strong> addresses.</td></tr><tr><td><code>network</code> (<span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> optional)</td><td>a string representing the Bitcoin network to use for the etch transactions: <code>'Mainnet'</code> or <code>'Testnet'</code></td></tr></tbody></table>

```typescript
import { request } from "sats-connect";

     const response = await request('runes_etch', {
      runeName: "UNCOMMONGOODS",
      premine: ,
      isMintable: ,
      destinationAddress: ,
      // add request params described above
      refundAddress: paymentAddress,
    });

    if (response.status === 'success') {
      setFundTxId(response.result.fundTransactionId);
    } else {
      console.error(response.error);
      alert('Error etching UNCOMMONGOODS. See console for details.');
    }
  };
```

The `runes_etch` method will trigger the following workflow:

1. Create an etch Runes order for Sats Connect to process, identified by an `orderId`
2. Prompt your user to sign a send Bitcoin transaction with their [connected](https://docs.xverse.app/sats-connect/connecting-to-the-wallet) Bitcoin payment address, to fund the Runes etch order. The funds are sent to a Sats Connect funding address dedicated to processing the order.&#x20;
3. return a `RunesEtchResponse` object to your app:

<table><thead><tr><th width="296">RunesEtchResponse property </th><th>Description</th></tr></thead><tbody><tr><td><code>orderId</code></td><td>a string representing the ID of the Runes etch order created by Sats Connect.</td></tr><tr><td><code>fundTransactionId</code></td><td>a string representing the ID of the funding transaction required from your user for Sats Connect to process the Runes etch order.</td></tr><tr><td><code>fundingAddress</code> </td><td>a string representing the BTC address which will collect the funds required to process the order, and sign the required etch transactions to process the order.</td></tr></tbody></table>

4. Sats Connect uses a two-phase commit/reveal procedure to process your order and etch the rune:
   * The funding transaction for the order also acts as a *commit* transaction: it contains a taproot output committing to a script containing the Rune to etch (and optionally the inscription content, if you chose to link an inscription with either `inscriptionDetails` or `delegateInscriptionId`)
   * **Once the commit transaction has reached 6 block confirmations**, Sats Connect will craft & broadcast a reveal transaction, which etches the rune (and optionally reveals your linked inscription). The reveal transaction is broadcast at the desired `feeRate` specified in the request, and signed with the funding address for the order. This mechanism protects your rune etching from mempool detection and front-running.
5. Sats Connect will then monitor the confirmation of the funding transaction required from your user to the funding address, as well as the confirmation of the rune reveal transaction. You can track the status of a Rune etch order using the [`runes_getOrder`](https://docs.xverse.app/sats-connect/bitcoin-methods/runes_getorder) method.&#x20;

{% hint style="info" %}
Sats Connect charges a 2,000 sats fee for every rune etching order.&#x20;
{% endhint %}

[^1]:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xverse.app/sats-connect/bitcoin-methods/etch-runes/runes_etch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
