Orders.Exchange - Full Protocol DEX Run on BTC
  • Overview
    • What is Orders.Exchange
    • Why create Orders.Exchange?
  • Orderbook DEX
    • Overview
    • Technology & Theory
      • PSBT
      • 0-Sec Multi Transactions
      • Ask Orders
        • Technical flowchart for placing ASK orders
      • Bid Orders
        • Technical flowchart for placing BID orders
      • Nostr Proposal
        • NIP-100
    • Audit Report
    • Service Fee
    • Trade to Burn
  • Orders Swap & Liquidity Pools
    • Orders Swap
      • Overview
      • Technology & Theory
        • Decentralized Architecture
      • Service Fee
      • Swap to Burn
    • Orders Liquidity Pools
      • Overview
      • Technology & Theory
        • Threshold Multisignature
        • Cold-Hot Wallet Isolation
      • Stake to Earn
      • Service Fee Sharing
    • Audit Report
  • Orders Bridge
    • Overview
    • Technology & Theory
    • Audit Report
    • Service Fee
  • Minting is Liquidating
    • Minting is Liquidating
    • Principle Workflow
    • Stake to Earn
    • Service Fee
  • Tokenomics
    • $RDEX
  • Roadmap
    • Orders Roadmap
  • FAQ
    • How to Earn $RDEX?
    • Why does $RDEX have almost half of its tokens in one address, and does this pose a risk?
    • What is the buyback timing and frequency for $RDEX?
    • How does P-LP differ from regular LPs? Do I need to lock my assets?
    • Why are there different reward multipliers in P-LP? How should I choose which multiplier to go for?
    • Is the liquidity I provide to P-LP safe? How can its safety be assured?
    • Why does P-LP differentiate between uni-directional and bi-directional liquidity? What's the differe
    • How are funds transferred between the buyer's and seller's wallets, and do my tokens leave my wallet
    • From a technical perspective, what happens when canceling an already placed buy/sell order?
    • Is the liquidity pool for Orders fully decentralized, and how is it achieved?
    • The world's first Bitcoin-native network supported BID system: How it came into existence
    • How many $RDEX tokens are released daily, and how is it done?
    • After adding LP, how can I make it trade? I can't see this LP on my own trading page.
    • Can I know which P-LP I provided?
    • Why not open RDEX P-LP?
    • The transaction fees are currently high; is there a way to reduce them?
    • What's the difference between orders and other DEXs?
  • Risks & Disclaimer
    • Risks & Disclaimer
  • Team
    • Team Introduction
  • Resources
    • Orders Exchange
    • Twitter
    • Discord
    • Github
Powered by GitBook
On this page
  • Implementation of Bitcoin Token Interoperability Across Various DEXs
  • Info
  • Process
  1. Orderbook DEX
  2. Technology & Theory
  3. Nostr Proposal

NIP-100

PreviousNostr ProposalNextAudit Report

Last updated 1 year ago

Implementation of Bitcoin Token Interoperability Across Various DEXs

draft optional

The NIP defines the interoperability of Bitcoin Tokens, such as BRC20 tokens, among different DEXs (Decentralized Exchanges). DEXs utilizing this protocol enable the circulation of user order data among other DEXs using the same protocol, allowing for public display and cross-platform transactions. This enhances trading efficiency by increasing the exposure of user orders. The protocol was authored by the Orders.Exchange team.

Info

A Seller or Buyer can publish these events:

Kind
Description

60018

set_order

Create or update an order for product.

60019

take_order

Take a product and delete the order.

5

delete_order

Delete an order.

Event 60018 Create or update an order for product.

Event Content:

{
    "platform": <String, the name of platform which order come from>,
    "orderId": <String, ID of order, SHA256(seller_address_inscriptionId_amount)>,
    "sellerAddress": <String, address of seller>,
    "productType": <String, product type: ordinal/brc20>,
    "orderType": <int, sell-1,buy-2>
    "publicKey": <String, public key from seller, for verifying sign>
    "sign": <String, sign data with private key>
    "data": {
      "inscriptionId": <String, id of inscription>,
      "coinAmount": <int, amount of tick sold>,
      "amount": <int, btc value>,
      "psbtRawCreate": <String, psbt raw which seller create>
      }
}

Fields that are not self-explanatory:

  • platform:

    • The name of the platform that relay the order

    • eg: "OrdersExchange"

  • orderId:

    • The ID of order, SHA256(<seller_address>_<inscriptionId>_<amount>)

  • data:

    • if productType is ordinal data Include fields:inscriptionId/amount/psbtRawCreate

    • if productType is brc20 data Include fields:inscriptionId/coinAmount/amount/psbtRawCreate

Event Tags:

  "tags": [
       ["d", <String, ID of order],
       ["t", <String (optional), product category],
       ["n", <String (optional), tick name or ordinal name],
       ...
    ]
  • the d tag is required, its value MUST be the same as the orderId.

  • the t tag is as searchable tag, it represents different categories that the product can be part of (ordinal, tick). Multiple t tags can be present.

Event Content:

{
    "platform": <String, the name of platform which order come from>,
    "orderId": <String, ID of order, the same ID as the seller’s order which buyer would take>,
    "buyerAddress": <String, address of buyer>,
    "productType": <String, product type: ordinal/brc20>,
    "orderType": <int, sell-1,buy-2>
    "data": {
      "inscriptionId": <String, id of inscription>,
      "psbtRawCreate": <String, psbt raw which seller create>,
      "psbtRawFinal": <String, final psbt raw from buyer>,
      "txId": <String, txId from final psbt, which had been broadcasted>
      }
}

Fields that are not self-explanatory:

  • platform:

    • The name of the platform that relay the order

    • eg: "OrdersExchange"

  • orderId:

    • The ID of order, from Event 60018

  • data:

    • if productType is ordinal data Include fields:inscriptionId/amount/psbtRawCreate/psbtRawFinal/txId

    • if productType is brc20 data Include fields:inscriptionId/coinAmount/amount/psbtRawCreate/psbtRawFinal/txId

Event Tags:

  "tags": [
       ["d", <String, ID of order],
       ["t", <String (optional), product category],
       ["n", <String (optional), tick name or ordinal name],
       ...
    ]
  • the d tag is required, its value MUST be the same as the orderId.

  • the t tag is as searchable tag, it represents different categories that the product can be part of (ordinal, tick). Multiple t tags can be present.

Process

Message Type
Sent By
Description

0

Seller

New Order

1

Buyer

Pay for Order

2

Seller

Update Order

Step 1: seller create an order (event)

Create an order event from Seller

data include:

  • inscriptionId id of inscription

  • coinAmount amount of tick sold

  • amount btc value

  • psbtRawCreate psbt raw from seller who created it

{
    "platform": <String, the name of platform which order come from>,
    "orderId": <String, ID of order, SHA256(seller_address_inscriptionId_amount)>,
    "sellerAddress": <String, address of seller>,
    "productType": <String, product type: ordinal/brc20>,
    "orderType": <int, sell-1,buy-2>
    "publicKey": <String, public key from seller, for verifying sign>
    "sign": <String, sign data with private key>
    "data": {
      "inscriptionId": <String, id of inscription>,
      "coinAmount": <int, amount of tick sold>,
      "amount": <int, btc value>,
      "psbtRawCreate": <String, psbt raw which seller create>
      }
}

Step 2: buyer pay for order (event)

When buyer see orders and select one, then take it and make final psbt. Broadcast psbt tx at last.

data include:

  • inscriptionId id of inscription

  • psbtRawCreate psbt raw from seller who created it

  • psbtRawFinal final psbt raw from buyer

  • txId bitcoin txId

{
    "platform": <String, the name of platform which order come from>,
    "orderId": <String, ID of order, the same ID as the seller’s order which buyer would take>,
    "buyerAddress": <String, address of buyer>,
    "productType": <String, product type: ordinal/brc20>,
    "orderType": <int, sell-1,buy-2>
    "data": {
      "inscriptionId": <String, id of inscription>,
      "psbtRawCreate": <String, psbt raw which seller create>,
      "psbtRawFinal": <String, final psbt raw from buyer>,
      "txId": <String, txId from final psbt, which had been broadcasted>
      }
}

Step other: seller Update Order or Delete Order (event)

Delete order by seller

{
    "platform": <String, the name of platform which order come from>,
    "orderId": <String, ID of order, the same ID as the seller’s own order>,
    "sellerAddress": <String, address of seller>,
    "publicKey": <String, public key from seller, for verifying sign>,
    "sign": <String, sign data with private key>,
    "data": {
      "inscriptionId": <String, id of inscription>
      }
}

Event 60019 Take a product and delete the order.

:
: