Skip to content

Releases

KaleidoSwap SDK v0.18.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 07:58
cb17f16

BREAKING — USDT-RGB lock consignments move over the maker API

RGB proxy protocol 1.0 (rgb-lib 0.11.2) has no lookup by recipient id, so the
maker (kaleidoswap-maker-rs#1074) stopped exchanging HTLC lock consignments
through a proxy and dropped transportEndpoints from the rgb object of a
create response.

  • RgbLock.transport_endpoints and RgbHtlcContext.transport_endpoints are
    removed, with the check that every endpoint was rpc:// or rpcs://. A
    transportEndpoints from an older maker is ignored.
  • Added RgbLockConsignment (consignment, base64; txid; vout) and two
    client methods, both authenticated with the swap's swapAuth:
    • post_submarine_rgb_lock / postSubmarineRgbLock: a submarine taker
      locks with rgb-lib's send and no transport endpoint, then hands the
      consignment to POST /v2/swap/submarine/{id}/rgb-lock. Posting again
      replaces a consignment rgb-lib refused, until the pay deadline.
    • get_reverse_rgb_lock / getReverseRgbLock: a reverse taker reads the
      maker's consignment from GET /v2/swap/reverse/{id}/rgb-lock and accepts
      it with rgb-lib's accept_htlc_consignment.
  • examples/rgb-regtest pins rgb-lib to kaleidoswap/rgb-lib 3eb09ae
    (ks/dev, the fork merged onto upstream master, 0.11.2-rc.2) and uses the two routes.

KaleidoSwap SDK v0.17.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 11:13
da29db1

One name on every registry: kaleidoswap

The SDK is published as kaleidoswap on npm, PyPI and (by git tag) Cargo,
and its React Native package as kaleidoswap-react-native.

Up to 0.16.0 From this release
npm @kaleidorg/swap-sdk kaleidoswap
npm (React Native) @kaleidorg/swap-sdk-react-native kaleidoswap-react-native
PyPI kaleidorg-swap-sdk kaleidoswap
Python import kaleidorg_swap_sdk kaleidoswap
Rust crate and import kaleidorg-swap-sdk / kaleidorg_swap_sdk kaleidoswap

The rename itself changes only names; the API changes in this release are
listed below. To migrate, swap the dependency and replace the old name in
imports (@kaleidorg/swap-sdk/arkade becomes kaleidoswap/arkade). The old
packages stay published and are deprecated in favour of the new ones.

The React Native package's optional ./arkade entry still re-exports
@kaleidorg/swap-sdk/arkade below 0.14, the last line built on
@arkade-os/sdk 0.4.

Added — apiKey on kaleidoswapHttpTransport

The Arkade corridor transport takes the partner's kld_ key as apiKey and
sends it as Authorization: Bearer … on every corridor request to the maker's
origin, so swaps created through the Arkade venue are attributed like those
created on the /v2 routes.

BREAKING — Removed: the organisation-key client

Swaps are attributed with the organisation's kld_ key alone. The
organisation-key client and everything that sent X-Kaleido-Org-Key are
gone:

  • Rust: kaleido::OrgKey, kaleido::ORG_KEY_HEADER, KaleidoOrgClient,
    KaleidoOrgClientOptions, BoltzApiClientV2::org_key and
    MakerAttribution::OrgKey (an org_key answer now reads as
    MakerAttribution::Other). kaleido::ATTRIBUTION_HEADER stays.
  • Python: SwapClient.kaleido_org and SwapClient.org_key.
  • WASM/TS: SwapClient.forKaleidoOrg, the orgKey getter,
    createKaleidoOrgClient, KaleidoOrgClientOptions, ORG_KEY_HEADER and
    normalizeOrgKey, plus the orgKey option on PayThroughClient and
    kaleidoswapHttpTransport. ATTRIBUTION_HEADER is still exported, now
    from the partner-key module, and MakerAttribution drops "org_key".
  • WASM/TS: the allowBrowser option on forKaleidoMaker and
    createKaleidoMakerClient. Every key Platform issues builds in a page, a
    worker and an extension already, so the override had nothing left to allow;
    passing it is now an unknown-option error.

To keep attributing swaps, build the client from the kld_ key instead:
KaleidoMakerClient in Rust, SwapClient.kaleido_maker in Python,
createKaleidoMakerClient in TypeScript, or the apiKey option on
PayThroughClient.

BREAKING — Rust core: elements 0.27 and secp256k1 0.33, merged from upstream boltz-rust

This merges SatoshiPortal/boltz-rust trunk as of 2026-11-17 (previous merge
point 7542d2e). Only the Rust crate's dependency surface changes; the
TypeScript, Python and React Native APIs are unchanged.

  • elements moves from 0.26 to 0.27. Rust callers that build or inspect
    elements types the SDK hands out (transactions, witnesses, proofs) move to
    0.27 with it.
  • The MuSig2 dependency moves from a git pin of the yanked
    secp256k1 0.32.0-beta.2 to secp256k1 0.33.1 from crates.io, so a fresh
    dependency resolution no longer needs a git source. Nonces are generated
    with the 0.33 API from OS randomness, the signing key and fresh extra
    randomness.
  • electrum-client moves to 0.25.2.
  • The crate root re-exports elements::hex::DisplayHex in place of
    elements::hex::ToHex, which elements 0.27 no longer has. Call
    to_lower_hex_string() where you called to_hex().
  • The toolchain is pinned to Rust 1.100 in rust-toolchain.toml and CI.

Changed — claims and refunds read their lockup from the chain client

  • A claim takes its lockup UTXO only from the caller's chain client. When the
    client errors or does not see the lockup yet, building the claim fails and
    can be retried; it no longer falls back to the maker's copy of the lockup
    transaction. Wallets that claim as soon as the maker reports the lockup
    should expect, and retry, this error while their indexer catches up.
  • A refund that falls back to the maker's copy of the lockup transaction uses
    it only once the chain client returns that transaction by its txid, and
    reads the refunded output from the chain client's copy.
  • BtcSwapTx::new_refund_with_utxo and LiquidSwapTx::new_refund_with_utxo
    are new, and BtcSwapTx::new_claim_with_utxo and
    LiquidSwapTx::new_claim_with_utxo are now public: they build a claim or
    refund from a caller-provided lockup UTXO with no maker API call. They apply
    the same UTXO checks as new_claim and new_refund: the UTXO must pay the
    swap script (in the swap asset on Liquid), with exactly the expected amount
    for a claim and a positive amount for a refund. RGB HTLCs and L-USDT swaps
    keep their dedicated flows and are refused here.

Changed — dependencies

  • Cargo.lock moves to url 2.5.9 and form_urlencoded 1.2.3. Lockfile only; no
    manifest changes.

KaleidoSwap SDK v0.16.0

Choose a tag to compare

@github-actions github-actions released this 21 Nov 11:47
5d2e436

The kld_ partner key is public, and carries the partner fee

A partner's kld_<env>_<key_id>_<secret> key is now a public partner
identifier: ship it in the app as a build constant. It attributes swaps and
carries the partner's fee, and never a lower price or higher limits. The SDK
sends it on pricing and creation and exposes the partner fee line.

  • The kld_ client runs everywhere: createKaleidoMakerClient /
    BoltzClient.forKaleidoMaker in a page, a Web, shared or service worker
    and a browser extension, SwapClient.kaleidoMaker in React Native without
    { allowMobile: true }, and PayThroughClient({ apiKey }) outside a server
    runtime. allowBrowser and allowMobile are still accepted and only apply
    to a future secret, server-only key kind (ApiKeyKind::Secret, which
    Platform does not issue). New: ApiKey::kind() and
    KaleidoMakerClient::api_key_kind(), both ApiKeyKind::Public for every key.
  • The key goes on every request to the configured maker and nowhere else,
    the pair cards included, so amounts and pairHash come from the keyed card.
    KaleidoSwap takes it as api_key (Rust, Python, React Native) / apiKey
    (TypeScript), and prices its quotes from the keyed card.
  • Pay-through accepts the same partner key format as the Rust client.
  • The partner fee line: pair cards' fees carry partner_percentage /
    partnerPercentage (the partner's part of percentage, which already
    includes it; SubmarineFees, ReverseFees and ChainFees gain
    partner()), KaleidoSwap quotes carry fees.partner (from − to = maker + partner + miner; the partner line is floored as the maker charges
    it, and the maker's line rounds exactly as it does without a key), and pay-through creates carry fees.partner
    (0 when the maker omits it). The partner fee comes only from the key;
    there is no per-request fee option.
  • The X-Kaleido-Attribution answer is returned as data, not only logged:
    last_attribution() on the Rust client (MakerAttribution), the UniFFI
    SwapClient and KaleidoSwap; lastAttribution on the TypeScript
    SwapClient, KaleidoSwap and PayThroughClient; and attribution on a
    pay-through create. "none" means the maker did not recognise the key and
    answered with the public price, unattributed. A keyed create answered with
    anything but api_key also logs a warning. TypeScript adds
    MakerAttribution and readAttribution.
  • Breaking for Rust struct literals only: SubmarineFees, ReverseFees,
    ChainFees, kaleidoswap::Fees and KaleidoSwapOptions gain a field.

Deprecated — organization keys

KaleidoOrgClient and KaleidoOrgClientOptions (Rust), SwapClient.kaleido_org
(Python, React Native), createKaleidoOrgClient, BoltzClient.forKaleidoOrg,
KaleidoOrgClientOptions, ORG_KEY_HEADER, normalizeOrgKey and the orgKey
options of PayThroughClient and kaleidoswapHttpTransport (TypeScript) are
deprecated. Use the public kld_ key, which also carries the partner fee.
Nothing is removed in this release.

Fixed

  • Chain and reverse payout floors charge the pair card's fee on the converted
    payout, floor(amount × rate) − fees.total(that amount). The percentage is
    no longer taken on the lock amount and subtracted in claim units, so a
    BTC → L-USDT chain create whose claim matches the card is accepted.
    Same-asset cards (rate 1) are unchanged. The funding ceiling is the one
    shipped in 0.14.2.
  • A pair card whose fees take the whole payout (a percentage of 100 or more,
    or miner fees that saturate) is refused instead of flooring the payout at
    zero, which would have accepted any claim amount. Fee totals saturate
    rather than overflow.
  • Chain and reverse swaps recognize transaction.refunded.confirmed. The
    maker emits that, and transaction.refunded, when it reclaims its own
    lockup; transaction.refunded.mempool is not emitted and is accepted the
    same way. canRefund treats them as a cooperative refund of the taker's
    chain lockup while that lockup is still unspent. An unknown status stays
    unknown.

Changed — dependencies

  • Cargo.lock moves to quinn-proto 0.11.19, quinn-udp 0.5.16, rustls 0.23.46,
    rustls-webpki 0.103.17, webpki-roots 1.0.12, zstd-sys 2.1.3 and
    electrum-client 0.25.2. Lockfile only; no manifest changes.

Changed — documentation

  • docs/releasing.md gains a "Security releases" section: a fix is reviewed
    and tested in a private mirror that publishes nothing, then released from
    this repository as usual. SECURITY.md summarizes it under "How Fixes
    Ship".

KaleidoSwap SDK v0.15.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 15:58
1f7cb9e

BREAKING — the arkade venue moves to @arkade-os/sdk 0.5 + @arkade-os/swap 0.1

The peer ranges become @arkade-os/sdk >=0.5.0 <0.6.0 and
@arkade-os/swap >=0.1.0 <0.2.0. The venue's public surface —
ArkadeIntentsVenue, ArkadeSwapRecord, the flows seam, the serialized
covenant options — is unchanged, so consumers move on the peer ranges
alone.

  • The corridor-era RFQ surface (RfqSwapManager, the flows, the wire
    builders, httpTransport) ships as the 0.1 line's protocol
    subpath, written against the 0.5 wallet API: the port re-points the
    venue's machinery there. The maker-compatible HTTP corridor keeps
    working unmodified.
  • Flows lost their arkServerUrl argument (the server rides the
    wallet); createOffer/cancelOffer lost theirs.
  • pushClaim/pushRefundWithoutReceiver take the covenant as
    contract and return {txid, spent}/{txid, left}; the venue maps
    both onto its own stable {arkTxid} record shape and passes spent
    through so piecemeal funding stays claimable.
  • RfqSwapManager is deprecated upstream in favour of
    createSwapClient; this port is the maker-compatible stepping
    stone, and the SwapClient move is tracked as the next chapter
    (#181).

BREAKING — SwapSigner signs instead of handing out a keypair

KaleidoSwap no longer asks the signer for a secret key, so a signer can keep
its keys in a hardware wallet, a secure enclave or a remote service.

  • SwapSigner (Rust, Python, React Native, TypeScript) replaces derive_key
    with public_key(index), sign_schnorr(index, sighash) for the script-path
    claim and refund, and musig_nonce(index, session) /
    musig_partial_sign(index, session, our_nonce, their_nonce) for the
    cooperative MuSig2 key path. derive_preimage stays. The secret MuSig2 nonce
    never leaves the signer: it is generated by musig_nonce, kept, and spent
    on one partial signature. Breaking for every caller that implements
    SwapSigner; MnemonicSigner / mnemonicSigner keep working unchanged.
  • Signatures returned by a signer are checked before they go into a
    transaction: a script-path signature against the swap key, a partial
    signature against the session.
  • A MuSig2 nonce from MusigNonces (behind MnemonicSigner) signs only for
    the key and session it was generated for; any other call is an error that
    leaves the nonce in place.
  • A signer error keeps its own code (Error::Signer in the core), and a
    claim or refund the signer could not sign is retried on the next tick
    instead of failing the swap.
  • Rust: the claim and refund builders take a SpendSigner
    (SwapScript::construct_claim_with_signer,
    construct_refund_with_signer, sign_claim_with, sign_refund_with on the
    Bitcoin and Liquid transactions). The Keypair entry points stay and
    delegate to KeypairSigner. SwapFlows::verify_lockup, sign_claim and
    sign_refund take a public key or a SpendSigner instead of a Keypair.
  • TypeScript: the wasm package adds WasmMnemonicSigner, behind
    mnemonicSigner, and exports the MusigSession type.

Fixed

  • KaleidoSwap: a submarine refund takes the script path only once the
    lockup's timelock has matured. Before that, a failed cooperative refund is
    retried on the next tick instead of saving a script-path refund that cannot
    confirm yet, and watch keeps following the swap.
  • The swap status response (get_swap, and the TypeScript pay-through
    status) accepts failureDetails as a JSON object as well as a string.
    An object is returned as its JSON text, so the field's type is unchanged.
  • Esplora get_output_status (Bitcoin and Liquid) reads transaction presence
    from /tx/{txid}, so it returns None for a transaction the server has not
    seen, as documented, and errors on an output index the transaction does not
    have.

Added

  • The regtest suite runs a KaleidoSwap submarine swap whose Lightning
    payment fails through refundable, refunding and refunded, followed
    both by watch in the process that funded it and by resume in a new
    instance over the same store, and checks the refund is confirmed on chain.

Changed

  • KaleidoSwap: a reverse swap's preimage mixes 32 random bytes, drawn by
    start and kept on the record as preimageSalt, into the signer's
    preimage for the swap's index. Records written before keep the signer's
    preimage as is. SwapSigner and the store interface are unchanged.

  • KaleidoSwap prices its claims and refunds from the chain client's
    /fee-estimates instead of a flat 2 sat/vB. The new fee_policy option
    (feePolicy in TypeScript) sets the confirmation target (default 2
    blocks), a floor and a ceiling per chain (Bitcoin 1 and 500 sat/vB, Liquid
    0.1 and 1), and max_fee_percent (default 10): a spend whose fee would
    exceed that share of the lockup is not signed and fails with the new
    FEE_TOO_HIGH code, before a claim hands out the preimage, and is retried
    on the next poll. An estimate that cannot be read signs nothing and fails
    with CHAIN_UNREACHABLE; an empty one gives the floor. The cap prices a
    spend at the larger of the sizes it can have, covering the script path.
    A claim already under way is always signed: at no less than the rate its
    first attempt was signed at, which is kept in the record, and under 50% of
    the lockup (or max_fee_percent if higher). fee_sat_per_vb now fixes the
    rate and skips the estimate; it is raised to the chain's floor, and a rate
    below both floors is refused. Fee options that cannot be used are refused
    by the constructor with INVALID_AMOUNT.

  • Breaking for Rust callers of the seams: SwapFlows gains
    fee_estimates, sign_claim and sign_refund take the fee rate,
    DefaultFlows::new no longer takes one, and KaleidoSwap::with_seams
    returns a Result. EsploraBitcoinClient and EsploraLiquidClient gain
    fee_estimates.

KaleidoSwap SDK v0.14.2

Choose a tag to compare

@github-actions github-actions released this 11 Nov 08:19
5ded724

A patch release with one fix on top of 0.14.1.

Fixed

  • The amount to lock that a submarine or chain swap is checked against now
    converts the pair card's fees together with the payout, since they are in
    the payout's units, and charges the fee percentage on the gross amount.
    Submarine swaps that fund an asset (such as USDT-RGB or L-USDT to
    Lightning) no longer reject the maker's quote, and on chain swaps the bound
    is in the lockup's units. A bound that would reach u64::MAX is an error.

KaleidoSwap SDK v0.14.1

Choose a tag to compare

@github-actions github-actions released this 10 Nov 11:35
1350497

A patch release for the KaleidoSwap high-level layer: reverse-swap claims
follow the chain once started, and store indexes are taken exclusively.
Recommended for every 0.14.0 user; see the security advisory
GHSA-27v4-cvw8-64rf.

Changed

  • KaleidoSwap: once a reverse swap's claim is started, it is followed on
    chain until it confirms or something else spends the lockup, whatever the
    maker reports and also while the maker cannot be reached. A reverse swap is
    settled when its own claim confirms. The maker reporting the payment taken
    claims a lockup that is still unspent.
  • A claim falls back to the script path on any failure of the cooperative
    claim.
  • FileStore (Rust and TypeScript) hands out an index by creating a
    taken-<n> marker exclusively, so instances and processes sharing a
    directory never get the same index, and a counter that went back is
    skipped past. start also skips any index a record in the store already
    uses.
  • The store rules in each README add: keep the store directory out of device
    and cloud backups.

KaleidoSwap SDK v0.14.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 21:53
b9a9c05

This release adds KaleidoSwap, a high-level surface in the Rust core with
Python, React Native and TypeScript bindings: quote, start and resume
over the Boltz /v2 routes the maker serves, with one phase machine, injected
keys and persistence, and checks on the maker's answers before anything is
persisted. The swap engine gains the matching create-time checks against the
accepted pair card and the configured Lightning network, which are breaking
for RfqQuote::verify_receive_invoice and PayThroughClient callers. Every
binding documents the high-level API and ships simple/ and advanced/
examples.

Added — kaleidoswap, a high-level surface in the Rust core, with Python, React Native and TypeScript bindings

One verb per step — quote, start, resume — for the routes the maker
serves over Boltz /v2: Lightning to on-chain BTC or L-BTC (reverse) and
on-chain BTC or L-BTC to Lightning (submarine). A quote names both sides,
pay and receive, each an Asset: what it is and where it lives
(lightning:BTC, liquid:BTC, bitcoin:rgb:<contract>, spark:<token>), so a
destination on the wrong layer or network is refused locally, and the protocol
follows from the two sides instead of being inferred. Its amount says what
it fixes: Pay, Receive, or the Invoice a swap to Lightning pays. quote answers with a Quote or a Refusal
value; start creates the swap, verifies the lockup against the caller's own
key and persists the record, including swap_auth, before it returns, and
never moves funds. Before persisting, it checks the maker's response against
the quote: the hashlock and invoice against the swap's own preimage, the
invoice amount against the request, the payout and the lockup amount against
the quoted terms, and that the pair terms are still the ones quoted. A reverse
swap's invoice is handed out only when its lockup timeout leaves room to
confirm and claim (12 blocks on Bitcoin, 120 on Liquid, twice the claim
safety margin), measured against the configured chain client rather than the
maker; otherwise start fails with SWAP_EXPIRED, or CHAIN_UNREACHABLE when
the tip cannot be read. A Swap follows one phase machine over every protocol
(awaiting_funding → funded → locked → claiming → settled, with
refundable → refunding → refunded and failed), claims or refunds on its
own as the maker's status moves, and reports every failure as a SwapError
with a code.

The phase machine, the pricing and every check live in the Rust core
(kaleidorg_swap_sdk::kaleidoswap), so each binding inherits the same one.
Keys and persistence are injected: a SwapSigner (MnemonicSigner wraps
SwapMasterKey) and a SwapStore that also owns the BIP85 index counter. The
application implements both — foreign traits in Python and React Native, plain
objects in TypeScript — and records cross the store as JSON. The
SwapRecord the bindings return carries the fields worth showing and not the
whole document, so the maker's credential reaches a store only through
SwapStore.put. MemoryStore
ships everywhere; FileStore keeps one JSON file per swap, owner-readable
only, refuses ids that are not plain tokens, and never hands out an index
twice. resume() makes one pass over the store at startup and reports what it
settled, refunded, failed or is still following, and lists any swap it could not
move with its error — one such swap never stops the others from being resumed.
Every request to the maker has a timeout (30 s by default, maker_timeout), and
a refund falls back to the script path when the maker will not co-sign.
A refund this layer broadcast ends the swap as refunded once the chain client
sees it confirmed, since a submarine maker reports no refund status of its own.
An expired or failed submarine swap is refundable when an unspent output pays
its lockup address, read from the chain client rather than from whether a status
poll saw the funding; an unreadable chain leaves the swap in flight. watch and
settled keep polling through a maker or chain they cannot reach and keep
retrying a refund that cannot be spent yet, and end on any other error.

Chain swaps, L-USDT, RGB, the Arkade corridor, Spark and pay-through are not
routed by this layer yet and come back as a pair_unavailable refusal that
names where each one lives. The default Liquid testnet Esplora for this layer is liquid.network,
which does not rate-limit UTXO lookups. Status is polled. BoltzApiClientV2
gains base_url(), and Error in the Python and React Native bindings gains a
Swap variant carrying the code. Three examples under
typescript-sdk/examples/simple/ mirror advanced/02-submarine.ts and
advanced/03-reverse.ts in a fraction of the lines, plus a resume.ts; the
same three are in packages/react-native/examples/simple/. resume.ts exits
non-zero when a swap ends anywhere but settled, and the submarine and reverse
examples stop when resume() could not move a swap.

start parses the destination and the refund address, and checks them against
the configured network, before it contacts the maker. watch and settled
keep retrying a refund only while the failure is one waiting can fix, and end
on one that will fail the same way again.

Swap::action() reports the zero-conf limit from the maker's pair terms when
start created the swap, when the maker accepts unconfirmed funding; start
refuses pair terms the maker no longer publishes. It offers the maker's BIP21
URI as bip21 only when it names exactly the verified lockup address and
amount, with an assetid, if any, of L-BTC on Liquid, and no repeated
parameter or any other parameter, such as lightning, that a wallet could act
on instead.

A swap to Lightning checks the invoice's own expiry by the local clock: quote
and start refuse, with the new INVOICE_EXPIRED code and before the maker is
contacted, an invoice with less than MIN_INVOICE_VALIDITY (10 minutes) left,
and a quote priced against an invoice expires no later than that.

Every Swap handle one KaleidoSwap gives out on the same id — from start,
swap or resume — shares a lock: tick and refund wait for any other in
flight on that swap and reload the record from the store before acting, so two
handles never both claim or both refund.

A claim or refund is saved to the record, signed, before it is broadcast, and
its txid is recorded once the chain has it, as GET /tx/:txid reports it. A
tick or refund() that finds one saved rebroadcasts it, or records it when the
chain already has it, instead of signing a second spend of the lockup. A saved
transaction is kept through every failed broadcast except an answer that its
inputs are missing or spent; then the lockup's spender is looked up, and a spend
paying the swap is recorded as its claim or refund, any other spend ends the
attempt, and no spend leaves the next attempt to sign afresh. A swap that ends
settled or refunded drops anything saved, and refund() on an ended swap
broadcasts nothing. SwapFlows splits claim and refund into sign_claim
and sign_refund, which return a SignedTx, plus broadcast, tx_seen and
lockup_spender, and DefaultFlows::new takes the two Esplora clients.

watch and settled also keep polling through a store they cannot read and a
failed claim broadcast while the lockup is more than the claim safety margin
from its timeout. A broadcast refused with a 4xx answer is no longer retried as
transient, unless it names a timelock that is not yet final.

The headroom a reverse swap's lockup timeout must leave for start to hand
out the invoice can be set per chain with reverse_timeout_headroom
(reverseTimeoutHeadroom: { bitcoinBlocks?, liquidBlocks? } in TypeScript) in
every binding. Each chain defaults to 12 and 120 blocks as before, and a value
below one and a half times the claim safety margin (9 and 90) is raised to it.

Added — the high-level surface documented in each binding

The Python, TypeScript and React Native READMEs document KaleidoSwap in each
binding's own syntax: constructing it with a store and a signer, resume() and
following the swaps it reports, quote with the Asset values and which
Amount kind prices which route, handling a refusal, start, the swap's
action, following it to the end, and the phases. Each states the store rules:
a store belongs to one swap mnemonic, one FileStore and one KaleidoSwap
per directory per process, no resetting or restoring a store from an older
backup while its mnemonic is in use, and a new swap mnemonic when a store is
lost; and what a store of your own guarantees for put and nextIndex. The
React Native README notes that a JavaScript SwapStore, SwapSigner or phase
listener is a foreign-trait callback that has not been run on a device yet.

The React Native examples build one KaleidoSwap at app scope and share it,
and resume follows every swap still in flight before reporting the ones it
could not move. npm run typecheck:examples in packages/react-native
type-checks them against the generated module, and the React Native build in
CI runs it.

Changed

  • The atomic pair constants use the maker's canonical pair ids
    (BTC@L1/USDT-RGB@L1, USDT-RGB@L1/BTC@L1).
  • The examples of every binding are split into simple/, on the high-level
    KaleidoSwap surface, and advanced/, on the swap engine, each with a
    submarine and a reverse swap. TypeScript's examples/easy/ is now
    examples/simple/ and the numbered examples are under examples/advanced/;
    npm run typecheck in typescript-sdk/examples now checks both folders. The
    Python examples move to bindings/python/examples/advanced/ beside new
    simple/submarine.py and simple/reverse.py. The Rust examples move to
    examples/advanced/ under their existing cargo run --example names, beside
    new simple_submarine, simple_reverse, advanced_submarine and
    advanced_reverse. Each folder keep...
Read more

KaleidoSwap SDK v0.13.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 11:07
3c15495

This release hardens the swap flows following the security review of
2026-10-28: claims ask the chain, not the maker, before revealing the preimage;
create responses are bound to the requested amounts and to a locally pinned
L-USDT asset; browser requests to the maker refuse redirects; LNURL gains a
public-only egress policy and a hardened withdraw transport; magic-routing
amounts are bounded by the invoice; and per-swap secrets are redacted from Rust
Debug and Python str(). It also aligns the SDK with maker 0.11 and makes the
React Native package load the SDK again. Rust, Python, TypeScript and React
Native packages share version 0.13.0. It contains three breaking changes,
listed below: claims require a confirmed lockup by default, L-USDT on testnet
and regtest requires a pinned asset id, and the React Native
SwapClient.kaleidoMaker refuses to run in an app.

Fixed — security integration and maker compatibility

  • LNURL ignores environment proxies so DNS egress checks cannot be bypassed.
  • Reverse swaps validate the invoice on the source Lightning network, including
    Signet-to-Liquid-testnet routes, independently of the destination HTLC.
  • RGB claim preparation now requires a confirmed, unspent lockup with enough
    time before refund, using the same conservative default policy as other claims.
  • Add the maker's optional internalHop.payeeId response field across bindings
    and refresh the authenticated schema to maker 823d5677 (v0.11.0 plus the
    legacy seed compatibility fix).
  • React Native guidance now recommends the available public organization keys.
  • The RGB regtest bridge uses the current LDK macaroon credentials, channel
    amount API and actual inbound payment IDs instead of treating hashes as IDs.

BREAKING — React Native: SwapClient.kaleidoMaker refuses to run in an app

SwapClient.kaleidoMaker(makerUrl, apiKey, timeout) in
@kaleidorg/swap-sdk-react-native had no guard, so a secret kld_ partner key
could be shipped inside a mobile app, where every user can read it. It now
throws Exception.Generic before the key reaches native code. An app that
builds this client on purpose must pass the new fourth argument:
kaleidoMaker(makerUrl, apiKey, timeout, { allowMobile: true }). This mirrors
allowBrowser: true on the WASM/TypeScript forKaleidoMaker. The recommended
fix is to create attributed swaps from a server instead. The Python binding is
unchanged. Part of phase 0 of
kaleidoswap-maker-rs#578.

Fixed — React Native: the package loads the SDK again

@kaleidorg/swap-sdk-react-native@0.11.0 loaded none of the SDK.
import { SwapClient } from "@kaleidorg/swap-sdk-react-native" failed. The
entry exported only uniffiInitAsync, and the native installRustCrate did
not register the module. The Android build generates the turbo module from
the .so it builds, and the workspace's strip = true had removed the ELF
symbol table that uniffi reads the components from. ubrn found no components
and rewrote src/index.tsx, cpp/kaleidoswap-swap-sdk.cpp and
android/CMakeLists.txt for zero modules. It runs after the iOS build, so its
output replaced the correct files. The bindings left over from iOS made the
package look complete.

ubrn:android now builds with CARGO_PROFILE_RELEASE_STRIP=debuginfo. The
Android Gradle plugin still strips the library when an app is packaged. A new
check makes ubrn:build, prepack and the tarball smoke test refuse any of
those three files when it does not load kaleidorg_swap_sdk. The Python wheel
and the iOS static library are unchanged.

BREAKING — L-USDT on testnet and regtest requires a pinned asset id

The L-USDT asset a swap must carry was anchored only to the maker's pair card:
the create response was validated against asset ids the same maker served, so
a maker advertising a worthless asset as L-USDT passed every check and a
submarine or chain swap would pay real BTC for it (security review 2026-10-28,
finding 3). The asset now has to come from something the maker does not
control.

  • Rust: LiquidAssetContext::trusted_lusdt(network, pinned_asset_id) and
    trusted_lusdt_for_swap(...) resolve the trusted context without I/O: the
    canonical Liquid USDt (network::LIQUID_USDT_ASSET_ID,
    LiquidChain::canonical_lusdt) on mainnet, else the caller's pin, which is
    required on testnet and regtest where USDT is issued per deployment.
    cross_check_pair_card then refuses a maker whose pair card advertises
    another asset; expected_liquid_asset_context on the pair responses is now
    that cross-check, not a trust anchor. On mainnet
    validate_currency also refuses an L-USDT response whose asset is not the
    canonical one whatever context the caller passed.
  • UniFFI/Python: CreateSubmarineRequest, CreateReverseRequest and
    CreateChainRequest take lusdt_asset_id (optional, never sent to the
    maker). An L-USDT create on testnet or regtest without it is refused before
    any request is posted.
  • WASM/TypeScript: createSubmarineSwap, createReverseSwap and
    createChainSwap take a trailing optional lusdtAssetId with the same
    rules.
  • Examples: LUSDT_ASSET_ID pins the asset for lusdt_submarine and
    lusdt_reverse.

BTC, L-BTC and USDT-RGB swaps are unaffected.

BREAKING — claims check the chain before revealing the preimage

SwapScript::construct_claim (and prepare_liquid_claim) now ask the chain
client, in the Rust core, for the tip height and the lockup output's status
before any cooperative request or script-path witness reveals the preimage, so
UniFFI/Python/React Native, WASM/TypeScript and direct Rust callers all inherit
the check (security review 2026-10-28, findings 1 and 2). By default a claim is
refused when the chain source has not seen the lockup, when it has fewer than
one confirmation, when a spend of it is visible in the mempool or in a block,
or when the tip is within the safety margin (6 blocks on Bitcoin, 60 on Liquid)
of the swap's refund timeout. The maker's status strings are never used for
this. Zero-conf claims, including a lockup passed to with_lockup_tx and
broadcast in the same call, now need an explicit opt-in. The policy lives in
ClaimPolicy on TransactionOptions (with_min_confirmations,
with_allow_zero_conf, with_claim_safety_margin_blocks,
with_allow_conflicting_spend), in the UniFFI TransactionOptions record
(min_confirmations, allow_zero_conf, claim_safety_margin_blocks,
allow_conflicting_spend, also on LiquidPsetParams.options), and in the WASM
TxParams / LiquidPsetParams (minConfirmations, allowZeroConf,
claimSafetyMarginBlocks, allowConflictingSpend). The TypeScript
claimReverseSwap / claimChainSwap helpers forward their options, and their
own snapshot checks are unchanged.

Implementors of the BitcoinClient / LiquidClient traits must add
get_tip_height and get_output_status; the Esplora and Electrum clients
implement them (/blocks/tip/height, /tx/:txid/status,
/tx/:txid/outspend/:vout; script history on Electrum). Bitcoin Esplora
discovery still lists unconfirmed outputs, but a claim no longer proceeds on
one.

Added — create-time timeout headroom checks

CreateReverseResponse::validate_timeout_headroom(current_height, min_headroom_blocks) and CreateChainResponse::validate_timeout_headroom( from_chain, from_height, to_chain, to_height, min_claim_headroom_blocks)
refuse a response whose timeout is already mature or too close to a trusted
tip; the chain variant also requires our own lock to outlast the server's.
Exposed as validate_reverse_timeout_headroom / validate_chain_timeout_headroom
in UniFFI and validateReverseTimeoutHeadroom / validateChainTimeoutHeadroom
in WASM/TypeScript. UniFFI ChainClient gains bitcoin_tip_height and
liquid_tip_height so native callers have a trusted tip; TypeScript already has
esploraTipHeight. The reverse-swap example demonstrates both checks.

Security

  • WASM/TypeScript: browser requests to the maker no longer follow redirects.
    Native clients already refused them, but reqwest hands fetch no
    redirect mode in the browser, so a 302 from the maker was followed —
    and fetch strips only Authorization on a cross-origin hop, never a
    custom header. The per-swap X-Swap-Auth credential (and an organization
    key on a creation request) therefore rode along to whatever host the
    Location named, and the post-response guard could only report the
    disclosure afterwards. The WASM build now issues every maker request itself
    with redirect: "error": the browser rejects the request at the first
    3xx and the credential never leaves the maker's origin. The maker API
    redirects nowhere, so a well-behaved maker sees no change; a redirecting
    one now fails the call with an error naming the refusal. Security review
    2026-10-28, finding 8.
  • Create responses are bound to the amounts the caller requested. A reverse
    response's maker-generated invoice had only its payment hash checked, so a
    maker could return an invoice for ten times invoiceAmount and an automated
    payer paid it; a chain response's lockupDetails.amount and
    claimDetails.amount were never compared with userLockAmount and
    serverLockAmount, and the later lockup checks only enforced whatever the
    response said. New CreateReverseResponse::validate_amounts(request, pair)
    requires the invoice to be present, carry an amount, and equal
    invoiceAmount (compared in millisatoshis with checked arithmetic); new
    CreateChainResponse::validate_amounts(request, pair) requires exact
    equality on every leg the request fixed and non-zero legs. With the pair
    card the caller accepted, both also bound the leg the maker computed
    (floor(amount × rate) − fees.total(amount) as a floor on the payout, the
    inverse as a ceiling on the funding). A maker-issued invoice must now also
    be for the sw...
Read more

KaleidoSwap SDK v0.12.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 07:57
7ae1e93

This release adds a client for the maker's single-transaction atomic
BTC <-> USDT-RGB swaps, organization keys for partner attribution, pay-through
idempotency keys and typed swap DTOs, and hardens claims, Esplora broadcasts
and Arkade cancels. Rust, Python, TypeScript and React Native packages share
version 0.12.0. It contains two breaking changes, listed below:
forKaleidoMaker refuses workers and extensions, and swap responses are typed
DTOs in the Rust core and TypeScript.

BREAKING — WASM/TypeScript: forKaleidoMaker refuses workers and extensions

BoltzClient.forKaleidoMaker / createKaleidoMakerClient already refused a
document context, but looked for nothing else, so the attributed client built
in a Web Worker and in an MV3 extension's service worker — neither has a
document. It now also refuses any context exposing WorkerGlobalScope,
ServiceWorkerGlobalScope or SharedWorkerGlobalScope, and any browser
extension context (chrome.runtime.id or browser.runtime.id). Plain Node is
unaffected. A worker or extension that builds this client on purpose must now
pass allowBrowser: true, as a page already had to. Part of phase 0 of
kaleidoswap-maker-rs#578.

Added — organization keys for client-side attribution

Apps, extensions and web pages can now attribute their swaps to a partner
organization without shipping a secret. They use the organization's public
x-only key, registered in the partner panel with a proof of possession
(kaleidoswap-maker-rs#578).

  • Rust: kaleido::OrgKey (parse, Display, serde) and KaleidoOrgClient;
    BoltzApiClientV2::org_key().
  • Python: SwapClient.kaleido_org(maker_url, org_key, timeout) and
    org_key().
  • WASM/TypeScript: BoltzClient.forKaleidoOrg({ makerUrl, orgKey, timeoutSecs })
    and createKaleidoOrgClient, with no browser refusal, plus the orgKey
    getter. PayThroughClient and kaleidoswapHttpTransport take an orgKey
    option.

The key goes out in X-Kaleido-Org-Key on swap creation only, and only to the
configured maker. A client carries an organization key or an API key, never
both. Makers without organization-key support ignore the header and create the
swap unattributed. The SDK logs a warning when the maker reports
X-Kaleido-Attribution other than org_key.

Added — pay-through idempotency keys

PayThroughClient.create(request, { idempotencyKey, signal }) accepts a
caller-generated secret key and sends it in Idempotency-Key. Keys must be
1–128 visible ASCII characters and are validated before any request. Persist
a random UUIDv4 (or at least 128 random bits) with the payment intent before
sending, then reuse it with the same input, maker and partner attribution to
recover the original swap after a lost response or process restart.

Safe retries require maker support (companion
maker PR #712);
older makers may ignore the header. The SDK does not retry automatically or
generate replacement keys. 409 idempotency_in_flight leaves the original
outcome pending or uncertain and can require operator reconciliation;
409 idempotency_mismatch signals changed input. A 4xx status alone no longer
implies that no swap exists. Unkeyed creation keeps its existing behavior.
On the companion maker, preflight rejections do not consume the key and may be
retried under the same payment intent when the condition clears. After minting
has been attempted, even a later admission rejection leaves the key reserved
for reconciliation; errors are not durably cached as final rejections.

Security

  • Claims require trusted chain confirmation evidence and pin the lockup raw
    transaction/txid before revealing a preimage. Automatic claims fall back to
    the script path after cooperative failure. Matured refunds tolerate stale
    maker status. Claim safety margins and optional fee ceilings are explicit.
  • Esplora broadcasts check the HTTP status and parse the returned txid. The
    Liquid client previously returned a rejected broadcast's error text as a
    successful result.
  • The Arkade venue no longer cancels a prepared swap on a single unknown
    lockup read past its deadline. It waits unknownLockupGraceSeconds
    (default 15 minutes) so a late funding or a lagging indexer can still
    self-heal the record to funded.

Added

  • Stateless TypeScript eligibility and claim/refund helpers with conservative
    confirmation/CLTV checks and reuse of saved signed transactions on retries.

Added — serde-derived TypeScript swap DTOs

Create, status and restore methods now expose public Rust-derived DTOs in Node,
browser and raw WASM declarations. Tests cover consumer compilation, exact
64-bit response integers and rejection of unsafe create amounts. Restore hashes
and detail types, payout status and payment audit payloads are preserved across
WASM and native bindings. Package CI checks declaration generation and supported
maker schema compatibility; live private-maker drift detection requires the
documented read token.

BREAKING — Rust core and TypeScript: typed swap DTOs

Rust public struct literals for ClaimDetails, RefundDetails,
SwapRestoreResponse, GetSwapResponse and SwapEvent must initialize the new
optional metadata fields (None when absent). Adding fields to these public
exhaustive structs is a SemVer-major Rust source break. Generated Python
constructors default the new fields to None.

TypeScript calls previously returning any now expose checked DTOs. Use 1n
with bigint response amounts/heights; assign them to bigint, or explicitly
range-check before converting to number. Request literals now reject unmodeled
extra keys (including pairId); use the documented request shape. The generated
RgbLock.cooperativeRefund is string | undefined, so callers requiring
"rgb-coop-refund-v1" must narrow/check it explicitly. RgbLock.amount remains
contract units (six decimals for USDT-RGB), not Bitcoin satoshis. These are
TypeScript source compatibility changes, even when the HTTP wire is unchanged.

Added — rebuild swap scripts from recovery results

SwapScript.fromRestored() rebuilds BTC and L-BTC submarine, reverse and
chain-swap scripts directly from swapRestore() entries, with explicit side
selection for chain swaps. WASM/TypeScript and native bindings share canonical
tree/address validation and preserve amounts and Liquid blinding keys. Token
restores without the required asset context are rejected explicitly.

Security

  • LNURL-pay resolution requires HTTPS on clearnet, rejects redirects and URL
    credentials, bounds each request/body read to 30 seconds, and verifies the
    invoice description hash against LNURL metadata. Rustls/WebPKI replaces the
    OS trust store when the LNURL feature is enabled.

Added — Lightning-address and LNURL-pay lookup in bindings

WASM/TypeScript exports resolveLightningAddress(address, amountSat) and native
bindings export resolve_lightning_address. Both use whole satoshis, reuse the
Rust LNURL resolver and require the returned invoice amount to match the request.

Added — corridor discovery card

Rust, WASM and native clients can fetch the maker's corridor card (signature not verified) from
GET /v1/card; TypeScript exposes IntentsCorridor.card(). HTTP 404 returns
None/null, amount limits remain decimal strings, and other failures remain
errors. Only schema v0 is accepted. Raw JSON is available through
corridor_card_raw() / IntentsCorridor.cardRaw() for lossless verification;
card fetching does not verify the advertised signature.

Added — opt-in live tests against a real maker

npm run test:live in typescript-sdk runs the TypeScript package against a
regtest KaleidoSwap maker (maker-rs's e2e stack, 0.8.0 or later). It covers:

  • BTC and L-BTC submarine swaps, paid out and refunded after the timelock;
  • BTC cooperative refunds with the create-time and the recovered swapAuth;
  • L-BTC reverse claims;
  • WebSocket status;
  • SwapMasterKey restore;
  • L-USDT through the caller-funded PSET path: a reverse claim, a submarine
    paid out or refunded after the timelock, and the BTC → L-USDT chain swap;
  • the packed package in headless Firefox, running a whole reverse swap.

Where the maker co-signs only Bitcoin L1 lockups, the tests assert its refusal.
The suite skips unless KALEIDO_LIVE=1, and neither npm test nor CI runs it.
test/live/README.md has the configuration.

Fixed — a WebSocket status stream can be stopped

run_ws_loop holds a handle to its own stream, so dropping the last one never
reached the shutdown it was meant to trigger: the loop kept its socket open and
kept reconnecting. In JavaScript free() could not stop it either, and a Node
process that had watched a swap never exited. BoltzWsApi::shutdown (Rust),
SwapWsApi.close() (TypeScript) and SwapWsApi.shutdown() (UniFFI) now close
the socket with a close frame and end the loop, also while it waits to
reconnect. A stopped stream stays stopped.

Added — explicit Esplora chain-data helpers

TypeScript exports esploraFeeEstimates(url) and esploraTipHeight(url), including
a WASM-free ./chain-data entry. The helpers validate data, preserve fractional
sat/vB rates, honor deadlines/cancellation, and never substitute defaults after
a failed read. Document endpoint selection and the maker-backed methods' fixed
Liquid fee and unavailable-height placeholder.

Added — transaction recovery from saved hex

BtcLikeTransaction.fromHex(hex, "bitcoin" | "liquid") rebuilds a saved
transaction in WASM/TypeScript without signing or broadcasting. It preserves
the transaction bytes, witnesses and txid, rejects malformed or noncanonical
encodings, and uses the existing broadcast() method for explicit retries.
Native bindings expose the corresponding `from_hex(h...

Read more

KaleidoSwap SDK v0.11.0

Choose a tag to compare

@github-actions github-actions released this 12 Oct 10:44
2e7becd

Fixed — React Native peer compatibility and RGB example lock selection

The React Native package accepts @kaleidorg/swap-sdk >=0.9.0 <0.12.0,
including the coordinated 0.11.0 release. Its Arkade peer remains ^0.0.20
because older supported SDK versions require that version.

The native RGB regtest example fetches the reverse swap's lock transaction
through the swap-specific maker endpoint and verifies its transaction id and
HTLC output before saving the consignment and preparing the claim. It no longer
selects the first UTXO at the lockup address, which could be unrelated BTC.

BREAKING — Rust core: RGB-aware Bitcoin swap scripts

This release adds USDT-RGB submarine and reverse swaps for KaleidoSwap Maker
0.8.0, authenticated cooperative refunds and signed credential recovery.
Rust, Python, TypeScript and React Native packages share version 0.11.0.
RGB chain swaps remain unsupported by the SDK; the maker ships atomic-chain
pairs disabled pending production sign-off.

Was Now Migration
Rust Cooperative { .. } struct literals new optional swap_auth field add swap_auth: None for makers without auth, or the saved credential for KaleidoSwap refunds
UniFFI TransactionOptions { .. } Rust struct literals new optional swap_auth field add swap_auth: None or the saved credential; Python defaults remain optional
BtcSwapScript { .. } struct literals new public field rgb: Option<RgbHtlcContext> add rgb: None; the constructors set it from the response
Currency had three variants adds Currency::UsdtRgb ("USDT-RGB", Bitcoin only) cover it in exhaustive matches
CreateSubmarineResponse / CreateReverseResponse struct literals new field rgb: Option<RgbLock> add rgb: None
The Bitcoin branch of validate_with_currency* ignored currency resolves it and refuses anything but BTC, and refuses a BTC response that carries an RGB lock pass None or Some(Currency::Btc) for BTC swaps; validate USDT-RGB swaps with validate_rgb
UniFFI CreateSubmarineRequest / CreateReverseRequest Rust struct literals gain optional rgb_contract_id; submarine also gains rgb_max_htlc_sat add None for BTC/Liquid; pin the contract for RGB and choose the collateral cap locally; Python defaults remain optional
UniFFI CreateSubmarineResponse / CreateReverseResponse records gain rgb: Option<RgbLock> Kotlin, Swift and Python constructors take the new field

Added — RGB cooperative submarine refunds

  • Explicit prepare/begin/request/complete APIs in Rust, UniFFI/Python and
    wasm/TypeScript sign the wallet-colored refund through MuSig2 before CLTV.
    They require the maker's rgb-coop-refund-v1 capability and use the existing
    authenticated submarine /refund endpoint. Signing sessions are one-use;
    peer partials and the final signature are verified locally.
  • Caller fee inputs must be native P2WPKH/P2TR with empty scriptSig, preserving
    the colored transaction ID through wallet finalization. This also hardens
    existing unilateral RGB spends.
  • Companion maker support requires rgb-lib's read-only colored-HTLC-spend
    verifier, durable refund authorization and signing-response recovery.
    Existing script-path refunds remain available for unsupported makers.
  • Rust RgbLock and RgbHtlcContext struct literals gain optional
    cooperative_refund; add None for existing fixtures/callers.

Security — local RGB collateral and lock outpoints

  • Submarine validation caps the taker's BTC collateral at 1000 sats by default.
    validate_rgb_with_max_htlc_sat, Python rgb_max_htlc_sat and the wasm create
    method's fourth argument allow a deliberate local cap. Caps are never sent to
    the maker. A successful maker claim takes all locked sats, so spend fee caps
    do not substitute for this check.
  • RGB PSBT preparation requires the colored lock transaction in Rust, UniFFI
    and wasm/TypeScript. It never discovers an input from an address UTXO list,
    where a third-party uncolored output could prevent wallet coloring.

Added — USDT-RGB submarine and reverse swaps (Rust core)

These are the client side of the KaleidoSwap maker's RGB-on-L1 HTLC routes:
USDT-RGB → BTC Lightning (submarine) and BTC Lightning → USDT-RGB
(reverse). The HTLC is the standard Boltz taproot tree. It carries htlcSat
sats plus an RGB allocation, which the caller's RGB wallet (rgb-lib) moves.
The SDK does not depend on rgb-lib. The design follows the caller-funded
L-USDT flow; see docs/rgb-swaps-plan.md.

  • validate_rgb on both create responses checks the Boltz fields, then
    binds the response's rgb lock:

    • the contract id must be the one the caller pins (pair cards carry none);
    • the amount must be the swap amount;
    • scriptPubkey must be the swap address, and recipientId must be
      rgb-lib's canonical witness recipient id for that script on a compatible
      network. The encoder is ported and pinned by vectors from rgb-invoicing;
    • a reverse htlcSat must fund the taker's claim at claimFeeRate.
  • SwapScript::prepare_rgb_claim / prepare_rgb_refund return a
    PreparedRgbSpend. Its template is the HTLC input, an empty OP_RETURN at
    output 0 and the colored payout at output 1. There are two funding modes:

    • RgbSpendFunding::HtlcValue pays the fee from htlcSat. A reverse claim
      at the advertised rate is 195 vB, exactly what the maker sizes the lock
      for;
    • RgbSpendFunding::CallerInputs lets the wallet add BTC inputs and change,
      accepted by fund.
  • finalize_claim / finalize_refund sign the leaf only after these
    checks pass:

    • the wallet's coloring changed nothing but the 32-byte commitment;
    • rgb-lib's allocations are exactly the locked amount at output 1.

    The signature uses Prevouts::All at the re-derived HTLC input index.

  • An uncolored spend of an RGB HTLC burns the asset, so these now refuse a
    script that carries an RGB lock:

    • BtcSwapTx::new_claim / new_refund / sign_*;
    • cooperative partial signing;
    • SwapScript::construct_claim / construct_refund.
  • Error::RgbFeeInputRequired (rgb_fee_input_required) is returned when
    htlcSat cannot pay the fee and still leave a 546 sat colored output.

Added — live USDT-RGB regtest example

  • Native examples/rgb-regtest drives actual rgb-lib wallets, a maker daemon,
    Bitcoin Core/Esplora, an RGB proxy and two real Lightning nodes. rgb-lib stays
    outside the SDK and wasm dependency graph.
  • Live validation covers submarine payment/claim, a failed-payment refund with
    a wallet BTC fee input and an early CLTV rejection, and an HTLC-only reverse
    claim from a wallet with zero BTC. Actual RGB allocations and consignments
    settle; all issued units are conserved across the three wallets.
  • Private recovery state is persisted before payment/broadcast and ignored by
    Git. The example includes pinned dependencies, isolated Compose services,
    reproduction instructions and a sanitized successful-run report. Its local
    price feed supplies deterministic test quotes.

Added — USDT-RGB wire compatibility fixtures

  • Frozen maker API requests, pair cards and create responses, generated through
    the maker router at 49c6ce2; six-network recipient vectors use pinned rgb-lib.
  • SDK contract tests check response bindings, tampering and the maker's reference
    claim PSBT/fee budget. A separate maker companion PR checks the same vectors
    in its CI. Fixtures use mocked wallet/chain state; the separate native regtest
    example validates live RGB transfers.
  • RGB validation now rejects noncanonical leaf scripts and leaf versions; the
    frozen-response mutation tests exposed that these fields were previously ignored.
  • Clarified pair amount units: limits use input units, rates convert input to
    output units, and miner fees use output units.

Added — USDT-RGB bindings

  • UniFFI/Python and wasm/TypeScript expose RGB PSBT preparation, immutable
    funding, and colored claim/refund finalization. Finalization returns a base64
    PSBT and a transaction only when every input is final.
  • Native create request records accept optional rgb_contract_id; wasm create
    methods accept optional third argument rgbContractId. USDT-RGB routes require
    this caller-pinned contract before posting and validate the response against it.
    BTC and Liquid calls retain their existing defaults. RGB chain swaps are refused.
  • The native binding exposes BtcLikeTransaction.from_hex_bitcoin for local lock
    discovery and maps the typed RgbFeeInputRequired error. Existing FFI error
    variant indices are preserved.
  • After PreparedRgbSpend::fund, template() returns the frozen funded PSBT,
    its HTLC input index and requires_funding = false; the original spend is unchanged.
  • Synthetic Python and JavaScript binding tests cover both RGB directions,
    local contract pins, wrong allocations and caller-funded refunds. These do not
    validate RGB consignments or replace the separate live rgb-lib regtest tests.

Fixed — account-key restore path

TypeScript SwapMasterKey.restore(client, gapLimit?) and
restoreIndex(client, gapLimit?) explicitly use "m" with the account xpub, so
discovery searches the same child keys as deriveSwapKey. Low-level restore
methods retain their explicit path option for callers using root xpubs.

Cooperative refund authorization and signed credential recovery

Cooperative Bitcoin/Liquid submarine and chain refunds now forward the per-swap
swapAuth credential through TxParams.swapAuth in TypeScript/WASM and
TransactionOptions.swap_auth in UniFFI (with_swap_auth in Rust). Upstream
Boltz calls can still omit it. Low-level Rust refund methods keep their existing
signatures; authenticated variants add _with_swap_auth. Rust callers building
Cooperative literals must add swap_auth: None or their saved credential.

`SwapClient.recoverSwapAuth(swapId, keysSecretHex)...

Read more