@inversealtruism/cairnx-core 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONVENTION.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # CairnX Convention v1
2
2
 
3
- **Status:** DRAFT v1.0 (2026-06-10) · **Domain:** `cairnx:v1` · **Activation height:** 29 860
3
+ **Status:** v2.1 (normative; supersedes the 2026-06-10 v1.0 draft) · **Domain:** `cairnx:v1` · **Base activation:** 29 860
4
+
5
+ **Version ladder** (each gate non-retroactive — below it, behavior + canonical hashes are byte-identical to history):
6
+ v1.1 @ 29 960 · v1.2 @ 30 300 · v1.3 @ 31 100 · v1.4 @ 31 400 · v1.5 @ 32 000 · v1.6 @ 33 600 (§19) ·
7
+ v1.7 @ 34 000 (§20) · v1.9 @ 36 700 (§22) · v2.0 @ 38 400 (§23) · v1.8 @ 40 000 (§21) · v2.1 @ 40 100 (§24).
8
+ Sections §19–§24 are the normative semantics for v1.6–v2.1; §5.1 is the byte-level canonical-JSON contract that binds all of them.
9
+
10
+ > **Canonical copy.** This spec ships in the published `@inversealtruism/cairnx-core` package; the source of
11
+ > truth is `csd-sdk/packages/cairnx/CONVENTION.md`. Any in-repo mirror (e.g. the `cairnx` app repo) MUST be
12
+ > kept **byte-identical** to it on every change — a third-party implementer fetches the *published* copy, so
13
+ > it is the one that must never lag the code. Keep the two in lockstep when editing.
4
14
 
5
15
  CairnX is a meta-asset and exchange convention on Compute Substrate (CSD). It defines fungible
6
16
  tokens and atomic delivery-versus-payment trades using **only** the chain's existing `Propose`
@@ -143,15 +153,18 @@ is atomic at consensus level**: the buyer cannot pay without (the chain recordin
143
153
  receiving, and the seller's tokens were already convention-locked. The fill costs only the
144
154
  attest fee floor (0.05 CSD) plus the payment.
145
155
 
146
- The **first valid fill in apply order wins**. `confidence` is ignored (set 100).
156
+ The **first valid fill in apply order wins**. For a **CSD-priced** fill `confidence` is ignored
157
+ (set 100); a **token-priced** fill (§11) additionally requires the `confidence = 1 000 000` opt-in
158
+ marker or it is a no-op.
147
159
 
148
160
  ### 4.6 `cancel` — close an offer (an Attest)
149
161
 
150
162
  `Attest` on the offer with **`score = 0`**, valid only when `attester == seller`. Releases the
151
163
  lock, closes the offer. (Cancel and fill race in apply order like everything else.)
152
164
 
153
- Other `score` values on CairnX offers are reserved (no-ops); `score = 1` is reserved for a
154
- future claim/exclusivity extension (v1.1).
165
+ Other `score` values on CairnX offers are reserved (no-ops). The **claim-to-fill** exclusivity
166
+ extension shipped at v1.7 (height 34 000) and uses **`score = 50`** (`SCORE_CLAIM`) — *not* `score = 1`
167
+ (an earlier draft placeholder that was never implemented). See §20.
155
168
 
156
169
  ## 5. Resolver state (normative output)
157
170
 
@@ -177,6 +190,99 @@ event log and used locale collation; it is retired.)
177
190
  Determinism requirement: the conformance suite enforces byte-identity, including
178
191
  shuffle-invariance of inputs that consensus ordering re-sorts.
179
192
 
193
+ ### 5.1 The byte-level canonical-JSON contract (normative — pin before a 2nd implementation exists)
194
+
195
+ "Canonical JSON" above is only as portable as these rules. They document exactly what the reference
196
+ canonicalizer (`@inversealtruism/csd-codec` `canonicalJson`, which bottoms out in ECMA-262
197
+ `JSON.stringify`) produces. An independent resolver that diverges on any of them will fork the
198
+ record-acceptance gate and/or the canonical-state hash on valid mainnet data. These are unmigratable
199
+ once a replay hash is pinned over data that exercises them, so they are stated here verbatim.
200
+
201
+ - **A1 — String escaping.** Escape **only** `"` → `\"`, `\` → `\\`, and the C0 controls U+0000–U+001F
202
+ (using the short escapes `\b \f \n \r \t`, otherwise lowercase `\u00XX`). Emit **every other**
203
+ codepoint as **raw UTF-8** — in particular do **NOT** escape `/` (solidus) and do **NOT** `\u`-escape
204
+ any non-ASCII codepoint (U+0080 and above). A token `name` of `"Café"` serializes the `é` as the raw
205
+ 2-byte UTF-8 `0xC3 0xA9`, never `é`; an emoji serializes as its raw 4-byte UTF-8, never an
206
+ escaped surrogate pair. (Note: `memo` fields on transfer/offer/bid carry the same free-Unicode
207
+ surface inside the record `uri`, so they obey A1 too even though they are not in canonical state.)
208
+ **A1 is unsatisfiable for a lone/unpaired UTF-16 surrogate** (it has no valid UTF-8 form): V8 escapes
209
+ it to ASCII `\uXXXX` while a raw-UTF-8 resolver rejects/mangles it, so such a string is rejected
210
+ outright by **A7** before it can reach A1 — see A7.
211
+ - **A2 — Key ordering is UTF-16 code-unit order, NOT Unicode codepoint / UTF-8 byte order.** Sort object
212
+ keys by comparing their UTF-16 code units. These two orders are identical for all-BMP strings but
213
+ **diverge for non-BMP characters (U+10000+)**: a leading surrogate `0xD800–0xDBFF` sorts *below* BMP
214
+ chars `0xE000–0xFFFF` under UTF-16, but *above* all BMP chars under codepoint order. **Rust
215
+ `str::cmp` / Go `<` on `string` compare by UTF-8 bytes = codepoint order and are therefore WRONG** for
216
+ a non-BMP key — implementers MUST compare UTF-16 code units (JS `localeCompare` is also wrong; use the
217
+ default `<`/`>` on the JS string, i.e. code-unit order, which is what the resolver's `ord()` does).
218
+ - **A3 — Field types (bare number/boolean vs decimal string vs identity string).** Canonical state mixes
219
+ raw JSON integers and booleans with decimal-string amounts and raw identity strings. Emit as **bare
220
+ integers**: `decimals, height, effectiveHeight, expiresEpoch, feeBps, tipHeight, paidThroughEpoch`, and
221
+ (v1.7) `claimUntilHeight` (all JS-safe, < 2^53). Emit as **bare booleans**: `locked, viaFill, expired`.
222
+ Emit as **decimal strings**: `supply, minted, mintLimit, feesPaid`, every `balances.*.available`/`.locked`,
223
+ `want.value`, `want.amount`, `min`, `paid`, `delivered`, and each fill's `paid`/`.fee` (plus `.got` ONLY on
224
+ a partial `fills[]` entry — see the fill shapes below). Emit as **raw 0x-hex identity strings**: the offer
225
+ `id` (32-byte txid), the name `claimId` (32-byte anchor txid, present on **every** name), and (v1.7) the
226
+ offer `claimedBy` (20-byte addr). Emit as a nested **object**: the name `profile` (v1.9 nprofile — a flat
227
+ string→string map). **Two distinct fill shapes (the `got`-presence rule):** a whole-offer fill is the
228
+ singular object `fill` = `{buyer, txid, height, paid, fee}` and **OMITS `got`**; a partial-fillable (`min`)
229
+ offer instead carries an **array** `fills`, each entry `{buyer, txid, height, paid, fee, got}` **WITH
230
+ `got`** (`got` = the give-asset units delivered by that partial). An implementer who adds `got` to the
231
+ singular `fill` (or drops it from a `fills[]` entry) forks `sha256(canonicalState)`. Never serialize an
232
+ amount as a number or an `f64`; never stringify an integer field.
233
+ > **⚠ v1.7/v1.9 are part of this byte contract on every live tip past their gate** (`V17_HEIGHT=34000`
234
+ > claims, `V19_HEIGHT=36700` profiles). A second-language resolver built to an earlier copy of this list
235
+ > — omitting `claimedBy`/`claimUntilHeight`/`claimId`/`profile`/`fills` — **forks `sha256(canonicalState)`
236
+ > the moment any offer is claimed or any name carries a profile.** (Pinned on live data by
237
+ > `replay-hashes.json` at **every activation height through V20** — incl. 34 000 claims, 36 700 profiles,
238
+ > 38 400 grace; V18/V21 auto-pin once the chain tip crosses them. The static `cases.json` bar additionally
239
+ > pins the V20/V21/nprofile/name-op/lapse byte-contract with no live node required.)
240
+ - **A4 — Optional fields are OMITTED, never `null`.** A key whose value is absent is dropped entirely
241
+ (`addr, viaFill, min, bid, taker, paidThroughEpoch, expired`, token `name`/`mintLimit`/`tmeta`, and the
242
+ v1.7/v1.9 optionals `claimedBy`/`claimUntilHeight` (omitted unless the offer is claimed), `fill`
243
+ (omitted until first filled), `fills` (only on a `min` offer), `profile` (only when an nprofile is set)).
244
+ Never emit `"addr":null`.
245
+ - **A5 — The acceptance gate is a byte-exact round-trip (stronger than the hash check).** A record anchor
246
+ is accepted iff **both** `canonicalJson(JSON.parse(uri)) === uri` (byte-for-byte) **and**
247
+ `sha256(uri) === payload_hash`. The round-trip is what rejects duplicate keys, leading-zero amounts,
248
+ `+` signs, and insignificant whitespace; a record failing either check is a no-op and never enters
249
+ replay. The round-trip does **not** catch a lone surrogate (it survives `JSON.parse`→`canonicalJson`
250
+ identically as ASCII `\uXXXX`) — that class is rejected by **A7**, which every resolver MUST apply.
251
+ - **A6 — Integer grammar + the exact expressions.** Amounts match `^(0|[1-9][0-9]*)$` with
252
+ `MAX_AMOUNT = 2^96 − 1`. The taker fee is `tradeFee(want) = (want·FEE_BPS + 9999) / 10000` (integer
253
+ division = ceil of 1%). `epochOf(height) = floor(height / 30)`. Constants: `COMMIT_MAX_BLOCKS = 240`,
254
+ `NAME_TERM_EPOCHS = 8760`, `NAME_GRACE_EPOCHS = 720`. Tickers match `^[A-Z][A-Z0-9]{2,11}$`
255
+ (effective length **3–12**). **String length limits count UTF-16 CODE UNITS (JS `.length`)**, NOT
256
+ codepoints or UTF-8 bytes: the free-text token `name` ≤ **32** units and `memo` ≤ **64** units. An
257
+ astral codepoint (U+10000+) is **2** units, so a 16-emoji name is exactly 32 units (accepted) and a
258
+ 17-emoji name is 34 (a no-op). A resolver counting `chars`/codepoints (Rust `str::chars().count()`)
259
+ or bytes would FORK at this boundary — implementers MUST count UTF-16 units (Rust
260
+ `s.encode_utf16().count()`). Pinned by the `determinism-name-length-utf16-boundary` vector.
261
+ - **A7 — String well-formedness (UTF-16).** A record whose decoded JSON contains **any non-well-formed
262
+ UTF-16 string** — a lone/unpaired surrogate (`0xD800–0xDBFF` not followed by `0xDC00–0xDFFF`, or a
263
+ bare `0xDC00–0xDFFF`) in **any** key or value at any depth — is an **INVALID no-op for every
264
+ conformant resolver**, rejected before schema validation. Rationale: such a string has no defined
265
+ raw-UTF-8 canonical form (A1), so accepting it would credit on a V8 resolver and reject on a
266
+ raw-UTF-8 one — a cross-language fork on identical chain bytes. Reference: `parseRecord`'s
267
+ `isWellFormedDeep` gate (records.ts), which runs immediately after the A5 round-trip. Implementers
268
+ MUST reproduce it (e.g. JS `String.prototype.isWellFormed`, Rust `str` is already well-formed so a
269
+ `serde_json` parse that surfaces the escape and re-encodes will reject — assert it explicitly).
270
+
271
+ The conformance suite **now includes** the A1–A4/A7 vectors (`determinism-nonascii-name-value-pinned`
272
+ covers a non-ASCII token name, an emoji/non-BMP name, and CJK; `determinism-lone-surrogate-rejected`
273
+ covers the A7 no-op; control-character and present-vs-absent optionals are exercised by
274
+ `determinism-a.test.ts`). A second-language resolver is conformant only if it reproduces every vector's
275
+ canonical state **and** the pinned `replay-hashes.json` on live data byte-for-byte.
276
+
277
+ **Activated since this section was first written (all gated, all in the byte contract above):** v1.6
278
+ (`V16_HEIGHT=33600`) raised the taker fee to `FEE_BPS_V16=150` and added the flat+`REBATE_BPS` maker
279
+ rebate on resting liquidity; v1.7 (`V17_HEIGHT=34000`) added claim-to-fill (`SCORE_CLAIM`, the offer
280
+ `claimedBy`/`claimUntilHeight` fields, `MAX_ACTIVE_CLAIMS`/`CLAIM_WINDOW_BLOCKS`/`CLAIM_COOLDOWN_BLOCKS`);
281
+ v1.8 (`V18_HEIGHT=40000`, dormant) retiers the name registration fee; v1.9 (`V19_HEIGHT=36700`) added the
282
+ `nprofile` record + the name `profile` map (`PROFILE_MAX_KEYS`/`PROFILE_MAX_VALUE_BYTES`, the `PKEY`
283
+ charset). *(Still genuinely future / not implemented: pooled `pools`/`shares` value and a `MAX_RESERVE`
284
+ cap — ecosystem doc 16 §4; these are NOT in canonical state today.)*
285
+
180
286
  ## 6. Honest limits & safety
181
287
 
182
288
  - **Convention-enforced, not consensus-enforced.** The chain knows nothing about tokens; it
@@ -191,7 +297,10 @@ shuffle-invariance of inputs that consensus ordering re-sorts.
191
297
  deterministically. **v1.3 closes this structurally:** from height 31 100, CSD-priced offers
192
298
  must be taker-bound (§15) — a warning cannot hold users back from a full-payment loss, and a
193
299
  no-escrow chain has nothing to refund from, so the unsafe shape is removed rather than warned
194
- about. (Claim windows, floated for v1.1, are impossible for the same reason.)
300
+ about. (A claim window was first dismissed here as impossible because a *payment-bearing*
301
+ reservation has nothing to refund — but v1.7's claim is **payment-free** (an `Attest`, not a
302
+ payment), so a losing claimer forfeits only the 0.05 CSD attest fee. On that basis v1.7 safely
303
+ **re-opens** untaken CSD offers via claim-to-fill — §20 — and v2.0/§23 bounds its late-fill edge.)
195
304
  - **No unconfirmed chaining (no CPFP).** The mempool only accepts txs whose inputs exist in the
196
305
  confirmed UTXO set — you cannot spend change that hasn't been mined. Sequential CairnX actions
197
306
  from one key require one confirmation between them; client software must serialize and surface
@@ -208,9 +317,12 @@ shuffle-invariance of inputs that consensus ordering re-sorts.
208
317
 
209
318
  | action | tx type | domain/ref | app fields | outputs |
210
319
  |---|---|---|---|---|
211
- | deploy/mint/transfer/offer | Propose | `cairnx:v1` | `uri` = record JSON, `payload_hash` = sha256(uri), `expires_epoch` per §4 | change only |
212
- | fill | Attest | offer proposal id | `score=100, confidence=100` | payment to `want.payto` + change |
213
- | cancel | Attest | offer proposal id | `score=0, confidence=100` | change only |
320
+ | deploy/mint/transfer/offer/bid/name-ops | Propose | `cairnx:v1` | `uri` = record JSON, `payload_hash` = sha256(uri), `expires_epoch` per §4 | fee/payment outputs per §10/§19 + change |
321
+ | fill (CSD-priced) | Attest | offer proposal id | `score=100` (confidence ignored) | payment to `want.payto` + treasury fee + maker rebate (§19) + change |
322
+ | fill (token-priced) | Attest | offer proposal id | `score=100, confidence=1 000 000` | change only (debit + in-kind fee are convention-side, §11) |
323
+ | claim (v1.7, untaken CSD offer) | Attest | offer proposal id | `score=50` | change only — payment-free reservation (§20) |
324
+ | cancel | Attest | offer proposal id | `score=0` | change only |
325
+ | ocancel | Propose | `cairnx:v1` | `uri` = `{t:"ocancel",…}` | change only |
214
326
 
215
327
  Fee floors: Propose ≥ 25 000 000, Attest ≥ 5 000 000 base units. 1 CSD = 100 000 000 base units.
216
328
 
@@ -528,3 +640,164 @@ From height **32 000** every name is a **lease**:
528
640
  `{logo, description, links}` document — self-certifying content, so the record stays tiny
529
641
  (the 512-byte `uri` cap is untouched) and the metadata inherits the swarm's verify-on-read
530
642
  property. State: `tokens[t].tmeta`. Records before v1.5 are no-ops.
643
+
644
+ ---
645
+
646
+ # CairnX Convention v1.6 (fee update + maker rebate)
647
+
648
+ **Activation height: 33 600** (`V16_HEIGHT`; non-retroactive — pre-v1.6 offers keep the 1% fee and earn no rebate).
649
+
650
+ ## 19. Taker fee 1% → 1.5%, and a maker rebate on resting liquidity
651
+
652
+ - **Fee bump.** The taker fee becomes `FEE_BPS_V16 = 150` (1.5%, `ceil`) instead of `FEE_BPS = 100` (1%).
653
+ The rate is **captured per-offer at creation height** into `offers[id].feeBps` (a bare-int canonical field,
654
+ §5.1-A3): an offer anchored ≥ 33 600 carries `feeBps = 150`, an earlier one keeps `100`. Every fill of that
655
+ offer (whole, partial, token-priced) uses the offer's own `feeBps` — so pre-v1.6 offers are byte-identical
656
+ forever. A third-party resolver MUST select the fee by **offer-creation height**, not by fill height.
657
+ - **Maker rebate (whole CSD-priced fills only).** On a whole fill of a **resting-liquidity** CSD-priced offer,
658
+ the taker additionally pays the **maker** (`offers[id].seller`) a rebate, as an extra output **in the same
659
+ fill tx**, reimbursing the maker's posting (Propose) cost:
660
+ `makerRebate(want) = REBATE_FLAT + ceil(REBATE_BPS × want / 10000)` with `REBATE_FLAT = 25 000 000`
661
+ (0.25 CSD) and `REBATE_BPS = 50` (0.5%).
662
+ - **`restingLiquidity` predicate (normative):** an offer qualifies iff
663
+ `(offer.taker !== undefined && offer.bid !== undefined)` — a taker-bound answer to a bid (the RFQ/MM lane) —
664
+ **OR** `(offer.height ≥ V17_HEIGHT && offer.taker === undefined)` — a v1.7 open ask (claim-to-fill).
665
+ Partial fills and token⇄token fills earn **no** rebate. (Keying on `bid` alone was a closed self-mint hole:
666
+ a maker could self-attach an unanchored bid to an open offer; the open-ask lane now earns it via `taker
667
+ === undefined && height ≥ V17` regardless of `bid`, and a bid-answer rebate requires a real consenting taker.)
668
+ - **Same-tx output gate (the SUM rule).** The fill's required outputs are accumulated **per recipient**:
669
+ `want.payto += want.value`, `TREASURY += tradeFee(want, feeBps)`, and (if rebate applies) `seller += rebate`.
670
+ When `want.payto == seller` (the common default) the two amounts **SUM** — a resolver MUST check each
671
+ recipient against the summed requirement, never satisfy by `max()`. (`payto` can never be the treasury, so
672
+ those buckets never collide.) For a pre-v1.6 offer the rebate is 0 and this reduces to the two original checks.
673
+
674
+ ---
675
+
676
+ # CairnX Convention v1.7 (claim-to-fill — race-safe open CSD offers)
677
+
678
+ **Activation height: 34 000** (`V17_HEIGHT`; non-retroactive — in `[V13, V17)` open CSD fills stay banned, §15).
679
+
680
+ ## 20. Claim-to-fill — an untaken CSD offer is reserved before it is paid
681
+
682
+ v1.3 (§15) removed open CSD offers because the loser of a payment-bearing fill race loses a real payment.
683
+ v1.7 re-opens them safely by moving the race to a **payment-free reservation**: a losing claimer forfeits only
684
+ the 0.05 CSD attest fee, never a payment.
685
+
686
+ - **Claim** = an `Attest` on the offer with **`score = SCORE_CLAIM = 50`** (∉ {fill 100, cancel 0}, so it is an
687
+ inert no-op below V17 — non-retroactive). It grants the attester an **exclusive hold** of the offer for
688
+ `CLAIM_WINDOW_BLOCKS = 15` blocks: on grant the resolver records `offers[id].claimedBy = attester` and
689
+ `offers[id].claimUntilHeight = grantHeight + 15` (both canonical fields, §5.1-A3, present only while claimed).
690
+ - **Fill gate.** A `SCORE_FILL` fill on an **untaken** (`taker === undefined`) CSD-priced offer at height ≥ V17
691
+ is valid **only if** the offer is currently held **and the filler is the holder**: `claimHeld(o, h) &&
692
+ attester === o.claimedBy`, where `claimHeld(o, h) = (o.claimedBy !== undefined) && (h < o.claimUntilHeight)`
693
+ (v2.0 widens this — §23). A fill by anyone else, or with no live claim, is a no-op (offer stays open).
694
+ - **No new claim while held.** A `claim` on an offer that is already held (`claimHeld`) is a no-op.
695
+ - **`MAX_ACTIVE_CLAIMS = 3` per address.** A claim is rejected if the attester already holds 3 offers
696
+ (`liveN = count of offers x where x.claimedBy === attester && claimHeld(x, h)`). Anti-squat.
697
+ - **`CLAIM_COOLDOWN_BLOCKS = 15`.** The address whose hold just lapsed (`o.claimedBy === attester`) may not
698
+ immediately re-grab the **same** offer until `h ≥ o.claimUntilHeight + CLAIM_COOLDOWN_BLOCKS` (in v2.0, the
699
+ cooldown runs from the end of the hold = window + grace). Known bound (identical in the Python reference, so
700
+ not a fork): the cooldown keys on the last claimer, so a colluding A→B→A pair can recycle one offer — a
701
+ payment-free liveness nuisance on a single offer, never value loss.
702
+ - **Reorg note (client, not consensus):** claim→fill is two txs, so the payment has a reorg exposure a single-tx
703
+ fill lacks. Buyer software MUST wait a value-scaled confirmation depth (gambler's-ruin sized) on the claim
704
+ before broadcasting the fill — this is a client policy, not a resolver rule, and does not affect canonical state.
705
+ - Taker-bound offers need no claim (they were never in the race). Token⇄token offers are no-op-safe and ignore claims.
706
+
707
+ ---
708
+
709
+ # CairnX Convention v1.8 (two-tier name registration fee)
710
+
711
+ **Activation height: 40 000** (`V18_HEIGHT`; non-retroactive — below it the §10 ENS curve applies unchanged).
712
+
713
+ ## 21. Flat two-tier name fee
714
+
715
+ At/above V18, `nameRegFee(name, height)` (the fee for `name` claim/reveal, `nrenew`, and the base of the §17
716
+ lapsed-premium) becomes a flat **two-tier** schedule, replacing the §10 length curve:
717
+
718
+ - name length **≤ 4** chars → `NAME_FEE_SHORT_V18 = 670 000 000` (6.7 CSD);
719
+ - name length **≥ 5** chars → `NAME_FEE_V18 = 300 000 000` (3 CSD).
720
+
721
+ Below 40 000 the original 5-tier curve (§10: ≤3→5, 4→2, 5→1, 6–9→0.5, 10+→0.1 CSD) still applies — the fee is
722
+ selected by **anchor height**, so all historical replay is byte-identical. (Client builders should price a fee
723
+ output built within a few blocks *below* V18 at the V18 rate, since overpay is always accepted but underpay is a
724
+ no-op that forfeits the treasury output.)
725
+
726
+ ---
727
+
728
+ # CairnX Convention v1.9 (nprofile — ENS-class identity)
729
+
730
+ **Activation height: 36 700** (`V19_HEIGHT`; non-retroactive — `nprofile` below it is a forward-compat no-op).
731
+
732
+ ## 22. `nprofile` — owner-set identity metadata on a name
733
+
734
+ ```json
735
+ {"v":1,"t":"nprofile","name":"alice","p":{"url":"https://alice.example","eth.address":"0x…"}}
736
+ ```
737
+
738
+ - **Inert metadata.** `p` is a flat string→string map. It carries **no fee, no value, and is never a send
739
+ target** — the address a name resolves to for payment stays in `nset` (`names[x].addr`). A resolver keeps
740
+ no reserved keys; the app layer keeps send targets out of `p`.
741
+ - **Owner-gated, last-write-wins.** Valid iff the proposer is the current name owner and the lease is not
742
+ lapsed (§17). The new `p` **replaces** the prior profile; an **empty `p` (`{}`) clears it**.
743
+ - **Cleared on every ownership change** — `nxfer`, a name `fill`, and a lapsed-premium re-claim all clear
744
+ `profile` exactly as they clear `addr`.
745
+ - **Shape limits (deterministic):** keys match `PKEY = ^[a-z0-9](?:[a-z0-9.-]{0,30}[a-z0-9])?$` (ASCII only,
746
+ so the canonical key sort is invariant across UTF-16/codepoint/byte impls — future-proof vs a third-language
747
+ resolver); at most `PROFILE_MAX_KEYS = 16` keys; each value is a string of ≤ `PROFILE_MAX_VALUE_BYTES = 256`
748
+ **UTF-8 bytes**. Any violation → the record is a no-op.
749
+ - **State:** `names[x].profile` is a nested object, materialized **only at v1.9+ tips** and **only when set** —
750
+ so every pre-v1.9 canonical hash is byte-unchanged, and a name with no profile omits the key (§5.1-A4).
751
+
752
+ ---
753
+
754
+ # CairnX Convention v2.0 (claim grace — the bounded late-fill fix)
755
+
756
+ **Activation height: 38 400** (`V20_HEIGHT`; non-retroactive — below it the strict 15-block window of §20 stands).
757
+
758
+ ## 23. Bounded claim grace — a slightly-late in-window fill still delivers
759
+
760
+ v1.7's claim-to-fill had a fund-loss edge: a fill submitted inside the window but **mining at the window
761
+ boundary** (`height == claimUntilHeight`) was rejected by the resolver while its CSD payment was already
762
+ UTXO-final → the buyer paid and received nothing (the live `69.csd` incident). v2.0 fixes it without a race:
763
+
764
+ - At/above V20 the claim window widens to `CLAIM_WINDOW_BLOCKS_V20 = 40`, and a **bounded fill grace** of
765
+ `CLAIM_FILL_GRACE_BLOCKS = 5` is added. The **hold = window + grace = 45 blocks** is exclusive on **both**
766
+ sides — within it the claimer's fill is honored **AND** no other address may claim. So a slightly-late
767
+ in-window fill still delivers, and there is **no displacement race** (the holder is exclusive for the whole
768
+ hold; below the grace a new claim is rejected). Past the hold the offer **reopens** — the hold is **bounded,
769
+ not "until displaced."** `claimHeld(o, h)` becomes `h < o.claimUntilHeight + grace(o)`.
770
+ - **Era inference (no new stored field).** The grace is derived from the claim's era so its inverse is
771
+ unambiguous: a claim granted at ≥ V20 has `claimUntilHeight = grantHeight + 40 ≥ V20 + 40`; a pre-V20 claim
772
+ has `claimUntilHeight ≤ V20 + 14`; the range `[V20+15, V20+40)` is **unreachable**. Therefore
773
+ `grace(o) = (o.claimUntilHeight − 40 ≥ V20_HEIGHT) ? 5 : 0`. Below V20 the window is 15 and the grace is 0 —
774
+ byte-identical history.
775
+ - The `MAX_ACTIVE_CLAIMS` count and the `CLAIM_COOLDOWN_BLOCKS` both use the **hold** (window + grace), so the
776
+ grace can neither expand an address's concurrent reach past the cap nor be used to dodge the cooldown.
777
+ - **Offer-expiry interaction (client guard, not consensus).** `sweepExpired` runs before the fill, so a fill
778
+ mining between the offer's expiry and the hold-end would still burn the payment. Client software MUST refuse
779
+ to claim/fill unless the offer's lease/expiry outlives the **hold-end** (`claimUntilHeight + grace`), not
780
+ merely the tip. This is a client policy bounding what to sign; the resolver state is unchanged by it.
781
+
782
+ ---
783
+
784
+ # CairnX Convention v2.1 (offer/bid duration cap)
785
+
786
+ **Activation height: 40 100** (`V21_HEIGHT`; non-retroactive — below it the effective expiry is the raw `expires_epoch`).
787
+
788
+ ## 24. Maximum offer/bid lifetime — `MAX_OFFER_EPOCHS = 168` (≈ 7 days)
789
+
790
+ To keep resting inventory shallow (so an in-browser SPV light client's checkpoint stays near the tip rather
791
+ than being dragged back to the oldest open offer), an offer or bid may rest at most `MAX_OFFER_EPOCHS = 168`
792
+ epochs from its anchor:
793
+
794
+ - **Creation gate (≥ V21):** an `offer` or `bid` whose `expires_epoch − epochOf(anchorHeight) > 168` is a
795
+ **no-op at creation** (`v2.1: offer/bid duration exceeds the max`).
796
+ - **Lazy sweep cap (≥ V21):** the **effective** expiry used by `sweepExpired` is
797
+ `effExpiry = min(expires_epoch, epochOf(anchorHeight) + 168)` whenever the **sweep height** is ≥ V21. So an
798
+ over-cap offer/bid created **before** V21 (which was validly accepted at creation) auto-expires the moment a
799
+ sweep first runs at a height ≥ V21 past its capped expiry. The cap is gated by the **current sweep height**
800
+ (deterministic across replayers), so existing over-cap inventory expires at exactly the same height for
801
+ everyone. Below V21, `effExpiry = expires_epoch` — byte-identical history.
802
+ - **Client expiry-height closed form** (mirrors the resolver's height-gated sweep, for buy-safety guards):
803
+ `offerExpiryHeight = min( (expires_epoch+1)·30 , max( V21_HEIGHT , (epochOf(anchor)+168+1)·30 ) )`.
package/dist/index.cjs CHANGED
@@ -23,29 +23,42 @@ __export(index_exports, {
23
23
  ACTIVATION_HEIGHT: () => ACTIVATION_HEIGHT,
24
24
  ADDR_RE: () => ADDR_RE,
25
25
  AMOUNT_RE: () => AMOUNT_RE,
26
+ BID_KEYS: () => BID_KEYS,
27
+ CLAIM_ATTACKER_Q: () => CLAIM_ATTACKER_Q,
26
28
  CLAIM_COOLDOWN_BLOCKS: () => CLAIM_COOLDOWN_BLOCKS,
27
29
  CLAIM_FILL_GRACE_BLOCKS: () => CLAIM_FILL_GRACE_BLOCKS,
30
+ CLAIM_MIN_DEPTH: () => CLAIM_MIN_DEPTH,
28
31
  CLAIM_WINDOW_BLOCKS: () => CLAIM_WINDOW_BLOCKS,
29
32
  CLAIM_WINDOW_BLOCKS_V20: () => CLAIM_WINDOW_BLOCKS_V20,
30
33
  COMMIT_MAX_BLOCKS: () => COMMIT_MAX_BLOCKS,
34
+ COMMIT_REVEAL_MIN_DEPTH: () => COMMIT_REVEAL_MIN_DEPTH,
31
35
  CONF_TOKEN_FILL: () => CONF_TOKEN_FILL,
32
36
  DEPLOY_FEE: () => DEPLOY_FEE,
37
+ DEPLOY_KEYS: () => DEPLOY_KEYS,
33
38
  DOMAIN: () => DOMAIN,
34
- EPOCH_LEN: () => import_csd_codec.EPOCH_LEN,
39
+ EPOCH_LEN: () => import_csd_codec4.EPOCH_LEN,
35
40
  FEE_BPS: () => FEE_BPS,
36
41
  FEE_BPS_V16: () => FEE_BPS_V16,
42
+ HALVING_INTERVAL: () => import_csd_codec4.HALVING_INTERVAL,
37
43
  HASH_RE: () => HASH_RE,
44
+ INITIAL_REWARD: () => import_csd_codec4.INITIAL_REWARD,
38
45
  MAX_ACTIVE_CLAIMS: () => MAX_ACTIVE_CLAIMS,
39
46
  MAX_AMOUNT: () => MAX_AMOUNT,
40
47
  MAX_OFFER_EPOCHS: () => MAX_OFFER_EPOCHS,
41
48
  MAX_RECORD_BYTES: () => MAX_RECORD_BYTES,
49
+ MINT_KEYS: () => MINT_KEYS,
50
+ MIN_FEE_ATTEST: () => import_csd_codec4.MIN_FEE_ATTEST,
51
+ MIN_FEE_PROPOSE: () => import_csd_codec4.MIN_FEE_PROPOSE,
42
52
  NAME_FEE_SHORT_V18: () => NAME_FEE_SHORT_V18,
43
53
  NAME_FEE_V18: () => NAME_FEE_V18,
44
54
  NAME_GRACE_EPOCHS: () => NAME_GRACE_EPOCHS,
55
+ NAME_KEYS: () => NAME_KEYS,
45
56
  NAME_PREMIUM_DECAY_EPOCHS: () => NAME_PREMIUM_DECAY_EPOCHS,
46
57
  NAME_PREMIUM_START: () => NAME_PREMIUM_START,
47
58
  NAME_RE: () => NAME_RE,
48
59
  NAME_TERM_EPOCHS: () => NAME_TERM_EPOCHS,
60
+ NPROFILE_KEYS: () => NPROFILE_KEYS,
61
+ OFFER_KEYS: () => OFFER_KEYS,
49
62
  PKEY: () => PKEY,
50
63
  PROFILE_MAX_KEYS: () => PROFILE_MAX_KEYS,
51
64
  PROFILE_MAX_VALUE_BYTES: () => PROFILE_MAX_VALUE_BYTES,
@@ -57,6 +70,7 @@ __export(index_exports, {
57
70
  SCORE_CLAIM: () => SCORE_CLAIM,
58
71
  SCORE_FILL: () => SCORE_FILL,
59
72
  TICKER_RE: () => TICKER_RE,
73
+ TRANSFER_KEYS: () => TRANSFER_KEYS,
60
74
  TREASURY_ADDR: () => TREASURY_ADDR,
61
75
  V11_HEIGHT: () => V11_HEIGHT,
62
76
  V12_HEIGHT: () => V12_HEIGHT,
@@ -70,8 +84,13 @@ __export(index_exports, {
70
84
  V20_HEIGHT: () => V20_HEIGHT,
71
85
  V21_HEIGHT: () => V21_HEIGHT,
72
86
  bid: () => bid,
87
+ blockReward: () => import_csd_codec4.blockReward,
73
88
  buildRecord: () => buildRecord,
89
+ canonicalJson: () => import_csd_codec4.canonicalJson,
74
90
  canonicalState: () => canonicalState,
91
+ claimGraceOf: () => claimGraceOf,
92
+ claimWindowAt: () => claimWindowAt,
93
+ claimWindowOf: () => claimWindowOf,
75
94
  deploy: () => deploy,
76
95
  epochOf: () => epochOf,
77
96
  expiredClaimFee: () => expiredClaimFee,
@@ -90,8 +109,11 @@ __export(index_exports, {
90
109
  nameXfer: () => nameXfer,
91
110
  offer: () => offer,
92
111
  offerCancelAll: () => offerCancelAll,
112
+ offerExpiryHeightOf: () => offerExpiryHeightOf,
93
113
  parseAmount: () => parseAmount,
94
114
  parseRecord: () => parseRecord,
115
+ payloadHash: () => import_csd_codec4.payloadHash,
116
+ requiredClaimDepth: () => requiredClaimDepth,
95
117
  resolve: () => resolve,
96
118
  tokenMeta: () => tokenMeta,
97
119
  tradeFee: () => tradeFee,
@@ -168,6 +190,14 @@ var SALT_RE = /^[0-9a-fA-F]{16,128}$/;
168
190
  var RESERVED_NAMES = /* @__PURE__ */ new Set(["csd", "treasury", "admin", "official", "root", "www", "support"]);
169
191
  var COMMIT_MAX_BLOCKS = 8 * import_csd_codec.EPOCH_LEN;
170
192
  var epochOf = (height) => Math.floor(height / import_csd_codec.EPOCH_LEN);
193
+ var claimWindowAt = (height) => height >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
194
+ var claimWindowOf = (claimUntilHeight) => claimUntilHeight - CLAIM_WINDOW_BLOCKS_V20 >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
195
+ var claimGraceOf = (claimUntilHeight) => claimUntilHeight - CLAIM_WINDOW_BLOCKS_V20 >= V20_HEIGHT ? CLAIM_FILL_GRACE_BLOCKS : 0;
196
+ var offerExpiryHeightOf = (expiresEpoch, anchorHeight) => {
197
+ const raw = (Number(expiresEpoch ?? 0) + 1) * import_csd_codec.EPOCH_LEN;
198
+ const capped = (epochOf(anchorHeight) + MAX_OFFER_EPOCHS + 1) * import_csd_codec.EPOCH_LEN;
199
+ return Math.min(raw, Math.max(V21_HEIGHT, capped));
200
+ };
171
201
  var isNameGive = (g) => typeof g.name === "string";
172
202
  var isTokenWant = (w) => typeof w.ticker === "string";
173
203
 
@@ -464,9 +494,33 @@ function resolve(events, tipHeight) {
464
494
  const b = bids.get(o.bid);
465
495
  if (b && b.status === "open" && b.bidder === buyer) b.status = "done";
466
496
  };
467
- const claimGrace = (o) => o.claimUntilHeight !== void 0 && o.claimUntilHeight - CLAIM_WINDOW_BLOCKS_V20 >= V20_HEIGHT ? CLAIM_FILL_GRACE_BLOCKS : 0;
497
+ const claimGrace = (o) => o.claimUntilHeight !== void 0 ? claimGraceOf(o.claimUntilHeight) : 0;
468
498
  const claimHeld = (o, height) => o.claimedBy !== void 0 && o.claimUntilHeight !== void 0 && height < o.claimUntilHeight + claimGrace(o);
469
- const claimWindowAt = (height) => height >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
499
+ const openFillReject = (o, height, who) => {
500
+ if (!(height >= V13_HEIGHT && !o.taker)) return void 0;
501
+ if (height < V17_HEIGHT) return "v1.3: open CSD-quoted fills disabled (offer must be taker-bound)";
502
+ if (!(claimHeld(o, height) && who === o.claimedBy)) return "v1.7: open offer \u2014 claim it first (no live claim by you)";
503
+ return void 0;
504
+ };
505
+ const deliverNameToBuyer = (n, who, ev) => {
506
+ n.owner = who;
507
+ n.locked = false;
508
+ n.addr = void 0;
509
+ n.profile = void 0;
510
+ if (ev.height >= V13_HEIGHT) {
511
+ n.effHeight = ev.height;
512
+ n.pos = ev.pos;
513
+ n.id = ev.txid;
514
+ n.height = ev.height;
515
+ n.viaFill = true;
516
+ }
517
+ };
518
+ const releaseGiveLock = (o, who, amt) => {
519
+ const t = o.give.ticker;
520
+ bal(t, o.seller).locked -= amt;
521
+ bal(t, who).available += amt;
522
+ offerLock.delete(o.id);
523
+ };
470
524
  for (const ev of ordered) {
471
525
  if (ev.height < ACTIVATION_HEIGHT) continue;
472
526
  if (ev.height !== pendingBlock) {
@@ -921,23 +975,8 @@ function resolve(events, tipHeight) {
921
975
  buyer.available -= amt + fee;
922
976
  bal(o.want.ticker, o.want.payto).available += amt;
923
977
  if (fee > 0n) bal(o.want.ticker, TREASURY_ADDR).available += fee;
924
- if (isNameGive(o.give)) {
925
- giveName.owner = who;
926
- giveName.locked = false;
927
- giveName.addr = void 0;
928
- giveName.profile = void 0;
929
- if (ev.height >= V13_HEIGHT) {
930
- giveName.effHeight = ev.height;
931
- giveName.pos = ev.pos;
932
- giveName.id = ev.txid;
933
- giveName.height = ev.height;
934
- giveName.viaFill = true;
935
- }
936
- } else {
937
- bal(o.give.ticker, o.seller).locked -= giveLock;
938
- bal(o.give.ticker, who).available += giveLock;
939
- offerLock.delete(o.id);
940
- }
978
+ if (isNameGive(o.give)) deliverNameToBuyer(giveName, who, ev);
979
+ else releaseGiveLock(o, who, giveLock);
941
980
  o.status = "filled";
942
981
  o.fill = { buyer: who, txid: ev.txid, height: ev.height, paid: amt.toString(), fee: fee.toString() };
943
982
  markBidDone(o, who);
@@ -951,15 +990,10 @@ function resolve(events, tipHeight) {
951
990
  note(ev, ev.txid, "fill", false, "taker-bound offer");
952
991
  continue;
953
992
  }
954
- if (ev.height >= V13_HEIGHT && !o.taker) {
955
- if (ev.height < V17_HEIGHT) {
956
- note(ev, ev.txid, "fill", false, "v1.3: open CSD-quoted fills disabled (offer must be taker-bound)");
957
- continue;
958
- }
959
- if (!(claimHeld(o, ev.height) && who === o.claimedBy)) {
960
- note(ev, ev.txid, "fill", false, "v1.7: open offer \u2014 claim it first (no live claim by you)");
961
- continue;
962
- }
993
+ const blk = openFillReject(o, ev.height, who);
994
+ if (blk) {
995
+ note(ev, ev.txid, "fill", false, blk);
996
+ continue;
963
997
  }
964
998
  const pt = ev.paidTo ?? {};
965
999
  const want = BigInt(o.want.value);
@@ -1016,15 +1050,10 @@ function resolve(events, tipHeight) {
1016
1050
  note(ev, ev.txid, "fill", false, "taker-bound offer");
1017
1051
  continue;
1018
1052
  }
1019
- if (ev.height >= V13_HEIGHT && !o.taker) {
1020
- if (ev.height < V17_HEIGHT) {
1021
- note(ev, ev.txid, "fill", false, "v1.3: open CSD-quoted fills disabled (offer must be taker-bound)");
1022
- continue;
1023
- }
1024
- if (!(claimHeld(o, ev.height) && who === o.claimedBy)) {
1025
- note(ev, ev.txid, "fill", false, "v1.7: open offer \u2014 claim it first (no live claim by you)");
1026
- continue;
1027
- }
1053
+ const blk = openFillReject(o, ev.height, who);
1054
+ if (blk) {
1055
+ note(ev, ev.txid, "fill", false, blk);
1056
+ continue;
1028
1057
  }
1029
1058
  const pt = ev.paidTo ?? {};
1030
1059
  const want = BigInt(o.want.value);
@@ -1052,26 +1081,14 @@ function resolve(events, tipHeight) {
1052
1081
  note(ev, ev.txid, "fill", false, "name vanished (consensus violation)");
1053
1082
  continue;
1054
1083
  }
1055
- n.owner = who;
1056
- n.locked = false;
1057
- n.addr = void 0;
1058
- n.profile = void 0;
1059
- if (ev.height >= V13_HEIGHT) {
1060
- n.effHeight = ev.height;
1061
- n.pos = ev.pos;
1062
- n.id = ev.txid;
1063
- n.height = ev.height;
1064
- n.viaFill = true;
1065
- }
1084
+ deliverNameToBuyer(n, who, ev);
1066
1085
  } else {
1067
1086
  const amt = offerLock.get(o.id);
1068
1087
  if (amt === void 0) {
1069
1088
  note(ev, ev.txid, "fill", false, "offer lock missing");
1070
1089
  continue;
1071
1090
  }
1072
- bal(o.give.ticker, o.seller).locked -= amt;
1073
- bal(o.give.ticker, who).available += amt;
1074
- offerLock.delete(o.id);
1091
+ releaseGiveLock(o, who, amt);
1075
1092
  }
1076
1093
  feesPaid += fee;
1077
1094
  o.status = "filled";
@@ -1162,34 +1179,66 @@ function canonicalState(s) {
1162
1179
  const { events: _events, ...data } = s;
1163
1180
  return JSON.stringify(sortKeys(data));
1164
1181
  }
1182
+
1183
+ // src/client.ts
1184
+ var import_csd_codec3 = require("@inversealtruism/csd-codec");
1185
+ var CLAIM_ATTACKER_Q = 0.2;
1186
+ var CLAIM_MIN_DEPTH = 3;
1187
+ var COMMIT_REVEAL_MIN_DEPTH = 3;
1188
+ function requiredClaimDepth(valueSats, height) {
1189
+ const r = CLAIM_ATTACKER_Q / (1 - CLAIM_ATTACKER_Q);
1190
+ const V = Number(valueSats);
1191
+ const R = (0, import_csd_codec3.blockReward)(height) || import_csd_codec3.INITIAL_REWARD;
1192
+ const max = claimWindowAt(height) - 5;
1193
+ for (let D = CLAIM_MIN_DEPTH; D <= max; D++) {
1194
+ if (Math.pow(r, D) * V <= D * R) return { depth: D, reversalPct: Math.pow(r, D) * 100, capped: false };
1195
+ }
1196
+ return { depth: max, reversalPct: Math.pow(r, max) * 100, capped: true };
1197
+ }
1198
+
1199
+ // src/index.ts
1200
+ var import_csd_codec4 = require("@inversealtruism/csd-codec");
1165
1201
  // Annotate the CommonJS export names for ESM import in node:
1166
1202
  0 && (module.exports = {
1167
1203
  ACTIVATION_HEIGHT,
1168
1204
  ADDR_RE,
1169
1205
  AMOUNT_RE,
1206
+ BID_KEYS,
1207
+ CLAIM_ATTACKER_Q,
1170
1208
  CLAIM_COOLDOWN_BLOCKS,
1171
1209
  CLAIM_FILL_GRACE_BLOCKS,
1210
+ CLAIM_MIN_DEPTH,
1172
1211
  CLAIM_WINDOW_BLOCKS,
1173
1212
  CLAIM_WINDOW_BLOCKS_V20,
1174
1213
  COMMIT_MAX_BLOCKS,
1214
+ COMMIT_REVEAL_MIN_DEPTH,
1175
1215
  CONF_TOKEN_FILL,
1176
1216
  DEPLOY_FEE,
1217
+ DEPLOY_KEYS,
1177
1218
  DOMAIN,
1178
1219
  EPOCH_LEN,
1179
1220
  FEE_BPS,
1180
1221
  FEE_BPS_V16,
1222
+ HALVING_INTERVAL,
1181
1223
  HASH_RE,
1224
+ INITIAL_REWARD,
1182
1225
  MAX_ACTIVE_CLAIMS,
1183
1226
  MAX_AMOUNT,
1184
1227
  MAX_OFFER_EPOCHS,
1185
1228
  MAX_RECORD_BYTES,
1229
+ MINT_KEYS,
1230
+ MIN_FEE_ATTEST,
1231
+ MIN_FEE_PROPOSE,
1186
1232
  NAME_FEE_SHORT_V18,
1187
1233
  NAME_FEE_V18,
1188
1234
  NAME_GRACE_EPOCHS,
1235
+ NAME_KEYS,
1189
1236
  NAME_PREMIUM_DECAY_EPOCHS,
1190
1237
  NAME_PREMIUM_START,
1191
1238
  NAME_RE,
1192
1239
  NAME_TERM_EPOCHS,
1240
+ NPROFILE_KEYS,
1241
+ OFFER_KEYS,
1193
1242
  PKEY,
1194
1243
  PROFILE_MAX_KEYS,
1195
1244
  PROFILE_MAX_VALUE_BYTES,
@@ -1201,6 +1250,7 @@ function canonicalState(s) {
1201
1250
  SCORE_CLAIM,
1202
1251
  SCORE_FILL,
1203
1252
  TICKER_RE,
1253
+ TRANSFER_KEYS,
1204
1254
  TREASURY_ADDR,
1205
1255
  V11_HEIGHT,
1206
1256
  V12_HEIGHT,
@@ -1214,8 +1264,13 @@ function canonicalState(s) {
1214
1264
  V20_HEIGHT,
1215
1265
  V21_HEIGHT,
1216
1266
  bid,
1267
+ blockReward,
1217
1268
  buildRecord,
1269
+ canonicalJson,
1218
1270
  canonicalState,
1271
+ claimGraceOf,
1272
+ claimWindowAt,
1273
+ claimWindowOf,
1219
1274
  deploy,
1220
1275
  epochOf,
1221
1276
  expiredClaimFee,
@@ -1234,8 +1289,11 @@ function canonicalState(s) {
1234
1289
  nameXfer,
1235
1290
  offer,
1236
1291
  offerCancelAll,
1292
+ offerExpiryHeightOf,
1237
1293
  parseAmount,
1238
1294
  parseRecord,
1295
+ payloadHash,
1296
+ requiredClaimDepth,
1239
1297
  resolve,
1240
1298
  tokenMeta,
1241
1299
  tradeFee,