Skip to content

Commit

Permalink
Add Warning on Limit Order Script as per ickb/v1-core#10
Browse files Browse the repository at this point in the history
  • Loading branch information
phroi committed Aug 18, 2024
1 parent d874303 commit 4271007
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ Outputs:
- ...
```
### ⚠️ Warning on Limit Order Script ⚠️
If a UDT needs to store data on Witness, then for good measure it should not be used in conjunction with the limit order script. The limit order cell doesn't rely on signature-based verification, so the witnesses in the same group (lock, input type and output type) can be modified by an attacker after user signature. Generally speaking if a script in a transaction needs to store data in the witness and this data can be tampered without the transaction becoming invalid, then this transaction must not employ the following limit order script.
### Limit Order Script
Interacting directly with the iCKB protocol has some limitations:
Expand All @@ -521,7 +525,7 @@ Interacting directly with the iCKB protocol has some limitations:
- NervosDAO doesn't allow to partially withdraw from a deposit.
- There is no easy way to merge multiple user intentions within a single deposit or withdrawal.
To abstract over NervosDAO and iCKB protocol limitations, it has been created a lock that implements limit order logic, abstracting user intentions, and that anyone can match partially or completely, similarly to an ACP lock. This lock aims to be compatible with all types that follows the sUDT convention of storing the amount in the first 16 bytes of cell data, at the moment sUDT and xUDT. In a transaction there may be multiple orders cells. This script lifecycle consists of three kind of transactions: Mint, Match and Melt.
To abstract over NervosDAO and iCKB protocol limitations, it has been created a lock that implements limit order logic, abstracting user intentions, and that anyone can match partially or completely, similarly to an ACP lock. This lock aims to be compatible with all types that: follows the sUDT convention of storing the amount in the first 16 bytes of cell data and store no data in the witness, at the moment sUDT and partially xUDT. In a transaction there may be multiple orders cells. This script lifecycle consists of three kind of transactions: Mint, Match and Melt.
**Limit Order data molecule encoding:**
Expand Down

0 comments on commit 4271007

Please sign in to comment.