Coder Social home page Coder Social logo

cashu-escrow-kit's Introduction

Ecash escrow on Nostr concept

This project originated from the Ecash Hackathon 2024.

Idea

An escrow solution for trading projects (e.g. online shops) facilitating their payments over the Cashu ecash protocol. The trading parties can agree upon an escrow coordinator which is either hardcoded or can be discovered through a Nostr announcement event. How the escrow coordinator is chosen depends on the software implementing the client library (e.g. reputation based ranking). Everyone can run an escrow coordinator and announce their service publicly trough Nostr. The buying party locks its funds in a 2-of-3 P2PK ecash token which can then be unlocked by the buyer and seller (happy path) or the coordinator and one of the trading parties (escrow mediation path).

This makes it possible to separate away the escrow coordinator from the trading plattform operator which can result in the following benefits for traders, developers and operators:

  • Distributing trust between trading plattform operator and escrow operator
  • Reducing operational burden of running a trading platform
  • Formation of an escrow coordinator market due to low entry barrier (driving down fees and favouring honest coordinators)
  • Simple integration of escrow features in all kinds of trading plattforms and applications
  • No vendor lock-in to a single large escrow coordinator necessary
  • Safer trading conditions in low trust environments (e.g. pseudonymous traders on nostr- or onion markets)
  • Good privacy for traders in happy case (coordinator has few, ephemeral informations about trade and traders)

Protocol Overview

Protocol Overview Picture

Additions and thoughts

Submitting escrow conditions

Both trading parties have to commit to their trade obligations to the coordinator. This commitment has to contain all information necessary for the coordinator to decide which trade party fulfilled their obligations in the case of an escrow mediation. This can include payout information, amounts, timeframes and a freely written trade contract. When possible, information can be submitted as hash to improve privacy against the coordinator.

Nostr communication

To reduce uneccesary burden on relays we can aim to use ephemeral event types for communication between traders and coordinator.

Client

The client could be distributed as wasm library and rust crate. There could also be a compilation flag that decides if the client gets built with nostr communication logic or only with nostr event creation logic. First would be useful for inclusion in traditional trading platforms and second would be useful for nostr based trading platforms already including relay/communication logic.

Running the Demo

Berofe running the trader clients and the coordinator start a test mint using a fake funds source.

docker run -p 3338:3338 --name nutshell -e MINT_BACKEND_BOLT11_SAT=FakeWallet -e MINT_LISTEN_HOST=0.0.0.0 -e MINT_LISTEN_PORT=3338 -e MINT_PRIVATE_KEY=TEST_PRIVATE_KEY cashubtc/nutshell:0.15.3 poetry run mint

Acknowledgments

Special thanks to the following projects, without them this project wouldn't be possible:

Contribution

If you want to discuss this project or contribute feel free to join the SimpleX messenger group

Pull requests

When submitting pull requests, please ensure your code is formatted using rustfmt to maintain consistent code style throughout the project.

cashu-escrow-kit's People

Contributors

f321x avatar rodant avatar

Stargazers

 avatar Vaz avatar Steffen avatar Francisco Calderón avatar Yuki Kishimoto avatar Likem avatar 22388o⚡️  avatar  avatar calvadev⚡️ avatar Max Hillebrand avatar 0xg4tt0 avatar  avatar

Watchers

 avatar  avatar

Forkers

22388o vazw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.