# Dotordinals

[Dot Ordinals](https://dotordinals.io/) is a Dapp designed to create inscriptions tokens DRC-20 or NFTs on polkadot based blockchains.

This is just a fun experimental standard demonstrating that you can create off-chain balance states with inscriptions. It by no means should be considered THE standard for fungibility on polkadot with ordinals, as I believe there are almost certainly better design choices and optimization improvements to be made. Consequently, this is an extremely dynamic experiment, and I strongly discourage any financial decisions to be made on the basis of it's design. I do, however, encourage the polkadot community to tinker with standard designs and optimizations until a general consensus on best practices is met (or to decide that this is a bad idea altogether!).

## Idea

Experiment to see if ordinal theory can facilitate fungibility on polkadot.

* Create a drc-20 with the deploy function
* Mint an amount of drc-20's with the mint function
* Transfer an amount of drc-20's with the transfer function.&#x20;

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

* Deployments initialize the brc-20. Do not affect state
* Mints provide a balance to <mark style="color:red;">**only the first owner**</mark> of the mint function inscription
* Transfers deduct from the senders balance and add to the receivers balance, <mark style="color:red;">**only upon the first transfer**</mark> of the transfer function.&#x20;
  * Inscribe transfer function to senders address&#x20;
  * <mark style="color:red;">**Sender**</mark> <mark style="color:red;">**transfer's transfer function**</mark>

## How to

### Getting a balance

You can either deploy your own or mint from existing deployments

1. <mark style="color:red;">(</mark><mark style="color:red;">**Optional: Only do if you want to create your own drc-20. If not go to step 2**</mark><mark style="color:red;">)</mark> Inscribe the deploy function to you ordinal compatible wallet with the desired drc-20 parameters set.
2. Inscribe the mint function to your ordinal compatible wallet. Make sure the ticker matches either a) the drc-20 you deployed in step 1, or b) any brc-20 that has yet to reach its fully diluted supply. Also if the drc-20 has a mint limit, make sure not to surpass this.

### Transferring a balance

1. Inscribe the transfer function to your ordinal compatible wallet. Make sure the transfer function inscription information is valid before inscribing .&#x20;
2. Once received, (and if valid) send the inscription to the desired destination to transfer the balance.&#x20;

#### What is valid?

A valid transfer function is required to transfer a balance. Validity can be determined by the following:

* Valid transfer functions are ones where the amount stated in the inscription does not exceed <mark style="color:red;">**Available balance**</mark> when inscribed.
* <mark style="color:red;">**Available balance**</mark> defined as: \[<mark style="color:red;">**Overall balance**</mark>] - \[valid/active transfer function inscriptions in wallet (<mark style="color:red;">**Transferable balance**</mark>)]. If there are no valid/active transfer functions held by an address <mark style="color:red;">**Available balance**</mark> and <mark style="color:red;">**Overall balance**</mark> are equivalent.
* Example: A wallet holds an <mark style="color:red;">**Overall balance**</mark> of 1000 "drc", and . The holder then inscribes a transfer function of 700 "drc". Once the inscription is confirmed, the following is true: <mark style="color:red;">**Overall balance**</mark> = 1000, <mark style="color:red;">**Available balance**</mark> = 300, <mark style="color:red;">**Transferable balance**</mark> = 700. If in the next block, the user tried to inscribe a transfer function of 500 "drc", this would not be valid as the maximum amount that can be inscribed is 300 (<mark style="color:red;">**Available balance**</mark>).&#x20;
* If multiple transfer functions are inscribed in the same block, validity is determined by the order the were confirmed in the block.&#x20;

#### Redundancies

* If a user changes their mind and no longer wishes to transfer their transfer function, and wants to restore their <mark style="color:red;">**Available balance**</mark> to the <mark style="color:red;">**Overall balance**</mark> (invalidate <mark style="color:red;">**Transferable balance**</mark>), the user must simply transfer the transfer function inscription to themselves.


# Deploy

<figure><img src="https://3048080048-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0VPqnaPSPHGPo401vxHK%2Fuploads%2Fo5q6U36WGyUUPfdrXihs%2Fimage.png?alt=media&amp;token=07458e8d-54fd-4167-99bc-c2e13fada164" alt=""><figcaption></figcaption></figure>

Create a DRC 20 token

```
{ 
  "p": "drc-20",
  "op": "deploy",
  "tick": "drc",
  "max": "2100000000000000",
  "lim": "100000000"
}
```

<table><thead><tr><th width="97">Key</th><th width="108.33333333333331">Required?</th><th>Description</th></tr></thead><tbody><tr><td>p</td><td>Yes</td><td>Protocol: Helps other systems identify and process drc-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:  identifier of the drc-20</td></tr><tr><td>max</td><td>Yes</td><td>Max supply: set max supply of the drc-20</td></tr><tr><td>lim</td><td>Yes</td><td>Mint limit: limit per inscription</td></tr></tbody></table>


# Mint

<figure><img src="https://3048080048-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0VPqnaPSPHGPo401vxHK%2Fuploads%2FE7vkRzKbcxdNiErriRVf%2Fimage.png?alt=media&amp;token=ca10c7f7-bd10-4e80-8259-03bf9a25d635" alt=""><figcaption></figcaption></figure>

Mint DRC 20 token

```
{ 
  "p": "drc-20",
  "op": "mint",
  "tick": "aval",
  "amt": "100000000"
}
```

<table><thead><tr><th width="85">Key</th><th width="126">Required?</th><th>Description</th></tr></thead><tbody><tr><td>p</td><td>Yes</td><td>Protocol: Helps other systems identify and process drc-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: identifier of the drc-20</td></tr><tr><td>amt</td><td>Yes</td><td>Amount to mint: States the amount of the drc-20 to mint. Has to be less or equal to "lim" </td></tr></tbody></table>


# Transfer

<figure><img src="https://3048080048-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0VPqnaPSPHGPo401vxHK%2Fuploads%2FxB4NhUlQdR2XHoK6dSZM%2FScreenshot%202023-12-19%20at%204.43.37%20PM.png?alt=media&amp;token=f6f2d900-6004-4769-a0e5-b0ea7ace4110" alt=""><figcaption></figcaption></figure>

Transfer DRC 20 token.

```
{ 
  "p": "drc-20",
  "op": "transfer",
  "tick": "aval",
  "amt": "100000000",
  "to": "<ss58 address>"
}
```

<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 drc-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: identifier of the asc-20</td></tr><tr><td>amt</td><td>Yes</td><td>Amount to transfer: States the amount of the asc-20 to transfer.</td></tr></tbody></table>


# Marketplace

Coming soon...


# How to Mint

{% embed url="<https://youtu.be/kbu1nDzkfac>" %}

## Step 1 - Kickstarting the process

1. Install one of the polkadot wallet <https://polkadot.network/ecosystem/wallets/> we recommend <https://polkadot.js.org/apps/>
2. Create an address in polkadot wallet.
3. Fund address with DOT/KSM tokens

<figure><img src="https://3048080048-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0VPqnaPSPHGPo401vxHK%2Fuploads%2FXeUxchLUjMVdnmtUrN6g%2FScreenshot%20from%202023-12-18%2021-08-47.png?alt=media&amp;token=0c9d75f5-d638-4d29-9adf-74d5904ab731" alt=""><figcaption></figcaption></figure>

## Step 2 - Create the Token!&#x20;

1. Go to <https://dotordinals.io/create-token>
2. Fill in the following details
   1. Tick: Token symbol
   2. Total Supply: Max tokens
   3. Limit: Max Amount of tokens that can be minted&#x20;

This creates the token. Now you can mint the token amounts.

<figure><img src="https://3048080048-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0VPqnaPSPHGPo401vxHK%2Fuploads%2FoRyRcF1PYzL3Do9e8rhj%2FScreenshot%20from%202023-12-18%2021-13-07.png?alt=media&amp;token=96adc8a8-4b0b-473c-a24f-1608f9d0ae8d" alt=""><figcaption></figcaption></figure>

## Step 2 - Mint the Token!&#x20;

1. Go to <https://dotordinals.io/mint-token>
2. Fill in the details
   1. Tick: Token symbol from create step
   2. Amount: Number of tokens you want to mint. Should be less than limit above


