<p>You have a slight misunderstanding about payment paths that is confusing your reasoning. When a payment path ripples through an account, that account receives an asset from the previous link in the path and issues an asset to the next link in the path, not the sender.</p>

<p>So the answer to your first question is that no trust is needed since Alice never holds the currency. An asset, other than XRP, can only be delivered to a person who created a trust line or an offer that agreed to accept that asset. But she never holds it.</p>

<p>And the answer to your second question is that there is no second transit. Alice never holds the asset because she never agreed to. The asset is delivered to the next link in the payment path.</p>

<p>To use a more realistic payment path, consider a case where Alice holds USD issued by Snapswap and wants to pay Bob a Bitcoin. Bob must have a trust line or this is not possible, so let's say he has a trust line to Bitstamp with a limit above his balance. The full payment path could be:</p>

<p>Alice/USD -> Snapswap/USD -> Order book -> Bitstamp/BTC -> Bob/BTC</p>

<p>Notice that only an order book can change the currency. Alice returns USD to Snapswap, and in exchange Snapswap issues USD to whoever placed offers in the order book. The offer owner in turn sends BTC back to Bitstamp who in turn issues them to Bob. Nobody ever holds an asset they didn't agree to hold.</p>

<p>This makes it easier to understand how transfer fees apply. If Bitstamp charges .2%, then the market maker must send 1.002 BTC back to Bitstamp in order to deliver 1 BTC to Bob.</p>

CC BY-SA 3.0
2014-04-17T02:00:37.260Z
In my question, Bob is the offer owner.  You're saying his account pays Bitstamp's fees.  If Snapswap also charges fees, Alice pays them, correct?
Dave Cohen
CC BY-SA 3.0
2014-04-17T02:01:02.043Z
Yes. The person who decided to hold the asset pays the transfer fee.
David Schwartz
CC BY-SA 3.0
2014-04-16T22:35:06.870Z
2014-04-18T02:34:51.540Z
2014-04-18T02:34:51.540Z
David Schwartz
<p>I think I understand, for the most part, how rippled finds transaction paths, and how gateways can charge transit fees; but some of the edge cases have me wondering...</p>

<p>Let's say my wallet has XYZ from xyzGateway, and I've offered to sell 1000 XYZ for 100 USD from usdGateway.  For simplicity, let's say that's the only offer on the books trading XYZ for USD.</p>

<p>Next, my friend Alice has over 100 USD:usdGateway in her wallet.  And to settle a debt between us, she sends me 1000 XYZ.</p>

<p>There's a path that might work.  The first leg of the path is 100 USD:usdGateway from Alice to me.  The next leg is my own offer to trade 1000 XYZ:xyzGateway for 100 USD:usdGateway.  I would make that trade <strong>with myself</strong>, so that afterwards my wallet contains 1000 XYZ and 100 USD.</p>

<p>Will ripple find the path described above?  Let's call it <em>path #1</em>.</p>

<p>There's another path that might work.  The first leg is Alice takes my offer, I get her USD and she gets my XYZ.  The next leg of the path sends the XYZ back to my wallet.</p>

<p>Will ripple find this <em>path #2</em>?  Specifically, will it be found <em>even if Alice does not trust XYZ:xyzGateway</em>?  Does Alice's action of sending XYZ to me imply her trust of that currency?</p>

<p>I believe the two paths are equal in their net effect: 100 USD subtracted from Alice's wallet, and 100 USD added to my wallet.  And I still have 1000 XYZ in my wallet. And my offer to sell XYZ for USD is removed from the ledger.</p>

<p>However, transit fees could make those two paths not equivalent.  Let's say that usdGateway charges 1% in transit fees.  And likewise xyzGatway charges 1%.  Path #1 described above would incure 1% fee when Alice sends USD to me (she'd have to send 101 instead of 100).  It's unclear to me, would the trade leg (trade with myself) would incur still more transit fees from either gateway?</p>

<p>And regarding path #2, there would be a 1% fee to usdGateway when Alice trades for XYZ, and a 1% fee from me to xyzGateway, and finally one more 1% fee for the leg sending XYZ from Alice to me?  Am I correct that this path pays single transit fees to usdGatway and double fees to xyzGateway.</p>

<p>Thanks in advance for help with this. Apologies for cramming multiple questions into one post.  I several questions just to understand what Ripple would do when Alice attempts to send the XYZ.</p>

<ripple>
Can a trade offer be the last leg of a Ripple transaction path? If so, do transit fees apply?
Dave Cohen
# Can a trade offer be the last leg of a Ripple transaction path? If so, do transit fees apply?

(Asked by: username_0 on 2014-04-16)

I think I understand, for the most part, how rippled finds transaction paths, and how gateways can charge transit fees; but some of the edge cases have me wondering...

Let's say my wallet has XYZ from xyzGateway, and I've offered to sell 1000 XYZ for 100 USD from usdGateway. For simplicity, let's say that's the only offer on the books trading XYZ for USD.

Next, my friend Alice has over 100 USD:usdGateway in her wallet. And to settle a debt between us, she sends me 1000 XYZ.

There's a path that might work. The first leg of the path is 100 USD:usdGateway from Alice to me. The next leg is my own offer to trade 1000 XYZ:xyzGateway for 100 USD:usdGateway. I would make that trade **with myself**, so that afterwards my wallet contains 1000 XYZ and 100 USD.

Will ripple find the path described above? Let's call it *path #1*.

There's another path that might work. The first leg is Alice takes my offer, I get her USD and she gets my XYZ. The next leg of the path sends the XYZ back to my wallet.

Will ripple find this *path #2*? Specifically, will it be found *even if Alice does not trust XYZ:xyzGateway*? Does Alice's action of sending XYZ to me imply her trust of that currency?

I believe the two paths are equal in their net effect: 100 USD subtracted from Alice's wallet, and 100 USD added to my wallet. And I still have 1000 XYZ in my wallet. And my offer to sell XYZ for USD is removed from the ledger.

However, transit fees could make those two paths not equivalent. Let's say that usdGateway charges 1% in transit fees. And likewise xyzGatway charges 1%. Path #1 described above would incure 1% fee when Alice sends USD to me (she'd have to send 101 instead of 100). It's unclear to me, would the trade leg (trade with myself) would incur still more transit fees from either gateway?

And regarding path #2, there would be a 1% fee to usdGateway when Alice trades for XYZ, and a 1% fee from me to xyzGateway, and finally one more 1% fee for the leg sending XYZ from Alice to me? Am I correct that this path pays single transit fees to usdGatway and double fees to xyzGateway.

Thanks in advance for help with this. Apologies for cramming multiple questions into one post. I several questions just to understand what Ripple would do when Alice attempts to send the XYZ.

**Tags:** ripple


---

## 1 answers

### Answer by username_1 on 2014-04-16. Score: 2 | Accepted answer

You have a slight misunderstanding about payment paths that is confusing your reasoning. When a payment path ripples through an account, that account receives an asset from the previous link in the path and issues an asset to the next link in the path, not the sender.

So the answer to your first question is that no trust is needed since Alice never holds the currency. An asset, other than XRP, can only be delivered to a person who created a trust line or an offer that agreed to accept that asset. But she never holds it.

And the answer to your second question is that there is no second transit. Alice never holds the asset because she never agreed to. The asset is delivered to the next link in the payment path.

To use a more realistic payment path, consider a case where Alice holds USD issued by Snapswap and wants to pay Bob a Bitcoin. Bob must have a trust line or this is not possible, so let's say he has a trust line to Bitstamp with a limit above his balance. The full payment path could be:

Alice/USD -> Snapswap/USD -> Order book -> Bitstamp/BTC -> Bob/BTC

Notice that only an order book can change the currency. Alice returns USD to Snapswap, and in exchange Snapswap issues USD to whoever placed offers in the order book. The offer owner in turn sends BTC back to Bitstamp who in turn issues them to Bob. Nobody ever holds an asset they didn't agree to hold.

This makes it easier to understand how transfer fees apply. If Bitstamp charges .2%, then the market maker must send 1.002 BTC back to Bitstamp in order to deliver 1 BTC to Bob.

> **Comments:**
> **username_0**: In my question, Bob is the offer owner.  You're saying his account pays Bitstamp's fees.  If Snapswap also charges fees, Alice pays them, correct?  
> **username_1**: Yes. The person who decided to hold the asset pays the transfer fee.  

---

