{"id":25882817,"url":"https://github.com/storopoli/scrow","last_synced_at":"2025-03-02T16:19:13.965Z","repository":{"id":278837046,"uuid":"936289989","full_name":"storopoli/scrow","owner":"storopoli","description":"Satoshi Escrow: A Bitcoin non-custodial peer-to-peer dispute resolution using only Nostr keys","archived":false,"fork":false,"pushed_at":"2025-03-01T07:04:41.000Z","size":872,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T08:18:10.410Z","etag":null,"topics":["bitcoin","escrow","non-custodial","nostr"],"latest_commit_sha":null,"homepage":"https://scrow.exchange","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/storopoli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-20T20:54:40.000Z","updated_at":"2025-02-27T20:57:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"984c3c12-4e02-459f-a920-1ea2a82bd694","html_url":"https://github.com/storopoli/scrow","commit_stats":null,"previous_names":["storopoli/scrow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2Fscrow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2Fscrow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2Fscrow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storopoli%2Fscrow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/storopoli","download_url":"https://codeload.github.com/storopoli/scrow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241533938,"owners_count":19977882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","escrow","non-custodial","nostr"],"created_at":"2025-03-02T16:19:13.578Z","updated_at":"2025-03-02T16:19:13.953Z","avatar_url":"https://github.com/storopoli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Satoshi Escrow\n\nSatoshi Escrow (`scrow`): A Bitcoin non-custodial peer-to-peer dispute resolution.\n\n## Motivation\n\nBuyer wants to buy something for $P$ (as in price) BTC from Seller.\nBuyer does not trust Seller.\nWhat he can do is to use a 2-of-2 multisig escrow address:\nBuyer sends $2P$ and Seller sends $P$ to this address.\nHence this address now holds $3P$ locked to a 2-of-2 multisig.\nBuyer and Seller just need to have their respective Nostr secret keys (nsec)\nand each other's Nostr public keys (npub).\n\nIf the trade went well,\nthen it is both interests to sign the transaction,\nbecause Buyer would want his $P$ BTC back and so does Seller.\nThey can do this by spending the Escrow address and sending Buyer his $P$ BTC back\nand Seller $2P$ ($P$ for his escrow back and $P$ for the sale).\nIf the trade does not went well then the parties have\nthe game-theoretic incentives to try an alternate solution between themselves.\n\nAdditionally, both Buyer and Seller can optionally choose a third party that they both trust\nthat can spend the Escrow address timelocked to $N$ day(s) together with one of them.\nThe third-party as for now would have a social interest to solve the dispute\nas he can use the escrow in the future and need a dispute solution. So now there are two possible ways to refund the users addresses:\n\n1. Collaborative resolution: 2-of-2 Buyer + Seller.\n1. Timelocked dispute resolution: 2-of-3 (Buyer or Seller) + Third Party.\n\nSatoshi Escrow is a static webpage that can be used offline (or online)\nin an air gapped computer for you to generate, sign,\nand broadcast raw transactions directly through the webpage or using a wallet of choice.\nThe main working principle is the users use coinjoin to fund an escrow address\nthat was generated using the parties npubs and they can resolve the escrow using a collaborative\nor a dispute approach with respectively 2-of-2 and 2-of-3 multisig with timelock.\n\n## Technical Implementation\n\nUnder the hood we use Pay-to-Taproot (P2TR) multisig scripth path spends,\nwith a verified unknown discrete-log unspendable internal key.\n\nFor collaborative escrow option, we use a 2-of-2 multisig between the two parties without timelocks.\nThis is a simple one script path spend that is the root of the Taproot Merkle tree.\n\nFor the dispute escrow option, we use a 3 script path spend.\nHere's how the Taproot Merkle tree is constructed:\n\n1. Script `A`: 2-of-2 multisig between the two parties without timelocks.\n2. Script `B`: 2-of-3 multisig between the first of the parties and the arbitrator with a timelock\n   (if using an arbitrator).\n3. Script `C`: 2-of-3 multisig between the second of the parties and the arbitrator with a timelock\n   (if using an arbitrator).\n\n`A` is at depth 1, and `B` and `C` are at depth 2.\n\n```text\n    root\n       \\\n       /\\\n      /  \\\n     A    *\n         / \\\n        /   \\\n       B     C\n```\n\n## State of the Art\n\nThis was first proposed by\n[Satoshi Nakamoto in 2010](https://satoshi.nakamotoinstitute.org/posts/bitcointalk/threads/169/).\n\nBisq does something similar, the 2-of-2,\nbut with a caveat that the both parties can spend timelocked to 10 or 20 days the 2-of-2\ninto a Bisq DAO Address that will be used in arbitration disputes.\nSee: [Bisq Trading Rules](https://docs.bisq.network/trading-rules#dispute-resolution).\n\n[Private Law Society](https://privatelawsociety.net/)\n(PLS) also does escrow dispute resolution with third-parties,\nbut assumes that the third-party needs to be onboarded\nand does not provide Nostr easy npub/nsec signing.\n\n## Development\n\nSatoshi Escrow is a pure Rust web application built with [Dioxus](https://dioxuslabs.com/).\n\nIn order to run the application locally, you need to have Rust and Cargo installed.\nTo preview the application,\ninstall the `dx` Dioxus CLI,\nrun the following command:\n\n```bash\ndx serve\n```\n\nAlso if you change Tailwind CSS,\nyou need to run the following command\n(make sure you have `tailwindcss` installed):\n\n```bash\nnpx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoropoli%2Fscrow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoropoli%2Fscrow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoropoli%2Fscrow/lists"}