Skip to content

Commit

Permalink
Update documentation for ordinals
Browse files Browse the repository at this point in the history
  • Loading branch information
sosaucily committed Nov 20, 2023
1 parent ec82297 commit c5d29a2
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions docs/Ordinal.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
# Ordinal Support

It is possible to use an ordinal as part of the collateral of a DLC.
To do so, an [`OrdDescriptor`](../dlc-manager/src/contract/ord_descriptor.rs) must be used.
This descriptor contains information about the ordinal being included in the DLC (location in the blockchain and the transaction that includes is), as well as information about the event upon which the DLC is based.
This library now supports the locking of an ordinal as part of the collateral of a DLC.

Notes:
* An ordinal is inscribed into a single satoshi. However, that satoshi is often part of a larger UTXO. DLCs lock UTXOs, so please keep that context in mind.

* In all cases, the gas fee to lock and later unlock the DLC is split between both parties.

* For more information about DLCs, please see the main folder of this repo, the [`DLC-Link docs page`](https://docs.dlc.link), https://github.com/dlc-link, and the main https://github.com/discreetlogcontracts/dlcspecs specifications page.

> Resizing UTXOs
>
> Please note, this package does not currently support the re-sizing of the UTXO containing the ordinal within the DLC. See [this section](#changing-postage) for more details

## Supported types of DLCs

### DLC with only the ordinal
This package supports the use case when the offering party of the DLC locks the ordinal-containing UTXO into the DLC, and the counter-party (the acceptor) does not lock any collateral.

In this case, the outcome is essentially binary, either the ordinal containing UTXO goes to the offeror, or the acceptor.

### Ordinal with additional collateral
This package also supports the case when the offering party of the DLC locks the ordinal-contianing UTXO into the dlc, AND any amount of addition collateral is locked into the DLC by either party.

1. In this case, the outcome of the UTXO containing the ordinal will go to either party A or B, without resizing (as described earlier)
2. The remaining collateral locked by either, or both, parties can be split between the parties based on the standard DLC enumerated or numerical outcome guidelines.

### Locking an ordinal in the DLC

To lock an ordinal, an [`OrdDescriptor`](../dlc-manager/src/contract/ord_descriptor.rs) must be used. This descriptor contains information about the ordinal being included in the DLC (location in the blockchain and the transaction that includes is), as well as information about the event upon which the DLC is based.

Event outcomes can be, as for regular contracts, enumerated or numerical.

## Enumerated events

Ordinal DLCs based on enumerated events include, in addition to the regular enumerated event information, an array of boolean indicating for each possible outcome whether the ordinal should be given to the offer party (note this means that this array *must* be have the same number of elements as there are possible outcomes).
Ordinal DLCs based on enumerated events include, in addition to the regular enumerated event information, an array of boolean indicating for each possible outcome whether the ordinal should be given to the *offer* party (note this means that this array *must* have the same number of elements as there are possible outcomes).

## Numerical events

Expand All @@ -19,10 +47,13 @@ These intervals indicate the ranges of outcomes for which the ordinal should be
## Changing postage

It is currently not possible to change the postage of the ordinal.
This means that if an ordinal is contained in a 1BTC UTXO, the entire 1BTC will be included in the DLC and given to the ordinal winner.
Changing the postage should thus be done prior to including the ordinal in a DLC.

This means that if an ordinal is contained in a 1BTC UTXO, the entire 1BTC will be included in the DLC, and given to the ordinal winner without changing the sats in the UTXO.

Changing the postage should thus be done prior to including the ordinal in a DLC by the wallet.

In addition, the postage of the ordinal will be merged with the payout of the winner.

This means that if a party is given an ordinal with a postage of 1BTC in addition to a payout of 1BTC, the output of the CET including the ordinal will have a value of 2BTC.

# How it works
Expand Down

0 comments on commit c5d29a2

Please sign in to comment.