> For the complete documentation index, see [llms.txt](https://docs.coss.ink/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coss.ink/crc-20-specs.md).

# CRC-20 Specs

## Operations

### Deploy

```json
{ 
  "p": "crc-20",
  "op": "deploy",
  "tick": "coss",
  "max": "21000000",
  "lim": "1000"
}
```

| Key  | Required ? | Description                                                        |
| ---- | ---------- | ------------------------------------------------------------------ |
| p    | Yes        | Protocol: Helps other systems identify and process crc-20 events   |
| op   | Yes        | Operation: Type of event (Deploy, Mint, Transfer)                  |
| tick | Yes        | Ticker: 4 letter identifier of the crc-20                          |
| max  | Yes        | Max supply: set max supply of the crc-20                           |
| lim  | No         | Mint limit: If letting users mint to themsleves, limit per ordinal |

### Mint

```json
{ 
  "p": "crc-20",
  "op": "mint",
  "tick": "coss",
  "amt": "1000"
}
```

| Key  | Required? | Description                                                                                        |
| ---- | --------- | -------------------------------------------------------------------------------------------------- |
| p    | Yes       | Protocol: Helps other systems identify and process crc-20 events                                   |
| op   | Yes       | Operation: Type of event (Deploy, Mint, Transfer)                                                  |
| tick | Yes       | Ticker: 4 letter identifier of the crc-20                                                          |
| amt  | Yes       | Amount to mint: States the amount of the crc-20 to mint. Has to be less than "lim" above if stated |

###

### Transfer

```json
{ 
  "p": "crc-20",
  "op": "transfer",
  "tick": "coss",
  "amt": "100"
}
```

<table><thead><tr><th width="99">Key</th><th width="127">Required?</th><th>Description</th></tr></thead><tbody><tr><td>p</td><td>Yes</td><td>Protocol: Helps other systems identify and process crc-20 events</td></tr><tr><td>op</td><td>Yes</td><td>Operation: Type of event (Deploy, Mint, Transfer)</td></tr><tr><td>tick</td><td>Yes</td><td>Ticker: 4 letter identifier of the crc-20</td></tr><tr><td>amt</td><td>Yes</td><td>Amount to transfer: States the amount of the crc-20 to transfer.</td></tr></tbody></table>

### Approve

```json
{
    "op": "aprv",
    "amt": "1000000",
    "tick": "coss",
    "p": "crc-20"
}
```

* tx to\_address: authorisation address
* amt=0: cancellation of authorisation
* amt>0: user's COSS will be frozen from the balance, and no other transfers can be made, or re-approved.

### Proxy-trade

```json
{
    "op": "ptrd",
    "tick": "coss",
    "amt": "110962",
    "p": "crc-20",
    "f": "cosmos1xxxxxxxxxxxx",
    "s": "sXAj67rdH7bh5i5hwG4RIw+F0kgQwGC0iaqTp0SH1KxA8xv2bl85kLTj+bp9AJLArCkLgTbbMf5Jx4gRfaQYNQ==",
    "msg": "ts:2024-01-27T12:19:14Z,price:27uatom"
}
```

* f: the seller wallet address
* s: msg’s signature by seller
* msg: include expiry time, sell price, authorized wallet. Due to the limit size of Cosmos memo, to\_address in tx is used as the authorized wallet in msg. For example, coss\_market’s address is cosmos1yzwlf5c35e3ueevt7w6md3v8s4n40uczacxmzw. So the final msg which indexer will check signature is: ts:2024-01-27T12:19:14Z,price:27uatom,to:cosmos1yzwlf5c35e3ueevt7w6md3v8s4n40uczacxmzw
* msg.ts: the UTC time at which the signature expires.
* msg.price: the price of each tick (in this case, COSS)
* indexer
  * check if the signature is OK, indexer collects seller's pub\_key in advance
  * check if ts is expired
  * check amt x price == tx number of coins (ATOM in this case)
  * check amt quantity <=approve quantity
  * if all the above are OK, execute update the quantity of approve(decrease)
  * Execute transfer COSS to to\_address

## Notes

* The first deployment of a ticker is the only one that has claim to the ticker. Tickers are not case sensitive (ATOM = atom).&#x20;
* If two events occur in the same block, prioritization is assigned via order they were confirmed in the block. (first to last).
* The first mint to exceed the maximum supply will receive the fraction that is valid. (ex. 21,000,000 maximum supply, 20,999,242 circulating supply, and 1000 mint inscription will get 758 balance).
* Maximum supply cannot exceed uint64\_max.

##
