A bunch of little errors, including a fix to the balancehash computation
[Trubanc.git] / plain-english.html
blobd275862fc2634acd4d0e39a78e4ea51b597f14fb
1 <html>
2 <head>
3 <title>Trubanc in Plain English</title>
4 </head>
5 <body>
6 <h1>Trubanc in Plain English</h1>
8 <p>
9 <a href="http://Trubanc.com/">Trubanc</a> is an anonymous,
10 digitally-signed vault and trading system. Like
11 <a href="https://loom.cc/">Loom</a>, it allows anyone to issue assets
12 (digital currencies). Unlike Loom, which relies entirely on (very
13 good) obscurity for security, Trubanc's digital signatures allow the
14 bank and the customer to prove to each other that they agreed at a
15 particular time on their balances. It does this while allowing
16 destruction of transaction history for closed trades. Trubanc will
17 initially provide server-based trading. Eventually, it will provide
18 digital checks and bearer certificates. These, however, WILL require
19 permanent storage of transaction history (unless they expire).
20 </p>
22 <p>
23 <a href="viewtext.php?file=doc/db.txt">doc/db.txt</a> gives a terse
24 description of the Trubanc server database and protocol. This page
25 attempts to render the protocol in plain English.
26 </p>
28 <p>
29 Trubanc uses public key cryptography to sign all messages passed back
30 and forth between its web interface and the Trubanc server. Digital
31 signatures are a virtually unforgeable way to ensure that a message
32 was written by its purported author. Trubanc uses OpenSSL for its
33 public key cryptography. You probably use OpenSSL every time you visit
34 a secure web site, https://somewhere.com/, as does the web server. I
35 didn't roll my own. Just used the same tried and true technology that
36 secures the web. You can read more about public key cryptography,
37 digital signatures, and hashing
38 <a href="http://en.wikipedia.org/wiki/Public-key_cryptography">here</a>
39 and
40 <a href="http://www.pgpi.org/doc/pgpintro/">here</a>.
41 </p>
43 <p>
44 I'm going to use four actors in the scenarios that follow. "Bank" is
45 the name of the Trubanc server. "Bob" and "Sue" are two customers,
46 who will trade with each other. "Spammer" is a third customer, unknown
47 to Bob or Sue.
48 </p>
50 <h2>Scenario: Opening an Account</h2>
52 <p>
53 Sue (via email or IM): Hey, Bob. Check out Trubanc. Go to
54 Trubanc.com, download the client, and install it on your
55 computer. Then create a private key, and send me your ID, and I'll
56 give you some usage tokens so that you can create an account.
57 </p>
59 <p>
60 Bob (via email or IM): Thanks, Sue! I installed the Trubanc client
61 and created a private key. Here's my ID.
62 </p>
64 <p>
66 <p>
67 Sue (via her Trubanc client): Hey bank, Here's a new request
68 number. Give me a transaction number please.<br/>
69 Signed: Sue
70 </p>
72 <p>
73 Bank: Here's a new transaction number.<br/>
74 Signed: Bank
75 </p>
77 <p>
78 Sue: Hey bank, here's that transaction number you gave me. Please
79 spend 50 usage tokens to Bob's ID, with a message of "Hey
80 Bob. Welcome to Trubanc!" I'm paying 2 usage tokens as a transaction
81 fee, which I'll get back when Bob accepts the spend. My balance after
82 this transaction will be 1025 usage tokens. My outbox hash after this
83 transaction will be X.<br/>
84 Signed: Sue
85 </p>
87 <p>
88 Bank: I processed your spend of 50 usage tokens to Bob's ID. I agree
89 that the transaction fee at the time of this transaction is 2 usage
90 tokens, and that your balance after this transaction is 1025 usage
91 tokens. I agree with you on your outbox hash.<br/>
92 Signed: Bank
93 </p>
95 <p>
96 Sue (via email or IM): OK, Bob. I've given you 50 usage tokens. You
97 should now be able to create an account at Trubanc.com. Send me a
98 message via Trubanc when you've registered.
99 </p>
102 Bob (via his Trubanc client): Hello bank. Here's my ID and my public
103 key. What's your ID and public key?<br/>
104 Signed: Bob
105 </p>
108 Bank: Here's my ID and public key.<br/>
109 Signed: Bank
110 </p>
113 Bob: Here's my ID and my public key, please create an account for me.<br/>
114 Signed: Bob
115 </p>
118 Bank: I've registered your ID and public key. Somebody gave you enough
119 tokens to register. Welcome to Trubanc.<br/>
120 Signed: Bank
121 </p>
123 <p>-----</p>
126 In order to sign a message, you need to have a private key. In order
127 to verify the signature on a message, you need to have the
128 corresponding public key. Trubanc identifies customers by the hash of
129 their public key, their ID. The ID is a 40-character string of numbers
130 and the letters A to F, the hexadecimal representation of a 160-bit
131 number. You identify your account to the Trubanc client with a
132 passphrase, which is used to encrypt your private key on your
133 disk. You'll only need to copy and paste your ID when you want to tell
134 a trading partner how to send you money for the first time, or to seed
135 your account with usage tokens, as Sue did for Bob.
136 </p>
139 Usage tokens are an idea from Patrick
140 Chkoreff's <a href="https://loom.cc/">Loom</a> system. They are a way
141 to charge for the bank's resources. You have to buy storage for your
142 account balances, and lease temporary storage for transactions. Usage
143 tokens are the "currency" used to do this. Trubanc also supports fees
144 in other asset types, for bank management that wants to make more than
145 the sale of usage tokens. Trubanc uses the file system as a
146 database. One file in the Trubanc database costs one usage
147 token. Files vary in size, but are usually about 8K, mostly
148 signatures.
149 </p>
152 Note that Bob had to send his public key to the bank twice, once when
153 he requested the bank's public key, and again when he
154 registered. Every message going to and from Trubanc is digitally
155 signed. It's only possible to verify a digital signature if you know
156 the public key of the signer. A new customer's public key isn't in the
157 database until after he's registered, so the first two messages, in
158 which the new customer gets the bank's public key, so that he can
159 verify the bank's signatures, and the registration request, both need
160 to include the customers's public key, so that the signatures on those
161 two messages can themselves be verified. After registration is
162 complete, subsequent messages need to carry only the ID; the public
163 key can then be looked up in the database.
164 </p>
167 Actual messages sent (with the signature that goes with each
168 parenthesized item omitted):<br>
169 </p>
170 <pre>
171 Sue: (&lt;suesid>,gettime,&lt;bankid>,&lt;req#>)
172 Bank: (&lt;bankid>,time,&lt;suesid>,&lt;time#>)
173 Sue: (&lt;suesid>,spend,&lt;bankid>,&lt;time#>,&lt;bobsid>,&lt;tokenid>,50,Hey Bob\. Welcome to Trubanc!).
174 (&lt;suesid>,tranfee,&lt;bankid>,&lt;time#>,&lt;tokenid>,2).
175 (&lt;suesid>,balance,&lt;bankid>,&lt;time#>,&lt;tokenid>,1025).
176 (&lt;suesid>,outboxhash,&lt;bankid>,&lt;time#>,X)
177 Bank: (&lt;bankid>,@spend,(&lt;suesid>,spend,&lt;bankid>,&lt;time#>,&lt;bobsid>,&lt;tokenid>,50,Hey Bob\. Welcome to Trubanc!)).
178 (&lt;bankid>,@tranfee,(&lt;suesid>,tranfee,&lt;bankid>,&lt;time#>,&lt;tokenid>,2)).
179 (&lt;bankid>,@balance,(&lt;suesid>,balance,&lt;bankid>,&lt;time#>,&lt;tokenid>,1025)).
180 (&lt;bankid>,@outboxhash,(&lt;suesid>,outboxhash,&lt;bankid>,&lt;time#>,X))
181 Bob: (&lt;bobsid>,bankid,&lt;pubkey>)
182 Bank: (&lt;bankid>,register,&lt;bankid>,&lt;pubkey>,Trubanc)
183 Bob: (&lt;bobsid>,register,&lt;bankid>,&lt;pubkey>,Bob)
184 Bank: (&lt;bankid>,@register,(&lt;bobsid>,register,&lt;bankid>,&lt;pubkey>,Bob))
185 </pre>
187 <h2>Scenario: Receiving Assets</h2>
190 Bob: Hello bank. Here's my ID and a new request number. What's in my
191 inbox?<br/>
192 Signed: Bob
193 </p>
196 Bank: Your inbox contains a 50 usage token spend from Sue with a
197 message of "Hey Bob. Welcome to Trubanc!" It also contains a 10 usage
198 token charge from the bank with a message of "Registration Fee". Here
199 are two transaction numbers you can use to accept these spends and do
200 a spend yourself.<br/>
201 Signed: Bank
202 </p>
205 Bob: Here's my ID and the first of the transaction numbers you gave
206 me. Accept the spend from Sue with a message of, "Thanks, Sue. I'm
207 excited about Trubanc!" Accept the bank charge. My balance after this
208 transaction will be 39 usage tokens.<br/>
209 Signed: Bob
210 </p>
213 Bank: I've processed the spend from Sue and the bank charge. I agree
214 that your balance after this transaction is 39 usage tokens.<br/>
215 Signed: Bank
216 </p>
218 <p>-----</p>
221 One possible attack on an electronic bank can be for someone to replay
222 an intercepted message. Unless the protocol protects against that,
223 this can cause problems. Except for the bankid request, the
224 registration request, and a request for a customer's last request
225 number, every information request must be accompanied by a request
226 number that is larger than the customer's last used request number,
227 and every transaction must be accompanied by a transaction number that
228 is given out by the bank. The bank maintains a counter, which it
229 increments each time someone asks for a transaction number. This makes
230 requests that reveal information or initiate transactions impossible
231 to replay without a customer's passphrase and private key. In the
232 Trubanc world, your passphrase and your private key are your
233 identity. Guard them well.
234 </p>
237 Another possible replay attack is to intercept a message for one bank
238 and send it to another. Customers could protect against this by having
239 different IDs, hence different public/private key pairs, for different
240 banks. But it will be very convenient to use the same ID. Your friends
241 will recognize you, and you'll have only one passphrase to
242 remember. So the bank's ID is included in almost every request.
243 Requests meant for another bank will not work.
244 </p>
247 You're probably wondering why Bob's balance after the transaction is
248 39, instead of 40, usage tokens. He got 50 usage tokens from Sue, and
249 paid the bank 10 usage tokens for his registration fee. The additional
250 usage token is the price of the new file used to store the usage token
251 balance. Storage costs usage tokens. Loom charges 1 usage token for
252 each 16 bytes of storage. I considered charging per byte, but decided
253 that charging per file was easier to handle, though not quite as
254 fair. It only makes sense if message sizes are limited, of course. If
255 you were allowed megabyte messages, then Trubanc would have to charge
256 per byte, or per kilobyte.
257 </p>
260 Actual messages sent:
261 </p>
262 <pre>
263 Bob: (&lt;bobsid>,getinbox,&lt;bankid>,&lt;req#>)
264 Bank: (&lt;bankid,@getinbox,(&lt;bobsid>,getinbox,&lt;bankid>,&lt;req#>)).
265 (&lt;bankid>,inbox,&lt;time3#>,(&lt;suesid>,spend,&lt;bankid>,&lt;time#>,&lt;bobsid>,&lt;tokenid>,50,Hey Bob\. Welcome to Trubanc!)).
266 (&lt;bankid>,inbox,&lt;time4#>,(&lt;bankid>,spend,&lt;bankid>,&lt;time2#>,&lt;bobsid>,&lt;tokenid>,-10,Registration Fee)).
267 (&lt;bankid>,time,&lt;bobsid>,&lt;time5#>).
268 (&lt;bankid>,time,&lt;bobsid>,&lt;time6#>)
269 Bob: (&lt;bobsid>,processinbox,&lt;bankid>,&lt;time5#>,&lt;time3#>|&lt;time4#>).
270 (&lt;bobsid>,spend|accept,&lt;bankid>,&lt;suesid>,&lt;time#>,Thanks Sue\. I'm excited about Trubanc!).
271 (&lt;bobsid>,spend|accept,&lt;bankid>,&lt;bankid>,&lt;time2#>).
272 (&lt;bobsid>,balance,&lt;bankid>,&lt;time5#>,&lt;tokenid>,39)
273 Bank: (&lt;bankid>,@processinbox,(&lt;bobsid>,processinbox,&lt;bankid>,&lt;time5#>,&lt;time3#>|&lt;time4#>)).
274 (&lt;bankid>,@spend|accept,(&lt;bobsid>,spend|accept,&lt;bankid>,&lt;suesid>,&lt;time#>,Thanks Sue\. I'm excited about Trubanc!)).
275 (&lt;bankid>,@spend|accept,(&lt;bobsid>,spend|accept,&lt;bankid>,&lt;bankid>,&lt;time2#>)).
276 (&lt;bankid>,@balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time5#>,&lt;tokenid>,39))
277 </pre>
279 <h2>Scenario: Closing a Transaction</h2>
282 Sue: Hello bank. Here's my ID and a new request number. What's in my
283 inbox?<br/>
284 Signed: Sue
285 </p>
288 Bank: Your inbox contains an acceptance from Bob of your 50 usage
289 token spend with a message of, "Thanks Sue. I'm excited about
290 Trubanc!" Here are two transaction numbers you can use to close that
291 transaction and do a new spend.<br/>
292 Signed: Bank
293 </p>
296 Sue: Here's my ID and the first of the transaction numbers you gave
297 me. Clear the spend to Bob. My balance after this transaction will be
298 1027 usage tokens. My outbox hash after this transaction will be Y.<br/>
299 Signed: Sue
300 </p>
303 Bank: I've cleared the spend to Bob (and refunded the usage tokens
304 that were leasing the outbox and inbox locations). I agree that your
305 balance after this transaction is 1027 usage tokens. And I agree that
306 your outbox hash after this transaction is Y.<br/>
307 Signed: Bank
308 </p>
310 <p>-----</p>
313 There are three main parts of a Trubanc account: the balances, the
314 outbox, and the inbox. Value is stored in all three places. When you
315 do a spend, your balance for the spent asset is debited, and the spend
316 request is stored in your outbox and in the recipients inbox. You are
317 charged two usage tokens to lease the new outbox and inbox files. When
318 the recipient accepts the spend, his balance for the spent asset is
319 credited, the spend notice is removed from his inbox, and a spend
320 acceptance notice is added to your inbox. When you acknowledge his
321 acceptance of the spend, the spend request is removed from your
322 outbox, the acceptance notice is removed from your inbox, and the two
323 usage tokens you paid to lease those files is credited to your
324 balance. This three step process is necessary, because the bank can't
325 modify your balances without your signed permission, and it can't
326 modify the recipient's balances without his signed permission.
327 </p>
330 You may be wondering what an "outbox hash" is. Your balances plus your
331 outbox represent the part of your account that you and the bank have
332 agreed upon. Your inbox is changed without your knowledge, but the
333 bank needs your signed permission to change your outbox (do a spend)
334 or your balances. Since your outbox might get large, instead of
335 sending the entire contents back and forth every time you do a spend,
336 or acknowledge the acceptance (or rejection) of a spend by a
337 recipient, you compute a hash of your outbox, and send that instead,
338 and the bank responds with an acknowledgement of that outbox hash
339 (thank you to Patrick Chkoreff for this idea).
340 </p>
343 Actual messages sent:
344 </p>
345 <pre>
346 Sue: (&lt;suesid>,getinbox,&lt;bankid>,&lt;req2#>)
347 Bank: (&lt;bankid,@getinbox,(&lt;suesid>,getinbox,&lt;bankid>,&lt;req2#>)).
348 (&lt;bankid>,inbox,&lt;time7#>,(&lt;bobsid>,spend|accept,&lt;bankid>,&lt;suesid>,&lt;time#>,Thanks Sue\. I'm excited about Trubanc!)).
349 (&lt;bankid>,time,&lt;bobsid>,&lt;time8#>).
350 (&lt;bankid>,time,&lt;bobsid>,&lt;time9#>)
351 Sue: (&lt;suesid>,processinbox,&lt;bankid>,&lt;time8#>,&lt;time7#>).
352 (&lt;suesid>,balance,&lt;bankid>,&lt;time8#>,&lt;tokenid>,1027).
353 (&lt;suesid>,outboxhash,&lt;bankid>,&lt;time8#>,Y)
354 Bank: (&lt;bankid>,@processinbox,(&lt;suesid>,processinbox,&lt;bankid>,&lt;time8#>,&lt;time7#>)).
355 (&lt;bankid>,@balance,(&lt;suesid>,balance,&lt;bankid>,&lt;time8#>,&lt;tokenid>,1027)).
356 (&lt;bankid>,@outboxhash,(&lt;suesid>,outboxhash,&lt;bankid>,&lt;time8#>,Y))
357 </pre>
359 <h2>Scenario: Preventing Spam</h2>
362 Spammer (likely via an automated client): Hey bank. Here's a new
363 request number. Give me a transaction number please.<br/>
364 Signed: Spammer
365 </p>
368 Bank: Here's a new transaction number.<br/>
369 Signed: Bank
370 </p>
373 Spammer: Hey bank. Here's that transaction number you gave me. Please
374 spend 0 usage tokens to Bob's ID, with a message of, "Go all
375 night. Visit BuyViagra.com." I'm paying 2 usage tokens as a
376 transaction fee, which I'll get back when Bob accepts the spend. My
377 balance after this transaction will be 2425 usage tokens. My outbox
378 hash after this transaction will be Z.<br/>
379 Signed: Spammer
380 </p>
383 Bank: I processed your spend of 0 usage tokens to Bob's ID. I agree
384 that the transaction fee at the time of this transaction is 2 usage
385 tokens, and that your balance after this transaction is 2425 usage
386 tokens. I agree with you on your outbox hash.<br/>
387 Signed: Bank
388 </p>
391 Bob: Hello bank. Here's my ID and a new request number. What's in my
392 inbox?<br/>
393 Signed: Bob
394 </p>
397 Bank: Your inbox contains a 0 usage token spend from Spammer with a
398 message of, "Go all night. Visit BuyViagra.com." Here are two
399 transaction numbers you can use to accept these spends and do a spend
400 yourself.<br/>
401 Signed: Bank
402 </p>
405 Bob: Here's my ID and the first of the transaction numbers you gave
406 me. Reject the spend from Spammer with a message of, "Thanks for the
407 tokens", and give me the two usage tokens he paid to send that
408 spam. My balance after this transaction will be 41 usage tokens.<br/>
409 Signed: Bob
410 </p>
413 Bank: I've rejected the spend from Spammer. I agree that your balance
414 after this transaction is 41 usage tokens.<br/>
415 Signed: Bank
416 </p>
418 <p>-----</p>
421 Spends can be rejected. The amount spent goes back to the spender, but
422 the recipient pockets the transaction fee. Zero spends use Trubanc as
423 a simple messaging service. But not a free one, unless the recipient
424 wants the message. IMHO, spam exists largely because it is nearly free
425 to send email. In a system where each spam message costs 2 usage
426 tokens, cheap but not free, I doubt it will be much of a problem. Time
427 will tell.
428 </p>
431 Actual messages sent:
432 </p>
433 <pre>
434 Spammer: (&lt;spammersid>,gettime,&lt;bankid>,&lt;req#>)
435 Bank: (&lt;bankid>,time,&lt;spammersid>,&lt;time10#>)
436 Spammer: (&lt;spammersid>,spend,&lt;bankid>,&lt;time10#>,&lt;bobsid>,&lt;tokenid>,0,Go all night\. Visit BuyViagra.com\.).
437 (&lt;spammersid>,tranfee,&lt;bankid>,&lt;time#>,&lt;tokenid>,2).
438 (&lt;spammersid>,balance,&lt;bankid>,&lt;time#>,&lt;tokenid>,2425).
439 (&lt;spammersid>,outboxhash,&lt;bankid>,&lt;time#>,Z)
440 Bank: (&lt;bankid>,@spend,(&lt;spammersid>,spend,&lt;bankid>,&lt;time#>,&lt;bobsid>,&lt;tokenid>,0,Go all night\. Visit BuyViagra.com\.)).
441 (&lt;bankid>,@tranfee,(&lt;spammersid>,tranfee,&lt;bankid>,&lt;time#>,&lt;tokenid>,2)).
442 (&lt;bankid>,@balance,(&lt;spammersid>,balance,&lt;bankid>,&lt;time#>,&lt;tokenid>,2425)).
443 (&lt;bankid>,@outboxhash,(&lt;spammersid>,outboxhash,&lt;bankid>,&lt;time#>,Z))
444 Bob: (&lt;bobsid>,getinbox,&lt;bankid>,&lt;req2#>)
445 Bank: (&lt;bankid,@getinbox,(&lt;bobsid>,getinbox,&lt;bankid>,&lt;req2#>)).
446 (&lt;bankid>,inbox,&lt;time11#>,(&lt;spammersid>,spend,&lt;bankid>,&lt;time10#>,&lt;bobsid>,&lt;tokenid>,0,Go all night\. Visit BuyViagra.com\.)).
447 (&lt;bankid>,time,&lt;bobsid>,&lt;time12#>).
448 (&lt;bankid>,time,&lt;bobsid>,&lt;time13#>)
449 Bob: (&lt;bobsid>,processinbox,&lt;bankid>,&lt;time12#>,&lt;time11#>).
450 (&lt;bobsid>,spend|reject,&lt;bankid>,&lt;spammersid>,&lt;time12#>,&lt;time10#>,Thanks for the tokens).
451 (&lt;bobsid>,balance,&lt;bankid>,&lt;time12#>,&lt;tokenid>,41)
452 Bank: (&lt;bankid>,@processinbox,(&lt;bobsid>,processinbox,&lt;bankid>,&lt;time12#>,&lt;time11#>)).
453 (&lt;bankid>,@spend|reject,(&lt;bobsid>,spend|accept,&lt;bankid>,&lt;spammersid>,&lt;time12#>,&lt;time10#>,Thanks for the tokens)).
454 (&lt;bankid>,@balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time12#>,&lt;tokenid>,41))
455 </pre>
457 <h2>Scenario: Issuing Assets</h2>
460 Bob: Hey bank. Here's a new request number. Give me a transaction
461 number please.<br/>
462 Signed: Bob
463 </p>
466 Bank: Here's a new transaction number.<br/>
467 Signed: Bank
468 </p>
471 Bob: Hey bank. Here's that transaction number you gave me. Please
472 register a new asset named "Bob GoldGrams". It has a scale of 7 and a
473 precision of 3. Its ID is &lt;bobggid>. My balance after this transaction
474 will be 39 usage tokens and -1 &lt;bobggid>.
475 </p>
478 Bank: I have registered the new "Bob GoldGrams" asset. I agree that
479 your balance after this transaction is 39 usage tokens and
480 -1 &lt;bobggid>.
481 </p>
483 <p>-----</p>
486 Like Loom, Trubanc allows customers to create their own asset
487 types. Then, if they can convince them to do so, other customers can
488 trade in that asset type. The ID of a Trubanc asset is the sha1 hash
489 of the creator's ID, its scale, its precision, and its name. But the
490 message the customer signs to create the asset, and that the bank
491 signs to acknowledge creation, also contains the bankid. This allows
492 the asset to be registered at multiple banks, with the same ID, but
493 makes each particular registration specific to a specific bank. Hence,
494 it makes sense for an asset issuer to provide a service of
495 transferring his holdings of his asset between banks at which he's
496 registered; it's self-evident that Bob GoldGrams at Bank A are
497 the same asset as Bob GoldGrams at bank B.
498 </p>
501 I plan to support transfer of asset issuance, but I haven't figured
502 out the intricacies yet.
503 </p>
506 Like Loom, all amounts in Trubanc are stored as integers. The scale
507 value controls where the decimal point goes in the real-world
508 representation of that value: move it left by scale places. The
509 precision controls the minimum number of decimal places that are
510 printed. So with a scale of 7 and a precision of 3, the value 12000000
511 will be printed by Trubanc clients as 1.200, and the minimum value for
512 Bob's new currency is 0.0000001, one ten-millionth of a gram of gold,
513 or $0.000003 at $30/gram: 3 ten-thousandths of a cent. Hello
514 micropayments.
515 </p>
518 Also like Loom, the sum of all the amounts, in accounts and outboxes,
519 for one asset type is -1. There is one negative balance, owned by the
520 issuer, who can spend as much as he wants, and a bunch of positive
521 balances, and outbox entries. A -1 balance in the issuer's account
522 means there are no outstanding balances or outbox entries in that
523 asset, so that's where Bob's Bob GoldGrams balance begins. Users of an
524 asset have to trust the issuer when he tells them, outside of Trubanc,
525 that his asset is backed by something of real value, and that he'll
526 never issue more of the virtual asset than he has in the backing
527 commodity. Well, unless he wants to act like a country, and issue fiat
528 currency that is backed by his Full Faith and Credit and nothing
529 else. Good luck getting people to go for that.
530 </p>
533 Actual messages sent:
534 </p>
535 <pre>
536 Bob: (&lt;bobsid>,gettime,&lt;bankid>,&lt;req3#>)
537 Bank: (&lt;bankid>,time,&lt;bobsid>,&lt;time13#>)
538 Bob: (&lt;bobsid>,asset,&lt;bankid>,&lt;bobggid>,7,3,Bob GoldGrams).
539 (&lt;bobsid>,balance,&lt;bankid>,&lt;time13#>,&lt;tokenid>,39).
540 (&lt;bobsid,balance,&lt;bankid>,&lt;time13#>,&lt;bobggid>,-1)
541 Bank: (&lt;bankid>,#asset,(&lt;bobsid>,asset,&lt;bankid>,&lt;bobggid>,7,3,Bob GoldGrams)).
542 (&lt;bankid>,#balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time13#>,&lt;tokenid>,39)).
543 (&lt;bankid>,#balance,(&lt;bobsid,balance,&lt;bankid>,&lt;time13#>,&lt;bobggid>,-1))
544 </pre>
546 <h2>Scenario: Multiple Sub-Accounts</h2>
549 Bob: Hey bank. Here's a new request number. Give me a transaction
550 number please.<br/>
551 Signed: Bob
552 </p>
555 Bank: Here's a new transaction number.<br/>
556 Signed: Bank
557 </p>
560 Bob: Hey bank. Here's that transaction number you gave me. Make a zero
561 spend to myself. My balance after the transaction will be 38 usage
562 tokens, -311.0347681 Bob GoldGrams in my default sub-account, and
563 311.034768 Bob GoldGrams in my "Gun Safe" sub-account.
564 </p>
567 Bank: I did that spend. I agree with you that after the transaction,
568 your balance is 38 usages tokens, -311.0347681 Bob GoldGrams in your
569 default account, and 311.034768 Bob GoldGrams in your "Gun Safe"
570 sub-account.
571 </p>
574 Bob: Hey bank. Here's a new request number. Give me a transaction
575 number please.<br/>
576 Signed: Bob
577 </p>
580 Bank: Here's a new transaction number.<br/>
581 Signed: Bank
582 </p>
585 Bob: Hey bank. Here's that transaction number you gave me. Please
586 spend 2.4056304 Bob GoldGrams to Sue, with a message of, "Well, I
587 finally issued my new currency, backed by Krugerands in my gun
588 safe. I'm giving you a gram in thanks for turning me on to Trubanc,
589 and <a href="http://www.google.com/search?q=(36+dollars+%2F+(796.60+dollars+per++troy+ounce))+in+grams">
590 1.4056304 grams</a> for 36 <a href="http://capulin.com/">Capulin
591 Coffee</a> Units, which you said you'd sell me, so I can buy more of
592 Daniel Fourwinds' fine coffee that we relished at your house the other
593 day. I used a gold price of $796.60/ounce, Kitco's bid price this
594 morning." My transaction fee will be 2 usage tokens. My balance after
595 this transaction will be 36 usage tokens, and 309.6291376 Bob
596 GoldGrams in my "Gun Safe" sub-account. My outbox hash after this
597 transaction will be A.<br/>
598 Signed: Bob
599 </p>
602 Bank: I have done your spend of 2.4056304 Bob GoldGrams to Sue, with
603 your message, and a transaction fee of 2 usage tokens. I agree that
604 your balance after this transaction is 36 usage tokens, and
605 309.6291376 Bob GoldGrams in your "Gun Safe" sub-account. I agree on the
606 outbox hash.<br/>
607 Signed: Bank
608 </p>
610 <p>-----</p>
613 Trubanc supports splitting up your balances into multiple
614 "sub-accounts". Much like a conventional bank gives you a checking
615 account and a savings account, you can use these sub-accounts to help
616 manage your assets. You can have as many of them as you wish, limited
617 only by having usage tokens to pay for the files.
618 </p>
621 Bob has decided to keep track of his Bob GoldGrams assets with a "Gun
622 Safe" sub-account, with a balance recording how many grams of the gold in
623 his safe have not yet been put into circulation. He seeds it
624 with <a href="http://www.google.com/search?q=10+troy+ounces+in+grams">10
625 ounces</a> of gold, the part of his holdings that he's willing to
626 sell. Then he spends some of it to Sue, asking for enough Capulin
627 Coffee Units for two pounds of Capulin Coffee ($17.95 per pound,
628 shipped).
629 </p>
632 Note that you don't have to mention all of your balances with every
633 spend. You only mention the balances that change. Also notice that
634 there's no transaction fee for spends to yourself. Moving assets
635 between your sub-accounts costs only tokens for new files. No need for
636 the outbox and inbox stuff.
637 </p>
640 Actual messages sent:
641 </p>
642 <pre>
643 Bob: (&lt;bobsid>,gettime,&lt;bankid>,&lt;req4#>)
644 Bank: (&lt;bankid>,time,&lt;bobsid>,&lt;time14#>)
645 Bob: (&lt;bobsid>,spend,&lt;bankid>,&lt;time14#>,&lt;bobsid>,&lt;bobggid>,0).
646 (&lt;bobsid>,balance,&lt;bankid>,&lt;time14#>,&lt;bobggid>,-3110347681).
647 (&lt;bobsid>,balance,&lt;bankid>,&lt;time14#>,&lt;bobggid>,3110347680,Gun Safe)
648 Bank: (&lt;bankid>,@spend,(&lt;bobsid>,spend,&lt;bankid>,&lt;time14#>,&lt;bobsid>,&lt;bobggid>,0)).
649 (&lt;bankid>,@balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time14#>,&lt;bobggid>,-3110347681)).
650 (&lt;bankid>,@balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time14#>,&lt;bobggid>,3110347680,Gun Safe))
651 Bob: (&lt;bobsid>,gettime,&lt;bankid>,&lt;req5#>)
652 Bank: (&lt;bankid>,time,&lt;bobsid>,&lt;time15#>)
653 Bob: (&lt;bobsid>,spend,&lt;bankid>,&lt;time15#>,&lt;suesid>,&lt;bobggid>,24056304,Well\, I
654 finally issued my new currency\, backed by Krugerands in my gun
655 safe\. I'm giving you a gram in thanks for turning me on to Trubanc\,
656 and 1\.4056304 grams for 36 Capulin Coffee Units\, which you said you'd
657 sell me\, so I can buy more of Daniel Fourwinds' fine coffee that we
658 relished at your house the other day\. I used a gold price of
659 $796\.60/ounce, Kitco's bid price this morning\.).
660 (&lt;bobsid>,tranfee,&lt;bankid>,&lt;time15#>,&lt;tokenid>,2).
661 (&lt;bobsid>,balance,&lt;bankid>,&lt;time15#>,&lt;bobggid>,3096291376,Gun Safe).
662 (&lt;bobsid>,outboxhash,&lt;bankid>,&lt;time15#>,A)
663 Bank: (&lt;bankid>,@spend,(&lt;bobsid>,spend,&lt;bankid>,&lt;time15#>,&lt;suesid>,&lt;bobggid>,24056304,Well\, I
664 finally issued my new currency\, backed by Krugerands in my gun
665 safe\. I'm giving you a gram in thanks for turning me on to Trubanc\,
666 and 1\.4056304 grams for 36 Capulin Coffee Units\, which you said you'd
667 sell me\, so I can buy more of Daniel Fourwinds' fine coffee that we
668 relished at your house the other day\. I used a gold price of
669 $796\.60/ounce, Kitco's bid price this morning\.)).
670 (&lt;bankid>,@tranfee,(&lt;bobsid>,tranfee,&lt;bankid>,&lt;time15#>,&lt;tokenid>,2)).
671 (&lt;bankid>,@balance,(&lt;bobsid>,balance,&lt;bankid>,&lt;time15#>,&lt;bobggid>,3096291376,Gun Safe)).
672 (&lt;bankid>,@outboxhash,(&lt;bobsid>,outboxhash,&lt;bankid>,&lt;time15#>,A))
673 </pre>
675 <h2>Scenario: Getting Information</h2>
677 <p>To be done</p>
679 <h2>Scenario: Cancelling a Spend</h2>
681 <p>To be done</p>
683 <p>Copyright &copy; 2008 Bill St. Clair, All Rights Reserved</p>
685 </body>
686 </html>