Three-Phase Commit (3PC) + MultiHop

1 view
Skip to first unread message

Dante Monson

unread,
Aug 24, 2025, 9:45:44 AMAug 24
to econ...@googlegroups.com
Three-Phase Commit (3PC) is a distributed transaction protocol designed to improve fault tolerance over Two-Phase Commit (2PC) by adding a crucial Pre-Commit phase to a coordinator's decision-making. For multi-hop payments, this protocol doesn't directly apply but is conceptually relevant for securing transactions across many nodes. Instead of 3PC, protocols like those used in the Lightning Network (e.g., with Hash Time-Lock Contracts or HTLCs) are designed to enable secure, atomic, multi-hop payments by ensuring no honest party loses coins, even with malicious intermediaries, through techniques like timelocks and digital signatures.
 
How Three-Phase Commit (3PC) Works
3PC adds a 'Can-Commit' phase to the standard 2PC protocol to prevent indefinite blocking when the coordinator fails. 
  1. The coordinator asks all participants if they are prepared to commit the transaction. Participants vote "Yes" or "No". 
  2. If all participants vote "Yes", the coordinator broadcasts a Pre-Commit message, and participants acknowledge and prepare for the final commit. This step ensures that even if the coordinator fails next, all participants have enough information to eventually decide to commit or abort, breaking the blocking condition of 2PC. 
  3. Once acknowledgments for the Pre-Commit phase are received, the coordinator sends a Do-Commit message, instructing participants to finalize the transaction. 
Application to Multi-Hop Payments
While 3PC is a general distributed transaction protocol, it is not the mechanism used for multi-hop payments in systems like the Lightning Network. 
  • 3PC is for atomic transactions:
    It's used when a single, large transaction needs to be processed across multiple databases or systems, ensuring all parts are committed or none are. 
  • Multi-hop payments require different techniques:
    These involve a series of payments chained together. A secure MHP ensures that if any honest node on the path fails, no honest user loses their money. 
  • The Lightning Network uses HTLCs to create secure payment channels, requiring intermediaries to lock coins with a secret known only to the final recipient. This mechanism provides the necessary atomicity and security for multi-hop payments, preventing malicious intermediaries from stealing funds. 
Key Takeaway
3PC is a more resilient, albeit complex, general distributed transaction protocol that adds a fault tolerance layer to 2PC. It is not directly applicable to multi-hop payments, which instead rely on specialized protocols like HTLCs to ensure secure and atomic payments across a path of intermediary nodes

https://www.youtube.com/watch?v=DVjMis02AE8

https://www.reddit.com/r/ethdev/comments/1lncmti/3phase_commit_for_multihop_payments/


Dante Monson

unread,
Aug 24, 2025, 9:46:44 AMAug 24
to econ...@googlegroups.com

Johan Nygren:


minimalistic C version of the single-user Ripple server is now finished. It has its own scheduler, requires no operating system other than UDP+Ethernet. Does not use heap. Sha256 is included in the code. 1900 lines of code in total. Should run on more or less anything.

https://bitbucket.org/bipedaljoe/ripple-c/src/main/ripple.c

The Golang version is finished since many months,
https://bitbucket.org/bipedaljoe/ripple-normal
Reply all
Reply to author
Forward
0 new messages