interledger / rfcs

Specifications for Interledger and related protocols
https://interledger.org
Other
456 stars 111 forks source link

Question about escrow #420

Closed phongtt3 closed 6 years ago

phongtt3 commented 6 years ago

i've a consider why in the Differences from Previous Versions of ILP section: -- Payment Channels, Not On-Ledger Escrow

but in the ilp packet life cycle, step 4:

-- If so, the connector reduces the sender's available balance by the value of the packet.

I thought the process of reduce sender's balance is escrow, and its conflict with not onledger escrow that wrote above. Am i right? please explain it for me, thank so much!!!

sharafian commented 6 years ago

A prepare/execute flow is still used, even though on ledger escrow is no longer used.

Basically you have a balance to your peer for a (very small) amount. When your peer sends you a packet, you increase their debt to you. This is analogous to a prepare. If the packet times out, this balance change is cancelled. If the packet is fulfilled, the balance change is executed.

This balance is off-ledger, so your peer could default on it. However, because of the rules of the hashlocks, you can't trick your peer into thinking the balance is different from what it actually is. So your peer can limit the maximum balance to a very small amount (i.e. <$0.01), and that represents their maximum risk with that peer.

To stop the balance from exceeding your peer's risk limit, we use settlements. A settlement is a movement of on-ledger funds (or a claim that's redeemable for on-ledger funds). The idea is that when you move the counterparty risk to another system, your peer deducts that from your off-ledger debt to them.

If your settlement method is slow, your balance with your peer might get pretty high. That's OK if you don't expect your peer to default, but we want this to work between two people who don't trust each other. Payment channels allow instantaneous settlement, meaning that the balance with your peer can be arbitrarily low. That means your risk can be arbitrarily low too.

Effectively, the ILPv4 method of off-ledger escrow plus settlements has a potential one-time cost of your risk limit if your peer goes rogue, but that risk can be made arbitrarily low. On-ledger escrow isolates you from any risk with your peer, but has a guaranteed cost from ledger fees and time, which will, in practice, be higher.

emschwartz commented 6 years ago

Can this issue be closed now?