B2B Transfer Workflow Example
The figure below presents a B2B transfer end-to-end workflow and module interactions for a representative business transaction within the proposed privacy-preserving pipeline.

User A calls the JSON-RPC API service of his Hamsa Light Client, posting the intended plain non-private blockchain transaction. The API service interprets the transaction then calls the account services to execute the requested operation. The Account Service gathers all private information needed from its storage, executes the necessary calculations and calls the ZK Prover with the right arguments. ZK Prover executes its internal cryptographic circuits, builds the proof and hands it back to the Account Service. The Account Service then builds the special balance reserve transaction, it then requests the client's KMS or HSM to sign the new transaction and sends it to the Blockchain, followed by the correspondent private transfer transaction.
The Privacy enabled Token Smart Contract receives the reserve amount transaction from Client A to Client B. It merges the necessary input transfers from A's inbox into A's consolidated balance, removing the respective transfers from A's inbox. Then it calls the ZKVerifier contract with the corresponding arguments. After that, it extracts from the balance the amount to be transferred to B using the split balance scheme. Finally it reserves the extracted amount in A's outbox queue and stops.
The next transaction sent by the Account service is the privateTransfer. This transaction will move the reserved amount from A's outbox to B's inbox. This amount now composes B's total balance. Inside the token contract it will wait there until the user B calls its privateReserveAmount function.