[Draft/RFC] Escrow & dispute extension for the marketplace order flow (market-spec / NIP-99)#2323
Draft
Colabonate wants to merge 2 commits into
Draft
Conversation
ba9b442 to
f64cf52
Compare
Align listing reference with market-spec item tag Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The GammaMarkets market-spec already standardizes the NIP-99 order/payment/status flow
(
kind:16order,kind:17payment receipt) — nicely. The one thing it explicitly leavesout is escrow and dispute resolution.
That gap is exactly what I've built and run in production: Lightning hold-invoice escrow
with a third-party-resolvable dispute path. This proposes those two pieces as an
extension on top of market-spec, not a competing order model.
I previously opened this PR with a much larger scope (identity levels, reputation, DAO
governance, a token, and my own order kinds). That was a mistake — the order layer is
already covered by market-spec, and the rest are product concerns, not protocol concerns.
I've cut it down to the genuinely missing, generically useful piece.
The two events
Both reference an existing market-spec order via its
orderid.Escrow State — tracks held funds:
HELD → RELEASED | REFUNDED | DISPUTED.Dispute — a public, neutral claim against an order:
OPEN → IN_REVIEW → RESOLVED.(Full schemas in the file diff.)
One honest architectural note up front
market-spec orders are NIP-17 encrypted DMs. My escrow and dispute events are
public addressable events — deliberately, because a third-party arbitrator and an
escrow holder both need to read a record that isn't private to buyer+seller. So this is
vocabulary-compatible with market-spec, not wire-compatible. I'd like feedback on whether
that asymmetry is acceptable or a dealbreaker.
Design questions I'd genuinely like input on
Escrow as a new kind vs. an extra
typeon market-speckind:16? The Gammacollective may prefer escrow to live as a new
typevalue on the existing order kind.Public escrow/dispute vs. encrypted orders — is the visibility asymmetry above
workable, or should escrow records be reachable some other way?
Who signs the escrow event — the hold-invoice provider, or either party?
Does a generic "marketplace dispute" belong in this NIP, in a separate
resolver-agnostic NIP that escrow merely points to, or is it client-defined?
Listing reference — escrow/dispute reference the listing via market-spec's
itemtag (
["item", "30402:<pubkey>:<d>", "<qty>"]), matching howkind:16orders referenceproducts. Consistent with market-spec, or is repeating it on the escrow event redundant?
Reference implementation
Running in production (currently with bespoke public ticket kinds, being aligned to
market-spec vocabulary — see ADR-142/143 in the repo):
https://github.com/Colabonate/Colabonate-App
apps/server/services/nostr-relay.tsapps/server/services/kind-mapping.tsI'd love for the Gamma collective (Shopstr, Cypher, Plebeian, Conduit) to sanity-check
whether escrow/dispute should live here or inside market-spec itself.
Author
Deniz Yilmaz · npub12sr83yw7psyjt9j96sdh8qq4w3qjls0phhazhs3vgcs6wwtf2lysgwgdku