Ripple two types of trust. Or no? I tend to distinguish two types of trust:

a) I trust you to lend me XXX in quantity up to N units.

b) I trust you to borrow from me YYY in quantity up to M units.

However, ripple documentation appears to not make such a distinction. At least not clearly and explicitly.

Using ripple.com client I can trust someone to lend me, but I see no way to trust someone to borrow from me.

Can you help clear this conceptual hurdle for me?

I've been lending &amp; borrowing all my life and never, ever was I confused about who owes me and whom do I owe. Now, with the advanced mathematical currency &amp; exchange system I am not sure about that anymore.
The only risk would be that somebody owes you money and doesn't pay you back. If someone lets you owe them money, they are taking all the risk. You have to choose to take a risk, but normally you'd have no reason to want to control whether other people take risks.


  a) I trust you to lend me XXX in quantity up to N units.


This is the type of trust you extend when you create a pathway.


  b) I trust you to borrow from me YYY in quantity up to M units.


If you mean you trust them to pay you back, they would have to agree to pay you back and you would have to accept and act on that agreement. That would take place outside the Ripple system. The Ripple system just tracks balances, the terms on which those balances are paid back is outside the system.

I'm not sure why you would worry about someone giving you money without you having any agreement to pay them back. All the risk is on them.

And to this comment:


  Incidentally, when people just send me XRPs or BTCs to my ripple address at ripple.com, or when I do the same to them, no trust setup is involved.


No trust is required to hold or transfer XRPs. They're a native currency in Ripple. And no new trust is required for someone else to transfer balances to you where that money is held by someone you already trust. You set up trust in the first place so that payments will "just work".

It's basically this simple: If you want to hold BTC on Ripple, pick a gateway you trust and create a pathway to them. Set a limit. So long as you don't create any other pathways or reach that limit, people can pay you BTC is by making that gateway owe them to you. If you create only one pathway for each currency and it's to a gateway you trust, everything "just works". You can receive payments from and make payments to anyone who is reasonably well connected.