radFi OP_12
radFi utilizes OP_12
as a key component of its Automated Market Maker (AMM) system. Unlike its traditional usage as a simple numeric constant in Bitcoin Script, radFi repurposes OP_12
to encode structured AMM data within dust value outputs. This allows RadFi to facilitate decentralized token AMM using Bitcoin-native transactions.
How radFi Uses OP_12
In radFi’s AMM design, a dust value output containing OP_12
encodes details such as:
Transaction type (provide liquidity, swap, withdraw liquidity)
Input and output asset amounts
Token identifiers
Trading fee information
Price range for limit orders (if applicable)
This approach enables fully on-chain AMM execution while remaining lightweight and efficient.
OP_12 Structure
Each radFi transaction contains at least 1 OP_12
data output formatted as follows:
# RadFi AMM Script
# Example: Swap Rune for BTC
OP_12 # RadFi Flag (Indicates a RadFi transaction)
OP_PUSHBYTES_23 # Mark the size of swap data
02818080b08a83b7f6d39801930a4564ac8636bf020000 # Swap data
Innovating Bitcoin DeFi
radFi’s repurposing of OP_12
for encoding demonstrates how Bitcoin Script can be extended to support DeFi applications on-chain natively, without smart contracts. By embedding structured data in dust UTXOs, radFi enables efficient AMM-based txs while maintaining the security and transparency of Bitcoin’s UTXO model.
For the complete radFi OP_12
usage structure, refer to Bitcoin Data Availability.
Last updated