runes_etch
Last updated
Last updated
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.
You can use the runes_estimateEtch
method to estimate the cost of a Rune mint order for your user, before executing it.
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:
RunesEtchParams Property | Description |
---|---|
The runes_etch
method will trigger the following workflow:
Create an etch Runes order for Sats Connect to process, identified by an orderId
Prompt your user to sign a send Bitcoin transaction with their connected Bitcoin payment address, to fund the Runes etch order. The funds are sent to a Sats Connect funding address dedicated to processing the order.
return a RunesEtchResponse
object to your app:
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.
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
method.
Sats Connect charges a 2,000 sats fee for every rune etching order.
RunesEtchResponse property | Description |
---|---|
orderId
a string representing the ID of the Runes etch order created by Sats Connect.
fundTransactionId
a string representing the ID of the funding transaction required from your user for Sats Connect to process the Runes etch order.
fundingAddress
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.
runeName
a string representing the name of the Rune to etch
a number representing the rune's divisibility, 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.
a string representing the rune's currency symbol as a single . If a rune does not have a symbol, the generic currency sign ¤
, also called a scarab, should be used
a string representing rune premine: the amount of rune units which the etcher can optionally allocate to themselves.
isMintable
a boolean indicating if the rune may have an open mint, allowing anyone to create and allocate units of that rune for themselves.
an object describing the terms governing minting if the rune is mintable, with the below properties:
amount
a string representing the fixed amount of new units of the rune that each mint transaction creates
cap
a string representing the number of times a rune may be minted.
You can optionally use the Rune etching transactions to create an inscription:
- the etched Runes will be linked to the inscription, which marketplaces and apps can use as logo
- the inscription will be sent to the specified destinationAddress
, along with the premined Runes
If you wish to use that option, pass an inscriptionDetails
object with the below properties to specify the content to inscribe:
contentType
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
contentBase64
a string representing the content you wish to inscribe, encoded in Base64 format
If you wish to use the Rune etching transactions to create an inscription, you can optionally nominate a delegate for your inscription, as an alternative to specifying its content with inscriptionDetail
(see above)
You can instead choose to pass a delegateInscriptionId
string representing the inscription ID of the delegate.
destinationAddress
feeRate
a number representing the desired fee rate to set for the Rune etch transactions, in sats per vbytes
a number representing the sats value of the fee to charge your user for your service.
a string representing the Bitcoin address which will receive the appServiceFee
, if a fee is specified
refundAddress
a string representing the Bitcoin network to use for the etch transactions: 'Mainnet'
or 'Testnet'
divisibility
( optional)
symbol
( optional)
premine
( optional)
terms
( optional)
heightStart
the mint is open starting in the block with the given start height.
Optional
heightEnd
the rune may not be minted in or after the block with the given end height.
Optional
offsetStart
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.
Optional
offsetEnd
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.
Optional
inscriptionDetails
( optional)
delegateInscriptionId
( optional)
turbo
( optional)
a boolean marking the rune etching as opting into future rune protocol changes if set to true
According to the Runes specifications: These protocol changes may increase light client validation costs, or just be highly degenerate
the default value is false
The Bitcoin address to which the minted runes should be allocated. If minting Runes for your user, you can fetch their wallet addresses with the getAccounts method.
We recommend managing runes holdings on taproot/ordinal addresses.
appServiceFee
( optional)
appServiceFeeAddress
( optional)
The Bitcoin address to which the amount of the funding transaction should be returned, should the etch order fail. If etching Runes for your user, you can fetch their wallet addresses with the getAccounts method. We recommend managing refunds on Bitcoin payment addresses.
network
( optional)