Transfer lifecycle
This document describes a transfer from Alice's account to Bob's account.
Notarize transaction
Alice initiates a transfer by sending a signed notarizeTransaction message to
the Notary. The message contains an accountLedger document and it contains a
transfer transaction type.
The transaction contains two items:
transfer- contains information about the accounts that the transfer will be performed between
 balanceStatement- contains a proposal about the balance and transaction/issued numbers if the transfer is successful
 
Everything is signed by Alice.
Alice initializes a transfer
Notary responds with @notarizeTransaction message. It contains
accountLedger with transaction type atTransfer (response to transaction
transfer). The transaction contains a response for each item. The items' status
is acknowledgement or rejection.
atBalanceStatement- contains attribute 
outboxNewTransNumthat contains number of new transaction that the Notary dropped to Alice's outbox and Bob's inbox. atTransfer
Both items contain an inReferenceTo the whole copy of original item. The response
item is signed by the Notary to prove that the Notary agreed with it. Both items
have set inReferenceTo, numberOfOrigin and transactionNum to origin
Alice's transaction number.
When the Notary accepts Alice's transaction, the Notary creates a new pending
transaction and puts it into Bob's inbox and Alice's outbox.
Alice expects a new transaction in her outbox, so she downloads it by
combination of getAccountData, getBoxReceipt.
TODO: why has Alice new copy of transfer.
Bob gets transfer to inbox
The same is done by Bob. Using getAccountData and getBoxReceipt messages,
Bob downloads a new receipt from his inbox. The receipt contains a pending
transaction signed by the Notary. The transaction contains Alice's original
transfer with her signature.
Bob accepts the pending transaction by performing a new processInbox
transaction. This transaction contains two items:
acceptPendingnumberOfOriginpoints to Alice's originaltransfertransactionNumis a new transaction number, same asprocessInboxinReferenceTopoints to the transaction that Bob is responding to (generated by Notary after Alice senttransfer)balanceStatementwith new proposed balance and transaction numbers
Notary accepts Bob's processInbox and sends atAcceptPending to Bob in reply.
As Bob accepted the transfer, Notary generates a new transferReceipt
transaction and drops it into Alice's inbox.
Alice gets a notification that the transfer is complete
Alice receives a new transferReceipt in her inbox.
numberOfOriginpoints to Alice's originaltransfertransactionNumis the new transaction numberinReferenceTopoints to Bob'sprocessInboxinRefDisplaypoints to Alice's originaltransfer- element 
inReferenceTocontains a copy of Bob'sacceptPending, with his signature, so Alice has proof that Bob accepted the transfer and it is also signed by the Notary. TODO: we do not see that the client checks it, in the current code 
Alice responds to transferReceipt by acceptItemReceipt in processInbox.
Notary sends atAcceptItemReceipt.