# Unisocks-Style NFT Sale in CKB (Fleeting)
## Metadata
**Status**:: #x
**Zettel**:: #zettel/fleeting
**Created**:: [[2025-04-22]]
**OCR**:: [perplexity.ai](https://www.perplexity.ai/search/ocr-and-summarize-the-pages-6O50RZSnRoyJiKwQEVRevA)
**URL**:: [raindrop.io](https://app.raindrop.io/my/54617805/item/1020339961/preview)
## OCR Pages
### Page 1
Problem
Unisocks-style NFT sale in CKB
- Sell N units, Parameter M
- The i-th unit price is:
$
\frac{M}{N-i} - \frac{M}{N+1-i}
$
(Derivation steps shown, simplified to:)
$
\frac{M}{(N-i)(N+1-i)}
$
Example: M = 50, N = 5
- 0: $\frac{50}{30} = 1.67$
- 1: $\frac{50}{(5-1)(6-1)} = \frac{50}{20} = 2.5$
- 2: $\frac{50}{(5-2)(6-2)} = \frac{50}{12} = 4.17$
- 3: $\frac{50}{6}$ (incomplete, but seems to be 8.33)
- 4: $\frac{50}{1 \times 2} = 25$
---
### Page 2
Solution 1: Single state that records sold units
- Diagram: hot cell with user, sold:i → sold:i+1, i+1 unit, change
- Issue: UTXO congestion
Solution 2: Pre-creating NFT-cells
- Diagram: unit i, payment → unit i, change
- Issues: Waste if N >> sold; users must bid multiple cells to increase success rate and may win more units than wanted
Solution 3: Hybrid
- Pre-create first n units and create a sold:x cell for remaining units
Solution 4: Bid then sort
- Round 1: Bid
- `Bids[H(lock-script hash)] = n`
- User lock script hash value to bid on unit with index ≤ n
- Payment amount ≥ n-th unit price
- Round 2: Reveal and sort: proper bids
- End bids: destroy cells requires to be in coll deps
## Summary
### Problem Statement
- The document discusses a Unisocks-style NFT sale mechanism on the CKB blockchain, where N units are sold with a pricing parameter M.
- The price for the i-th unit is derived as $\frac{M}{(N-i)(N+1-i)}$.
- Example calculations are provided for M=50, N=5.
### Solution Approaches
1. **Single State Cell**: Tracks sold units in a single state, but risks UTXO congestion.
2. **Pre-created NFT Cells**: All units are pre-created, but can be wasteful if not all units are sold and users may overbid.
3. **Hybrid**: Pre-create a subset of units and use a state cell for the rest.
4. **Bid Then Sort**: Users bid for units, lock their bids, and then bids are revealed and sorted to allocate units efficiently.
Each solution addresses different trade-offs regarding blockchain resource usage, user experience, and sale efficiency.