Skip to content
FellowTraveler edited this page Sep 7, 2011 · 22 revisions

Open Transactions is, at its core, a class library. I hope to have documentation for all these classes sometime soon.

In the meantime, be sure to read the detailed notes on the API and the Use Cases for the API.

BASIC DATA TYPES
OTData — The base class for binary data in OT. (Like OTString, except for binary data.)
OTIdentifier — A 256-bit hash value. The Nym’s ID is a hash of his public key. The Asset Type’s ID is the hash of its asset contract. The Server ID is a hash of the server contract. Etc.
OTString — The basic string class for OT. (In the C++ language, the standard classes aren’t meant to be used as “first class” classes, but need to be wrapped. OTString is built around its interface with other classes in the OT library, and it is easy to swap the internal string code later, without impacting anything else.)
OTStringXML — Derived from OTString. Used in conjunction with the XML library that OT currently uses for its XML contracts.

USER / PSEUDONYM
OTPseudonym — Primarily a key pair. (Public/private keys.) Also manages lists of request numbers and transaction numbers for various different OT servers. Used as an identity, and for signing and verifying signatures on various contracts. A pseudonym may have many asset accounts. A pseudonym may be registered on multiple servers.

CONTRACTS / INSTRUMENTS
OTContract — Most other classes are derived from this one. Contains the actual XML contents, as well as various data values that were loaded from those contents, including public keys. Also contains a list of signatures.
OTServerContract — A contract specific to an OT server. Derived from OTContract.
OTAssetContract — A contract specific to an ASSET TYPE. (May exist on multiple servers.) Derived from OTContract.
OTInstrument — Has a date range, a server ID, and an asset ID. Derived from OTTrackable.
OTTrackable — Has a transaction number, user ID, and an asset account ID. Derived from OTCronItem.
OTCheque — A financial instrument. Derived from OTTrackable.
OTCronItem — Derived from OTContract. OT has a central “Cron” object which runs recurring tasks, known as CronItems.
OTAgreement — This is a form of Cron Item. It has a recipient and recipient asset account. (Derived from OTInstrument.)
OTBasket — Used in basket currencies. Derived from OTContract.
OTPaymentPlan — Derived from OTCronItem. Allows merchants and customers to set up recurring payments. (Cancel anytime, with a receipt going to both inboxes.)
OTOffer — Derived from OTInstrument. An OTMarket has a list of these.
OTTrade — Derived from OTCronItem. These correspond to offers on the market. Anytime an offer processes on the market against another offer (a “trade”) then the quantities are updated here and saved as the latest cron receipt (with a copy going to your inbox, along with a copy of your original signed market offer.)

DIGITAL CASH
OTMint — There is a different mint for each asset type, plus a new version of that mint replaces the old version, whenever a new series of the currency is rotated in. (This is necessary to allow the server operator to occasionally destroy the spent token database, which would otherwise continue growing forever, with the operator forced to maintain it forever.)
OTToken — A basic unit of untraceable digital cash. Tokens have denominations (1, 5, 10, 25, 100, etc) and OTToken works together with OTMint. All of the Lucre code in OT resides in these two classes. (Coin, Bank, PublicBank, etc.)
OTPurse — Since an OTToken can only have a set denominational amount (1, 5, 10, etc), it is necessary to carry purses full of tokens, in order to withdraw exactly the correct amount that you require (such as 8734, or 98, or 139, etc.) Thus, OT users will more commonly interact with purses than with actual tokens.

NUMBERED ACCOUNTS / SIGNED RECEIPTS
OTTransactionType — This is the base class for OTLedger, OTTransaction, OTItem, and OTAccount. Derived from OTContract.
OTLedger — Contains a list of transactions. Used in messages, and also used for inbox/outbox.
OTTransaction — The basic transactional unit, including a transaction number(s), and a list of transaction items.
OTItem — OTTransaction contains a list of these. (Usually two.) There might be a withdrawal item and a balance agreement item. Or a deposit item and a balance agreement item. Or a transfer item and a balance agreement item. Etc. (All transactions require a balance agreement.)
OTAccount — The class that handles the intermediary file for account balances.

CRYPTO UTILITY CLASSES
OTEnvelope — Encrypts/decrypts a piece of data (usually an OTASCIIArmor) using a Nym’s private and public keys.
OTAsymmetricKey — An OTPseudonym has several of these.
OTSignature — An OTContract has a list of these.
OTASCIIArmor — Takes string or binary data, and then packs it, compresses it, base-64 encodes it, and returns as a base64-encoded string. Derived from OTString.
OTSignedFile — Uses a Nym to sign any content, and then stores it as an OT contract, including the file path information inside the contract as well.

CLIENT
OTClient
OTServerConnection
OTWallet — Manages client-side list of Nyms, Asset Contracts, Server Contracts, and Accounts.

SERVER
OTServer
OTClientConnection
OTCron
OTMarket

FOR THE PROTOCOL
OTMessage — Derived from OTContract.
OTMessageBuffer
OTPayload — Derived from OTData.

Clone this wiki locally