feat: implement secure multi-merchant HODL invoice escrow and automated settlement system#217
Open
GautamBytes wants to merge 7 commits intoshopstr-eng:mainfrom
Open
feat: implement secure multi-merchant HODL invoice escrow and automated settlement system#217GautamBytes wants to merge 7 commits intoshopstr-eng:mainfrom
GautamBytes wants to merge 7 commits intoshopstr-eng:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
added 6 commits
January 5, 2026 17:21
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.
Secure Multi-Merchant HODL Escrow System
🚀Summary
This PR implements a robust, trust-minimized HODL Invoice system for Shopstr, enabling secure escrow-style payments for physical goods. It replaces the legacy "Direct Zap" flow with a conditional "Handshake" protocol (Order Request → HODL Invoice → Automated Settlement) using NIP-17 DMs and NIP-47 (NWC). This architecture ensures funds are only moved after inventory is verified by the merchant's automated agent.
Key Features
Secure HODL Handshake
makeHoldInvoice.Multi-Merchant Cart Support
Automated Settlement Bot
failed_settlementstable) to handle temporary relay or API downtime.Transactional Integrity & Security
FOR UPDATErow-level locking for inventory reservations to prevent double-booking.🛠 Architectural Changes
hodl_invoices,inventory_reservations, andfailed_settlementstables. Automatic schema migration is handled indb-service.ts./api/inventory/check(bulk pre-flight check)/api/merchant/save-connection(secure key sync)/api/settlement/run(CRON heartbeat)