Propose NIP for bounties backed by zap-native, trusted escrow agents#1714
Propose NIP for bounties backed by zap-native, trusted escrow agents#1714vcavallo wants to merge 3 commits intonostr-protocol:masterfrom
Conversation
|
Due to my ignorance, I may be mixing up replaceable events with non-replaceable, either in the implications of my proposal and/or in suggested Kind numbers. |
|
|
Replaceable events, and escrow sound like a risk. Signed non-replaceable events are required to establish a trail of signed events. Looking forward to seeing bounties move to nostr, and looking forward to galaxy brain dev technical review. |
|
Would be nice to test this flow with a non-technical graphical UI (don't require using one of fiatjaf's assembly CLI tools). |
Definitely. Some of these events should be replaceable (or re-designed) - ie Arbiter/Agent registration - you should be able to change your fee level, or perhaps the fee should be determined per Task acceptance (though this makes the negotiation process between Agent/Patron more frictionful). But most of them should not! To be honest, I didn't consider replaceable/non-replaceable when I first prototyped the implementation but it definitely needs another around taking that into account. Thanks for the thoughts |
|
Hey @vcavallo, this is awesome, been thinking about this too. I'm not familiar with how to use Cashu mints as escrows, but I've heard similar that Cashu might be able to attach spend conditions to sats in escrow. With the rise of EVM compatible bitcoin L2's, and swap services like Boltz, do you think it's viable that This would keep it all non-custodial, which might be a requirement for escrow providers that do not wish to take custody due to regulatory concerns etc.. |
There was, briefly. It needs some rather large changes though, so nothing is live and cliackable at the moment. I may have considerably more time to devote to this quite soon. I will post here.
I agree that there are endless improvements over the custodial version - especially with cashu mints! And I'd like to seem them explored eventually - but I don't want that to hold anything up. Ideally, this would be built as a flexible enough base layer that different escrow and custody options could be explored and built as competitive next layers. |
|
I've thoroughly updated the 3400.md file to incorporate changes suggested by @fiatjaf in a nostr conversation. I've also updated the top level comment to reflect this. I'll also point any newcomers to catallax.network where I've written a lot more. Current plan is to create the first reference implementation (client and relay) and see where we go from there. ps @PatrickGeyer you might like to check out the aforementioned site. |
|
First demo client is available here: https://npub1cyqjvgjver3v9affrr64tmsetxwyf0jf4sumsnmj3zsel5md4ynqku9kka.shakespeare.to/catallax |
This is live now @alltheseas - see above |
|
@vcavallo pretty interesting stuff here. How are things evolving? |
@4G0R4 demo client is live, sats have been paid for actual bounties. follow links at https://catallax.network for more. things should evolve significantly by the end of the nosfabrica WoTathon |
|
Deployed a fork at https://catallax.vercel.app any reason why "Grape" does not load as 🍇? What are the chance to edit or delete arbiters' offers? |
|
Interesting stuff! Any reason this is not merged? I looked into the demo client, bounties are active on damus, I will work on some, cheers. |
This PR is to propose a new set of Kinds for facilitating contract work marketplaces backed by trusted escrow agents. I've referred to it as NIP-3400 because I'm not sure how to propose new draft NIPs numbers.
See
3400.mdfor a full write-up.There is also an explainer site at catallax.network where I'm thoroughly exploring this idea, and a live demo client here. The repo for the demo client is here
Below is an copy of the NIP for anyone too lazy to open the
3400.mdfile.NIP-33400
Catallax: Contract Work Protocol
draftoptionalThis NIP defines a set of event kinds for implementing "Catallax", a decentralized contract work system that facilitates connections between patrons (who need work done), free agents (who perform the work), and arbiters (who ensure work meets requirements and handle payments).
Abstract
Catallax enables decentralized contract work through a simple escrow system built on Nostr. It defines two parameterized replaceable event kinds (33400, 33401) and one regular event kind (3402) that allow arbiters to advertise their services, patrons to create task proposals, and arbiters to conclude tasks with payment confirmation. The system keeps communication on Nostr while leveraging Lightning or other payment systems for the actual value transfer.
Specification
Overview of the Workflow
Kind 33400: Arbiter Announcement
Parameterized replaceable event that advertises arbiter services.
{ "kind": 33400, "content": { "name": "String: title of the service", "about": "String (optional): additional service details", "policy_text": "String (optional): full text of any relevant policies (dispute, terms, etc.)", "policy_url": "String (optional): URL to policy document" }, "tags": [ ["d", "<identifier for this specific arbiter service>"], ["p", "<arbiter-pubkey>", "<optional recommended relay URL>"], ["r", "<string (optional); arbiter details web URL>"], ["t", "<service category; string (optional)>"], ["t", "<additional service categories (optional)>"], ["fee_type", "<flat|percentage>"], ["fee_amount", "<amount in sats if flat or decimal 0.0-1.0 if percentage>"], ["min_amount", "<optional minimum task bounty in sats>"], ["max_amount", "<optional maximum task bounty in sats>"] ] }Tags:
d: Unique identifier for this specific arbiter service configurationp: The arbiter's public keyr: Optional web URL with more details about the arbitert: Service categories the arbiter specializes in (e.g., "programming", "design", "writing")fee_type: Either "flat" or "percentage"fee_amount:min_amount: Optional minimum task value in satoshismax_amount: Optional maximum task value in satoshisKind 33401: Task Proposal
Parameterized replaceable event that defines a work task with requirements and payment terms.
{ "kind": 33401, "content": { "title": "String: concise task title", "description": "String: detailed task description", "requirements": "String: specific deliverable requirements", "deadline": "Unix timestamp in seconds (optional)" }, "tags": [ ["d", "<unique task identifier>"], ["p", "<patron-pubkey>", "<optional recommended relay URL>"], ["p", "<arbiter-pubkey>", "<optional recommended relay URL>"], ["p", "<worker-pubkey (added when in progress)>", "<optional recommended relay URL>"], ["a", "33400:<arbiter-pubkey>:<d-tag-value-of-arbiter-service>", "<relay-url>"], ["amount", "<integer in sats>"], ["t", "<task category (optional)>"], ["t", "<additional task categories (optional)>"], ["status", "<proposed|funded|in_progress|submitted|concluded>"], ["e", "<event-id of zap receipt when escrow funded>", "<relay-url>", "zap"], ["r", "<string (optional); task details web URL>"] ] }Tags:
d: Unique identifier for this taskp: Multiple p tags:a: Reference to the arbiter's service announcementamount: Total task payment amount in satoshist: Task categories (e.g., "website", "logo", "marketing")status: Current task statusproposed: Initial task proposalfunded: Escrow has been funded by patronin_progress: Free Agent has been assigned, work has begunsubmitted: Work has been submitted for reviewconcluded: Task is complete, payment has been madeewith marker "zap": Reference to a zap receipt event (kind 9735) when the task is fundedr: Optional web URL with more details about the taskKind 3402: Task Conclusion
Regular event (not replaceable) that documents the resolution of a task.
{ "kind": 3402, "content": { "resolution_details": "String: description of the task outcome and resolution" }, "tags": [ ["e", "<payout-zap-receipt-event-id>", "<optional recommended relay URL>"], ["e", "<task-proposal-event-id>", "<optional recommended relay URL>"], ["p", "<patron-pubkey>", "<optional recommended relay URL>"], ["p", "<arbiter-pubkey>", "<optional recommended relay URL>"], ["p", "<worker-pubkey>", "<optional recommended relay URL>"], ["resolution", "<successful|rejected|cancelled|abandoned>"], ["a", "33401:<patron-pubkey>:<d-tag-value-of-task>", "<relay-url>"] ] }Tags:
e: References:p: Multiple p tags for all parties involved:resolution: Final status of the tasksuccessful: Work was accepted and payment sent to workerrejected: Work did not meet requirements, payment returned to patroncancelled: Task was cancelled before completionabandoned: Worker abandoned the task, payment returned to patrona: Addressable reference to the task proposalClient Behavior
Basic Client Requirements
Clients implementing Catallax should:
"d" Tag Identifiers
For parameterized replaceable events (kinds 33400 and 33401), clients should follow these practices for "d" tag values:
Use descriptive, meaningful identifiers that relate to the content:
service-category-name(e.g., "web-dev-escrow", "design-arbiter")task-name-slug(e.g., "landing-page-design", "logo-creation")Ensure uniqueness within a user's events of the same kind:
Allow users to customize identifiers but validate uniqueness before publishing
These identifiers will be critical for maintaining referential integrity between services, tasks, and conclusions throughout the Catallax system.
Arbiter Interfaces
Clients should enable arbiters to:
Patron Interfaces
Clients should enable patrons to:
Worker Interfaces
Clients should enable workers to:
Relay Behavior
Relays are encouraged to support all three kinds (33400, 33401, and 3402). While kinds 33400 and 33401 are parameterized replaceable events, relays should:
Note: While standard Nostr protocol behavior only requires storing the latest version of replaceable events, Catallax-specific relays can choose to maintain full history to ensure the integrity of the contracting system and enable dispute resolution. (This isn't a hard requirement, and it introduces overhead cost for the relay, but the cost may be offset in clever ways justified by the added auditing features.)
Example Flow
Arbiter announcement:
{ "kind": 33400, "content": { "name": "Web Development Escrow", "about": "Specialized in full-stack web development contract arbitration" }, "tags": [ ["d", "web-dev-escrow-service"], ["p", "8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af"], ["t", "programming"], ["t", "web development"], ["fee_type", "percentage"], ["fee_amount", "0.05"], ["min_amount", "100000"] ] }Task proposal (initial):
{ "kind": 33401, "content": { "title": "Build a simple landing page", "description": "Create a responsive landing page for a small business", "requirements": "HTML/CSS/JS, responsive design, contact form, 3 sections" }, "tags": [ ["d", "landing-page-task-123"], ["p", "e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731"], ["p", "8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af"], ["a", "33400:8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af:web-dev-escrow-service"], ["amount", "500000"], ["t", "web development"], ["status", "proposed"] ] }Task proposal (updated after funding):
{ "kind": 33401, "content": { "title": "Build a simple landing page", "description": "Create a responsive landing page for a small business", "requirements": "HTML/CSS/JS, responsive design, contact form, 3 sections" }, "tags": [ ["d", "landing-page-task-123"], ["p", "e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731"], ["p", "8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af"], ["a", "33400:8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af:web-dev-escrow-service"], ["amount", "500000"], ["t", "web development"], ["status", "funded"], ["e", "9f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c", "", "zap"] ] }Task proposal (updated after assigning worker):
{ "kind": 33401, "content": { "title": "Build a simple landing page", "description": "Create a responsive landing page for a small business", "requirements": "HTML/CSS/JS, responsive design, contact form, 3 sections" }, "tags": [ ["d", "landing-page-task-123"], ["p", "e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731"], ["p", "8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af"], ["p", "53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6aff34c7bf"], ["a", "33400:8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af:web-dev-escrow-service"], ["amount", "500000"], ["t", "web development"], ["status", "in_progress"], ["e", "9f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c", "", "zap"] ] }Task conclusion:
{ "kind": 3402, "content": { "resolution_details": "Task completed successfully, landing page delivered with all requirements met." }, "tags": [ ["e", "7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6aff34c"], ["e", "b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52"], ["p", "e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731"], ["p", "8f34c7bf53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6af"], ["p", "53de3a52b325e2cf10b52801dcb4a731e9e4fa7b9311434c7f6ec6aff34c7bf"], ["resolution", "successful"], ["a", "33401:e9e4fa7b9311434c7f6ec6aff34c7bf53de3a52b325e2cf10b52801dcb4a731:landing-page-task-123"] ] }References