Skip to content

Define swap offers as NIP-69 orders in pontmore/swap@1 - #28

Open
mk-Denver wants to merge 2 commits into
pontmore:mainfrom
mk-Denver:mk/nip69-offers-swap-v1
Open

mk-Denver wants to merge 2 commits into
pontmore:mainfrom
mk-Denver:mk/nip69-offers-swap-v1

Conversation

@mk-Denver

@mk-Denver mk-Denver commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #25

Adds standing swap offers as NIP-69 kind 38383 peer-to-peer order events to profiles/swap-v1.md, so Pontmore swap Agents are discoverable by the wider Nostr P2P ecosystem (Mostro, lnp2pBot, RoboSats, Peach).

Changes

profiles/swap-v1.md

  • New Offers section defining:
    • Offer event format: kind 38383, addressable d slot pontmore/swap@1:<currency>:<k>, NIP-69 tags (k, f, s, amt, fa, pm, premium, network, layer, expires_at, expiration, y, z), and Pontmore profile tags (protocol, price, channels, a escrow address, p resolver)
    • Empty content; no payment instructions in the offer
    • Direction mapping: fiat_to_btc → sell, btc_to_fiat → buy
    • Binding rules (1-12) for matching an offer to a root's terms, including: protocol tag check, d-slot currency/k consistency, expires_at later than core/accept created_at, network/layer distinction, and Bitcoin amount derivation floor(fiat.amount × 100000000 ÷ price) with exact arithmetic
    • Committed Bytes subsection: specifies the NIP-01 canonical serialization [0, <pubkey>, <created_at>, <kind>, <tags>, <content>] as the committed bytes, media type application/json, digest sha256: + event ID
    • NIP-69 amt Deviation subsection: documents that amt 0 is derived from price at binding time, not from a public API; aggregators can list but cannot quote sats
    • Interoperability subsection: aggregator listing, Mostro cannot take without the profile, lifecycle mismatch
    • Freshness guidance: non-proposing Agent MAY decline a superseded or materially worse quote; proposer MAY cancel before acceptance
    • Privacy guidance: Agent SHOULD NOT publish fa maximums that reveal exact liquidity; MAY round down to a coarse value
    • Three open questions (normative freshness tolerance, channel registry, NIP-40 expiration on cancel)
  • Purpose updated: offers are now defined; "market price discovery or price formation" replaces "pricing, exchange-rate calculation"; deterministic conversion carved out to Offers
  • Commitments quote key scoped to the standing public price offered through the NIP-69 event; validation wording corrected (Nostr event signature, core/accept-time expiry)
  • Quote ownership scoping added: NIP-69 offer is a standing public price, not a PIP-01 service quote; a future service-fee quote MUST use a distinct key
  • Conformance Vectors expanded with offer binding (matching/non-matching), expired/superseded offers, and Bitcoin-amount-from-price vectors

PIP-01-escrow-descriptor.md

  • Fees and Quotes: carves out the profile-defined-public-offer exception — the profile owns the offer format and binding rules; a coexisting service-schema quote MUST use a distinct key and MUST NOT reuse the offer's key; the root binds through its profile-defined commitment field

PIP-02-coordination-event-chains.md

  • Removes PontSwap and PactAgent product names from the coordination terminology note
  • Profile section updated to mention standing swap offers as NIP-69 order events

README.md

  • Terminology Note: removes PontSwap product name
  • Design Boundary: notes a profile MAY define a public offer format; application-owned list changes from "offers, quotes, and business policy" to "pricing, liquidity, and business policy"

.gitignore

  • Adds drafts/ to exclude working drafts from commits

Interoperability notes

NIP-69 aggregators can list Pontmore offers. Cross-platform settlement (e.g. with Mostro) requires implementing pontmore/swap@1 — the interop gain is aggregator visibility, not shared settlement. A Pontmore offer is a standing quote that stays pending and is republished, unlike NIP-69's per-trade in-progress / success lifecycle.

Open questions (from the profile)

  1. Should the price-freshness rule be normative (e.g. a maximum tolerance) or remain Agent policy?
  2. Should channels reference a named registry or remain any versioned identifier?
  3. Should NIP-40 expiration on a withdrawn (canceled) offer be required so relays drop it?

@mk-Denver
mk-Denver marked this pull request as ready for review October 19, 2026 12:21
@mk-Denver

Copy link
Copy Markdown
Contributor Author

@okjodom Please review this PR at your earliest convinience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define swap offers as NIP-69 orders in pontmore/swap@1

1 participant