NIP-100
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:
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
productTypeisordinaldataInclude fields:inscriptionId/amount/psbtRawCreateif
productTypeisbrc20dataInclude 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
dtag is required, its value MUST be the same as theorderId.the
ttag is as searchable tag, it represents different categories that the product can be part of (ordinal,tick). Multiplettags can be present.
Event 60019: Take a product and delete the order.
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
productTypeisordinaldataInclude fields:inscriptionId/amount/psbtRawCreate/psbtRawFinal/txIdif
productTypeisbrc20dataInclude 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
dtag is required, its value MUST be the same as theorderId.the
ttag is as searchable tag, it represents different categories that the product can be part of (ordinal,tick). Multiplettags can be present.
Process
0
Seller
New Order
1
Buyer
Pay for Order
2
Seller
Update Order
Step 1: seller create an order (event)
seller create an order (event)Create an order event from Seller
data include:
inscriptionIdid of inscriptioncoinAmountamount of tick soldamountbtc valuepsbtRawCreatepsbt 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)
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:
inscriptionIdid of inscriptionpsbtRawCreatepsbt raw from seller who created itpsbtRawFinalfinal psbt raw from buyertxIdbitcoin 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)
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>
}
}Last updated