> For the complete documentation index, see [llms.txt](https://op20labs.gitbook.io/op-20-experiment/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://op20labs.gitbook.io/op-20-experiment/op-20.md).

# op-20

## Concept

Experiment to see if op\_return can facilitate fungibility on bitcoin

* Create an op-20 with the deploy function
* Mint an amount of op-20's with the mint function
* Transfer an amount of op-20's with the transfer function.

op-20 balance state can be found by aggregating all of these function's activity together.

* Deployments initialize the op-20. Do not affect state
* Mints provide a balance to **only the first owner** of the mint function inscription (add field)
* Transfers deduct from the senders balance and add to the receivers balance, **only upon the first transfer** of the transfer function.

### Note

First inscription was recorded at block height&#x20;

```javascript
895524
```

With the deployment of op\_return token

### Getting a balance <a href="#getting-a-balance" id="getting-a-balance"></a>

You can either deploy your own or 'first is first' mint from existing deployments

1. (**Optional: Only do if you want to create your own op-20. If not go to step 2**) embed the deploy function on op\_return.
2. Embed the mint function to your taproot compatible wallet. Make sure the ticker matches an op-20 that has yet to reach its fully diluted supply. Also, if the op-20 has a mint limit, make sure not to surpass this.

### Transferring a balance <a href="#transferring-a-balance" id="transferring-a-balance"></a>

1. Embed the transfer function to your taproot compatible wallet. Make sure the transfer function embed information is valid before inscribing.

### Rules

* The first deployment of a ticker is the only one that has claim to the ticker. Tickers are not case sensitive (DOGE = doge).
* Use a valid ordinal compatible taproot address
* If two events occur in the same block, prioritization is assigned via order they were confirmed in the block. (first to last).
* The mint function and the second step of the transfer function are the only events that cause changes in balances
* Number of decimals cannot exceed 18 (default)
* The first mint to exceed the maximum supply will receive the fraction that is valid.
* Only one op\_return per transaction

### Indexers

* <https://indexer.op20labs.xyz/> (OP20labs)
* <https://bitcoinuniverse.io/index> (Bitcoin Universe)

## Operations

### Deploy op-20

{% code fullWidth="true" %}

```
{
 "p": "op-20", 
 "op": "deploy", 
 "tick": "op_return",
 "max": "2100000", 
 "lim": "1000", 
 "add": "bc1pkn378kl0rk8sdgyh0qm98arsfq97x7amc726rapxsu7shv5e2mhswf9a2p" 
}
```

{% endcode %}

**Field descriptions:**

* p: Protocol identifier, fixed as op-20.
* op: Type of event (Deploy, Mint, Transfer)
* tick: letter identifier of the op-20
* max: set max supply of the op-20
* lim: limit per mint
* add: deployer address field&#x20;

### Mint op-20

```
{ 
 "p": "op-20",
 "op": "mint", 
 "tick": "op_return", 
 "amt": "1000", 
 "add":"bc1pkn378kl0rk8sdgyh0qm98arsfq97x7amc726rapxsu7shv5e2mhswf9a2p" 
}
```

**Field descriptions:**

* p: Protocol identifier, fixed as op-20.
* op: Type of event (Deploy, Mint, Transfer)
* tick: letter identifier of the op-20
* amt: Amount to mint: States the amount of the op-20 to mint. Has to be less than "lim" above if stated
* add: States the address tokens are minted to

### **Transfer op-20**

{% code fullWidth="true" %}

```
  { 
  "p": "op-20",
  "op": "transfer",
  "tick": "op_return", 
  "amt": "1000" 
  }
```

{% endcode %}

Field descriptions:&#x20;

* "p": Protocol identifier, fixed as  op-20
* "op": Operation type (transfer)
* "tick": letter identifier of the op-20
* "amt": Amount to transfer&#x20;

#### Transfer Overview

This transfer inscription is bound to a specific UTXO. The recipient of the UTXO automatically becomes the new token holder. No separate "add" field is required, as the ownership is embedded in the UTXO. **UTXO Merging for OP-20** When a transfer or bulk buy is created using multiple UTXOs as inputs:

* The balances from each UTXO are summed.
* The resulting output is a single UTXO holding the total combined amount.

**Example:** Inputs: UTXO #1: 300 tokens UTXO #2: 700 tokens Output: Recipient receives 1 UTXO with 1000 tokens. This model:

* Reduces dust UTXOs
* Simplifies wallet management
* Optimizes marketplace and trading flows
