10000 Clarify owner reserve requirements for trust lines (DOC-456) · github-cloud/rippled@cf72d70 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf72d70

Browse files
committed
Clarify owner reserve requirements for trust lines (DOC-456)
1 parent cf9d65f commit cf72d70

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/ripple/app/tx/impl/SetTrust.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,23 @@ SetTrust::doApply ()
150150

151151
std::uint32_t const uOwnerCount = sle->getFieldU32 (sfOwnerCount);
152152

153-
// The reserve required to create the line. Note that we allow up to
154-
// two trust lines without requiring a reserve because being able to
155-
// exchange currencies is a powerful Ripple feature.
153+
// The reserve that is required to create the line. Note
154+
// that although the reserve increases with every item
155+
// an account owns, in the case of trust lines we only
156+
// *enforce* a reserve if the user owns more than two
157+
// items.
156158
//
157-
// This is also a security feature: if you're a gateway and you want to
158-
// be able to let someone use your services, you would otherwise have to
159-
// give them enough XRP to cover the incremental reserve for their trust
160-
// line. If they had no intention of using your services, they could use
161-
// the XRP for their own purposes. So we make it possible for gateways
162-
// to fund accounts in a way where there's no incentive to trick them
163-
// into creating an account you have no intention of using.
159+
// We do this because being able to exchange currencies,
160+
// which needs trust lines, is a powerful Ripple feature.
161+
// So we want to make it easy for a gateway to fund the
162+
// accounts of its users without fear of being tricked.
163+
//
164+
// Without this logic, a gateway that wanted to have a
165+
// new user use its services, would have to give that
166+
// user enough XRP to cover not only the account reserve
167+
// but the incremental reserve for the trust line as
168+
// well. A person with no intention of using the gateway
169+
// could use the extra XRP for their own purposes.
164170

165171
XRPAmount const reserveCreate ((uOwnerCount < 2)
166172
? XRPAmount (zero)

0 commit comments

Comments
 (0)
0