Difference between revisions of "List of Classes"

From Open Transactions
Jump to navigation Jump to search
(Created page with "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 [[API|detailed note...")
 
Line 3: Line 3:
 
In the meantime, be sure to read the [[API|detailed notes on the API]] and the [[Use Cases]] for the API.
 
In the meantime, be sure to read the [[API|detailed notes on the API]] and the [[Use Cases]] for the API.
  
USER / PSEUDONYM  
+
<br>USER / PSEUDONYM  
 
<br>'''OTPseudonym''' -- Primarily a key pair. (Public/private keys.) Used as an identity; also manages lists of request numbers and transaction numbers for that identity on various OT servers. Often used for signing and verifying signatures on contracts. ''A pseudonym may have many asset accounts. A pseudonym may be registered on multiple servers.''  
 
<br>'''OTPseudonym''' -- Primarily a key pair. (Public/private keys.) Used as an identity; also manages lists of request numbers and transaction numbers for that identity on various OT servers. Often used for signing and verifying signatures on contracts. ''A pseudonym may have many asset accounts. A pseudonym may be registered on multiple servers.''  
 
<br>'''OTIdentifier''' -- A 256-bit hash, usually of a public key or a contract, displayed as Base62. (The Nym's ID is a hash of his public key. An Asset Type's ID is the hash of its asset contract. The Server ID is a hash of the server contract. Etc.)
 
<br>'''OTIdentifier''' -- A 256-bit hash, usually of a public key or a contract, displayed as Base62. (The Nym's ID is a hash of his public key. An Asset Type's ID is the hash of its asset contract. The Server ID is a hash of the server contract. Etc.)
  
CONTRACTS / INSTRUMENTS  
+
<br>CONTRACTS / INSTRUMENTS  
 
<br>'''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.  
 
<br>'''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.  
 
<br>'''OTScriptable''' -- Derived from OTContract, but enables scriptable clauses. Also contains a list of parties (each with agents and asset accounts) as well as a list of bylaws (each with scripted clauses, internal state, hooks, callbacks, etc.)  
 
<br>'''OTScriptable''' -- Derived from OTContract, but enables scriptable clauses. Also contains a list of parties (each with agents and asset accounts) as well as a list of bylaws (each with scripted clauses, internal state, hooks, callbacks, etc.)  
Line 23: Line 23:
 
<br>'''OTSmartContract''' -- Derived from OTCronItem. All CronItems are actually derived from OTScriptable already (through OTTrackable/OTInstrument). But OTSmartContract is the first/only Cron Item specifically designed to take full advantage of both the cron system AND the scriptable system in conjunction with each other. Currently OTSmartContract is the only actual server-side scripting on OT.
 
<br>'''OTSmartContract''' -- Derived from OTCronItem. All CronItems are actually derived from OTScriptable already (through OTTrackable/OTInstrument). But OTSmartContract is the first/only Cron Item specifically designed to take full advantage of both the cron system AND the scriptable system in conjunction with each other. Currently OTSmartContract is the only actual server-side scripting on OT.
  
DIGITAL CASH  
+
<br>DIGITAL CASH  
 
<br>'''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.)  
 
<br>'''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.)  
 
<br>'''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.)  
 
<br>'''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.)  
 
<br>'''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.
 
<br>'''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  
+
<br>NUMBERED ACCOUNTS / SIGNED RECEIPTS  
 
<br>'''OTTransactionType''' -- This is the base class for OTLedger, OTTransaction, OTItem, and OTAccount. Derived from OTContract.  
 
<br>'''OTTransactionType''' -- This is the base class for OTLedger, OTTransaction, OTItem, and OTAccount. Derived from OTContract.  
 
<br>'''OTLedger''' -- Contains a list of transactions. Used in messages, and also used for inbox/outbox.  
 
<br>'''OTLedger''' -- Contains a list of transactions. Used in messages, and also used for inbox/outbox.  
Line 35: Line 35:
 
<br>'''OTAccount''' -- The class that handles the intermediary file for account balances.
 
<br>'''OTAccount''' -- The class that handles the intermediary file for account balances.
  
CRYPTO UTILITY CLASSES  
+
<br>CRYPTO UTILITY CLASSES  
 
<br>'''OTEnvelope''' -- Encrypts/decrypts a piece of data (usually an OTASCIIArmor) using a Nym's private and public keys.  
 
<br>'''OTEnvelope''' -- Encrypts/decrypts a piece of data (usually an OTASCIIArmor) using a Nym's private and public keys.  
 
<br>'''OTPassword''' -- OT is endeavoring to use secure password storage in RAM.  
 
<br>'''OTPassword''' -- OT is endeavoring to use secure password storage in RAM.  
Line 49: Line 49:
 
We should always endeavor to use standard protected memory APIs and authentication agents (such as gpg-agent and ssh-agent.) We will endeavor to use our own crypto as a separate layer, wherever possible. We will endeavor to use random memory layout, and code obfuscation, stack smashing protection, static and dynamic analysis, clean out the buffer overflows etc. Security never stops!
 
We should always endeavor to use standard protected memory APIs and authentication agents (such as gpg-agent and ssh-agent.) We will endeavor to use our own crypto as a separate layer, wherever possible. We will endeavor to use random memory layout, and code obfuscation, stack smashing protection, static and dynamic analysis, clean out the buffer overflows etc. Security never stops!
  
CLIENT  
+
<br>CLIENT  
 
<br>'''OTClient''' -- The primary class on the client side.  
 
<br>'''OTClient''' -- The primary class on the client side.  
 
<br>'''OTServerConnection''' -- Manages the client's connection to a specific OT server.  
 
<br>'''OTServerConnection''' -- Manages the client's connection to a specific OT server.  
 
<br>'''OTWallet''' -- Manages client-side list of Nyms, Asset Contracts, Server Contracts, and Accounts.
 
<br>'''OTWallet''' -- Manages client-side list of Nyms, Asset Contracts, Server Contracts, and Accounts.
  
SERVER  
+
<br>SERVER  
 
<br>'''OTServer''' -- The main class for the OT transaction server (transaction.exe).  
 
<br>'''OTServer''' -- The main class for the OT transaction server (transaction.exe).  
 
<br>'''OTClientConnection''' -- Manages a single client connection to that server.  
 
<br>'''OTClientConnection''' -- Manages a single client connection to that server.  
Line 60: Line 60:
 
<br>'''OTMarket''' -- Manages a list of active offers, and processes trades between them. There may be many markets on any given OTServer. Derived from OTContract.
 
<br>'''OTMarket''' -- Manages a list of active offers, and processes trades between them. There may be many markets on any given OTServer. Derived from OTContract.
  
FOR THE PROTOCOL  
+
<br>FOR THE PROTOCOL  
 
<br>'''OTMessage''' -- Derived from OTContract.  
 
<br>'''OTMessage''' -- Derived from OTContract.  
 
<br>'''OTMessageBuffer''' -- Contains a list of OTMessages.  
 
<br>'''OTMessageBuffer''' -- Contains a list of OTMessages.  
 
<br>'''OTPayload''' -- Derived from OTData.
 
<br>'''OTPayload''' -- Derived from OTData.
  
BASIC DATA TYPES  
+
<br>BASIC DATA TYPES  
 
<br>'''OTData''' -- The base class for binary data in OT. (Like OTString, except for binary data.)  
 
<br>'''OTData''' -- The base class for binary data in OT. (Like OTString, except for binary data.)  
 
<br>'''OTString''' -- The basic string class for OT. (In the C++ language, the standard classes aren't meant to be used as &quot;first class&quot; 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.)  
 
<br>'''OTString''' -- The basic string class for OT. (In the C++ language, the standard classes aren't meant to be used as &quot;first class&quot; 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.)  
 
<br>'''OTStringXML''' -- Derived from OTString. Used in conjunction with the XML library that OT currently uses for its XML contracts. (irrxml.)
 
<br>'''OTStringXML''' -- Derived from OTString. Used in conjunction with the XML library that OT currently uses for its XML contracts. (irrxml.)

Revision as of 16:34, 11 June 2013

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.


USER / PSEUDONYM
OTPseudonym -- Primarily a key pair. (Public/private keys.) Used as an identity; also manages lists of request numbers and transaction numbers for that identity on various OT servers. Often used for signing and verifying signatures on contracts. A pseudonym may have many asset accounts. A pseudonym may be registered on multiple servers.
OTIdentifier -- A 256-bit hash, usually of a public key or a contract, displayed as Base62. (The Nym's ID is a hash of his public key. An Asset Type's ID is the hash of its asset contract. The Server ID is a hash of the server contract. Etc.)


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.
OTScriptable -- Derived from OTContract, but enables scriptable clauses. Also contains a list of parties (each with agents and asset accounts) as well as a list of bylaws (each with scripted clauses, internal state, hooks, callbacks, etc.)
OTServerContract -- Derived from OTContract. Specific to an OT server.
OTAssetContract -- Derived from OTContract. Specific to an ASSET TYPE. (May be registered on multiple servers.)
OTBasket -- Used in basket currencies. Derived from OTContract.
OTInstrument -- Has a date range, a server ID, and an asset ID. Derived from OTScriptable.
OTTrackable -- Has a transaction number, user ID, and an asset account ID. Derived from OTInstrument.
OTCheque -- A financial instrument. Derived from OTTrackable.
OTCronItem -- Derived from OTTrackable. OT has a central "Cron" object which runs recurring tasks, known as CronItems.
OTAgreement -- Derived from OTCronItem. It has a recipient and recipient asset account.
OTPaymentPlan -- Derived from OTAgreement. 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.)
OTSmartContract -- Derived from OTCronItem. All CronItems are actually derived from OTScriptable already (through OTTrackable/OTInstrument). But OTSmartContract is the first/only Cron Item specifically designed to take full advantage of both the cron system AND the scriptable system in conjunction with each other. Currently OTSmartContract is the only actual server-side scripting on OT.


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.
OTPassword -- OT is endeavoring to use secure password storage in RAM.
OTSymmetricKey -- For password-based crypto.
OTAsymmetricKey -- An OTPseudonym has a public/private key pair.
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.
OTCachedKey -- The private keys of the Nyms in the wallet are encrypted to the cached master key (as their "passphrase".) The cached key itself is randomly generated and then kept encrypted to a symmetric key from a key derivation algorithm (from the user's passphrase.) It uses threads to erase the cleartext portion of the cached key after X seconds have passed. The user will be forced to enter his passphrase again after X seconds.
OTCrypto -- I've started the process of moving all OpenSSL-specific code into "OTCryptoOpenSSL" which is derived from OTCrypto and accessed as OTCrypto::It(). This will make it easier, in the future, to swap other crypto libs in and out of OT.
OTKeyring -- If configured to do so, OT will cache the derived key (used in OTCachedKey, above, to unlock the actual cached master key) using the system keyring. Currently supporting: gnome-keyring, Mac Keychain, KDE KWallet, and Windows DPAPI.

We should always endeavor to use standard protected memory APIs and authentication agents (such as gpg-agent and ssh-agent.) We will endeavor to use our own crypto as a separate layer, wherever possible. We will endeavor to use random memory layout, and code obfuscation, stack smashing protection, static and dynamic analysis, clean out the buffer overflows etc. Security never stops!


CLIENT
OTClient -- The primary class on the client side.
OTServerConnection -- Manages the client's connection to a specific OT server.
OTWallet -- Manages client-side list of Nyms, Asset Contracts, Server Contracts, and Accounts.


SERVER
OTServer -- The main class for the OT transaction server (transaction.exe).
OTClientConnection -- Manages a single client connection to that server.
OTCron -- Manages a list of Cron Items (that process their terms on a regular basis, including payment plans, market trades, and who knows, maybe someday: Ripple orders.)
OTMarket -- Manages a list of active offers, and processes trades between them. There may be many markets on any given OTServer. Derived from OTContract.


FOR THE PROTOCOL
OTMessage -- Derived from OTContract.
OTMessageBuffer -- Contains a list of OTMessages.
OTPayload -- Derived from OTData.


BASIC DATA TYPES
OTData -- The base class for binary data in OT. (Like OTString, except for binary data.)
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. (irrxml.)