Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opentxs::MintLucre Class Reference

#include <MintLucre.hpp>

Inheritance diagram for opentxs::MintLucre:
Collaboration diagram for opentxs::MintLucre:

Public Member Functions

virtual bool AddDenomination (OTPseudonym &theNotary, int64_t lDenomination, int32_t nPrimeLength=1024)
 
virtual EXPORT bool SignToken (OTPseudonym &theNotary, Token &theToken, OTString &theOutput, int32_t nTokenIndex)
 
virtual EXPORT bool VerifyToken (OTPseudonym &theNotary, OTString &theCleartextToken, int64_t lDenomination)
 
virtual EXPORT ~MintLucre ()
 
- Public Member Functions inherited from opentxs::Mint
int32_t GetSeries () const
 
time64_t GetValidFrom () const
 
time64_t GetValidTo () const
 
time64_t GetExpiration () const
 
EXPORT bool Expired () const
 
OTAccountGetCashReserveAccount () const
 
virtual EXPORT ~Mint ()
 
virtual void Release ()
 
void Release_Mint ()
 
void ReleaseDenominations ()
 
EXPORT bool LoadMint (const char *szAppend=nullptr)
 
EXPORT bool SaveMint (const char *szAppend=nullptr)
 
virtual bool LoadContract ()
 
void SetSavePrivateKeys (bool bDoIt=true)
 
bool GetPrivate (OTASCIIArmor &theArmor, int64_t lDenomination)
 
bool GetPublic (OTASCIIArmor &theArmor, int64_t lDenomination)
 
int64_t GetDenomination (int32_t nIndex)
 
EXPORT int64_t GetLargestDenomination (int64_t lAmount)
 
int32_t GetDenominationCount () const
 
virtual bool VerifyContractID () const
 
EXPORT bool VerifyMint (const OTPseudonym &theOperator)
 
virtual void UpdateContents ()
 
void SetAssetID (const OTIdentifier &newID)
 
EXPORT void GenerateNewMint (int32_t nSeries, time64_t VALID_FROM, time64_t VALID_TO, time64_t MINT_EXPIRATION, const OTIdentifier &theAssetID, const OTIdentifier &theServerID, OTPseudonym &theNotary, int64_t nDenom1=0, int64_t nDenom2=0, int64_t nDenom3=0, int64_t nDenom4=0, int64_t nDenom5=0, int64_t nDenom6=0, int64_t nDenom7=0, int64_t nDenom8=0, int64_t nDenom9=0, int64_t nDenom10=0)
 
virtual bool SaveContractWallet (std::ofstream &ofs) const
 
- Public Member Functions inherited from opentxs::OTContract
const char * GetHashType () const
 
void SetIdentifier (const OTIdentifier &theID)
 
EXPORT OTContract ()
 
EXPORT OTContract (const OTString &name, const OTString &foldername, const OTString &filename, const OTString &strID)
 
EXPORT OTContract (const OTString &strID)
 
EXPORT OTContract (const OTIdentifier &theID)
 
void Initialize ()
 
virtual EXPORT ~OTContract ()
 
EXPORT void Release_Contract ()
 
EXPORT void ReleaseSignatures ()
 
virtual EXPORT bool CreateContract (const OTString &strContract, const OTPseudonym &theSigner)
 
EXPORT bool InsertNym (const OTString &strKeyName, const OTString &strKeyValue)
 
EXPORT void GetName (OTString &strName) const
 
EXPORT void SetName (const OTString &strName)
 
virtual EXPORT bool VerifyContract ()
 
virtual EXPORT void GetIdentifier (OTIdentifier &theIdentifier) const
 
virtual EXPORT void GetIdentifier (OTString &theIdentifier) const
 
EXPORT void GetFilename (OTString &strFilename) const
 
EXPORT void GetFoldername (OTString &strFoldername) const
 
EXPORT bool LoadContract (const char *szFoldername, const char *szFilename)
 
EXPORT bool LoadContractFromString (const OTString &theStr)
 
bool LoadContractRawFile ()
 
EXPORT bool ParseRawFile ()
 
EXPORT bool SaveToContractFolder ()
 
EXPORT bool SaveContractRaw (OTString &strOutput) const
 
EXPORT bool RewriteContract (OTString &strOutput) const
 
EXPORT bool SaveContract ()
 
EXPORT bool SaveContract (const char *szFoldername, const char *szFilename)
 
virtual EXPORT void CreateContents ()
 
EXPORT void CreateInnerContents ()
 
virtual EXPORT bool SaveContents (std::ofstream &ofs) const
 
virtual EXPORT bool SaveContractWallet (OTString &strContents) const
 
virtual EXPORT bool DisplayStatistics (OTString &strContents) const
 
virtual EXPORT bool SaveContents (OTString &strContents) const
 
virtual EXPORT bool SignContract (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContractAuthent (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignWithKey (const OTAsymmetricKey &theKey, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const OTPseudonym &theNym, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContractAuthent (const OTPseudonym &theNym, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const OTAsymmetricKey &theKey, OTSignature &theSignature, const OTString &strHashType, const OTPasswordData *pPWData=nullptr)
 
EXPORT bool SignContract (const char *szFoldername, const char *szFilename, OTSignature &theSignature, const OTPasswordData *pPWData=nullptr)
 
virtual EXPORT void CalculateContractID (OTIdentifier &newID) const
 
virtual EXPORT bool VerifySignature (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
 
virtual EXPORT bool VerifySigAuthent (const OTPseudonym &theNym, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifyWithKey (const OTAsymmetricKey &theKey, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const OTPseudonym &theNym, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySigAuthent (const OTPseudonym &theNym, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const OTAsymmetricKey &theKey, const OTSignature &theSignature, const OTString &strHashType, const OTPasswordData *pPWData=nullptr) const
 
EXPORT bool VerifySignature (const char *szFoldername, const char *szFilename, const OTSignature &theSignature, const OTPasswordData *pPWData=nullptr) const
 
EXPORT const OTAsymmetricKeyGetContractPublicKey () const
 
EXPORT const OTPseudonymGetContractPublicNym () const
 

Protected Member Functions

 MintLucre ()
 
EXPORT MintLucre (const OTString &strServerID, const OTString &strAssetTypeID)
 
EXPORT MintLucre (const OTString &strServerID, const OTString &strServerNymID, const OTString &strAssetTypeID)
 
- Protected Member Functions inherited from opentxs::Mint
virtual int32_t ProcessXMLNode (irr::io::IrrXMLReader *&xml)
 
void InitMint ()
 
 Mint ()
 
EXPORT Mint (const OTString &strServerID, const OTString &strAssetTypeID)
 
EXPORT Mint (const OTString &strServerID, const OTString &strServerNymID, const OTString &strAssetTypeID)
 
- Protected Member Functions inherited from opentxs::OTContract
bool LoadContractXML ()
 

Friends

class Mint
 

Additional Inherited Members

- Static Public Member Functions inherited from opentxs::Mint
static EXPORT MintMintFactory ()
 
static EXPORT MintMintFactory (const OTString &strServerID, const OTString &strAssetTypeID)
 
static EXPORT MintMintFactory (const OTString &strServerID, const OTString &strServerNymID, const OTString &strAssetTypeID)
 
- Static Public Member Functions inherited from opentxs::OTContract
static EXPORT bool DearmorAndTrim (const OTString &strInput, OTString &strOutput, OTString &strFirstLine)
 
static bool AddBookendsAroundContent (OTString &strOutput, const OTString &strContents, const OTString &strContractType, const OTString &strHashType, const listOfSignatures &listSignatures)
 
static EXPORT bool LoadEncodedTextField (irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput)
 
static EXPORT bool LoadEncodedTextField (irr::io::IrrXMLReader *&xml, OTString &strOutput)
 
static bool LoadEncodedTextFieldByName (irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput, const char *&szName, OTString::Map *pmapExtraVars=nullptr)
 
static bool LoadEncodedTextFieldByName (irr::io::IrrXMLReader *&xml, OTString &strOutput, const char *&szName, OTString::Map *pmapExtraVars=nullptr)
 
static bool SkipToElement (irr::io::IrrXMLReader *&xml)
 
static bool SkipToTextField (irr::io::IrrXMLReader *&xml)
 
static bool SkipAfterLoadingField (irr::io::IrrXMLReader *&xml)
 
static EXPORT bool SignFlatText (OTString &strFlatText, const OTString &strContractType, const OTPseudonym &theSigner, OTString &strOutput)
 
- Protected Attributes inherited from opentxs::Mint
mapOfArmor m_mapPrivate
 
mapOfArmor m_mapPublic
 
OTIdentifier m_ServerID
 
OTIdentifier m_ServerNymID
 
OTAsymmetricKeym_pKeyPublic
 
OTIdentifier m_AssetID
 
int32_t m_nDenominationCount
 
bool m_bSavePrivateKeys
 
int32_t m_nSeries
 
time64_t m_VALID_FROM
 
time64_t m_VALID_TO
 
time64_t m_EXPIRATION
 
OTIdentifier m_CashAccountID
 
OTAccountm_pReserveAcct
 
- Protected Attributes inherited from opentxs::OTContract
OTString m_strName
 
OTString m_strFoldername
 
OTString m_strFilename
 
OTIdentifier m_ID
 
OTStringXML m_xmlUnsigned
 
OTString m_strRawFile
 
OTString m_strSigHashType
 
OTString m_strContractType
 
mapOfNyms m_mapNyms
 
listOfSignatures m_listSignatures
 
OTString m_strVersion
 
OTString m_strEntityShortName
 
OTString m_strEntityLongName
 
OTString m_strEntityEmail
 
OTString::Map m_mapConditions
 

Detailed Description

Definition at line 151 of file MintLucre.hpp.

Constructor & Destructor Documentation

opentxs::MintLucre::MintLucre ( )
protected

Definition at line 154 of file MintLucre.cpp.

155  : ot_super()
156 {
157 }
opentxs::MintLucre::MintLucre ( const OTString strServerID,
const OTString strAssetTypeID 
)
protected

Definition at line 159 of file MintLucre.cpp.

161  : ot_super(strServerID, strAssetTypeID)
162 {
163 }
opentxs::MintLucre::MintLucre ( const OTString strServerID,
const OTString strServerNymID,
const OTString strAssetTypeID 
)
protected

Definition at line 165 of file MintLucre.cpp.

168  : ot_super(strServerID, strServerNymID, strAssetTypeID)
169 {
170 }
opentxs::MintLucre::~MintLucre ( )
virtual

Definition at line 172 of file MintLucre.cpp.

173 {
174 }

Member Function Documentation

bool opentxs::MintLucre::AddDenomination ( OTPseudonym theNotary,
int64_t  lDenomination,
int32_t  nPrimeLength = 1024 
)
virtual

Implements opentxs::Mint.

Definition at line 192 of file MintLucre.cpp.

194 {
195  OT_ASSERT(nullptr != m_pKeyPublic);
196 
197  bool bReturnValue = false;
198 
199  // Let's make sure it doesn't already exist
200  OTASCIIArmor theArmor;
201  if (GetPublic(theArmor, lDenomination)) {
202  // it already exists.
203  otErr << "Error: Denomination public already exists in "
204  "OTMint::AddDenomination\n";
205  return false;
206  }
207  if (GetPrivate(theArmor, lDenomination)) {
208  // it already exists.
209  otErr << "Error: Denomination private already exists in "
210  "OTMint::AddDenomination\n";
211  return false;
212  }
213 
214  // otErr << "%s <size of bank prime in bits> <bank data file> <bank
215  // public data file>\n",
216 
217  if ((nPrimeLength / 8) < (MIN_COIN_LENGTH + DIGEST_LENGTH)) {
218  otErr << "Prime must be at least "
219  << (MIN_COIN_LENGTH + DIGEST_LENGTH) * 8 << " bits\n";
220  return false;
221  }
222 
223  if (nPrimeLength % 8) {
224  otErr << "Prime length must be a multiple of 8\n";
225  return false;
226  }
227 
228 #ifdef _WIN32
229  SetMonitor("openssl.dump");
230 #else
231  SetMonitor(stderr);
232 #endif
233 
234  OpenSSL_BIO bio = BIO_new(BIO_s_mem());
235  OpenSSL_BIO bioPublic = BIO_new(BIO_s_mem());
236 
237  // Generate the mint private key information
238  Bank bank(nPrimeLength / 8);
239  bank.WriteBIO(bio);
240 
241  // Generate the mint public key information
242  PublicBank pbank(bank);
243  pbank.WriteBIO(bioPublic);
244 
245  // Copy from BIO back to a normal OTString or Ascii-Armor
246  char privateBankBuffer[4096],
247  publicBankBuffer[4096]; // todo stop hardcoding these string lengths
248  int32_t privatebankLen =
249  BIO_read(bio, privateBankBuffer, 4000); // cutting it a little short on
250  // purpose, with the buffer.
251  int32_t publicbankLen =
252  BIO_read(bioPublic, publicBankBuffer,
253  4000); // Just makes me feel more comfortable for some reason.
254 
255  if (privatebankLen && publicbankLen) {
256  // With this, we have the Lucre public and private bank info converted
257  // to OTStrings
258  OTString strPublicBank;
259  strPublicBank.Set(publicBankBuffer, publicbankLen);
260  OTString strPrivateBank;
261  strPrivateBank.Set(privateBankBuffer, privatebankLen);
262 
263  OTASCIIArmor* pPublic = new OTASCIIArmor();
264  OTASCIIArmor* pPrivate = new OTASCIIArmor();
265 
266  OT_ASSERT(nullptr != pPublic);
267  OT_ASSERT(nullptr != pPrivate);
268 
269  // Set the public bank info onto pPublic
270  pPublic->SetString(strPublicBank, true); // linebreaks = true
271 
272  // Seal the private bank info up into an encrypted Envelope
273  // and set it onto pPrivate
274  OTEnvelope theEnvelope;
275  theEnvelope.Seal(theNotary, strPrivateBank); // Todo check the return
276  // values on these two
277  // functions
278  theEnvelope.GetAsciiArmoredData(*pPrivate);
279 
280  // Add the new key pair to the maps, using denomination as the key
281  m_mapPublic[lDenomination] = pPublic;
282  m_mapPrivate[lDenomination] = pPrivate;
283 
284  // Grab the Server Nym ID and save it with this Mint
285  theNotary.GetIdentifier(m_ServerNymID);
286 
287  // Grab the Server's public key and save it with this Mint
288  //
289  const OTAsymmetricKey& theNotaryPubKey = theNotary.GetPublicSignKey();
290  delete m_pKeyPublic;
291  m_pKeyPublic = theNotaryPubKey.ClonePubKey();
292 
294  // ---------------------------
295  // Success!
296  bReturnValue = true;
297  otWarn << "Successfully added denomination: " << lDenomination << "\n";
298  }
299 
300  return bReturnValue;
301 }
virtual OTAsymmetricKey * ClonePubKey() const
bool GetPrivate(OTASCIIArmor &theArmor, int64_t lDenomination)
Definition: Mint.cpp:557
OTIdentifier m_ServerNymID
Definition: Mint.hpp:169
bool GetPublic(OTASCIIArmor &theArmor, int64_t lDenomination)
Definition: Mint.cpp:574
Definition: bank.h:75
void SetMonitor(const char *filepathexact)
Definition: MintLucre.cpp:183
mapOfArmor m_mapPrivate
Definition: Mint.hpp:160
#define OT_ASSERT(x)
Definition: Assert.hpp:150
OTAsymmetricKey * m_pKeyPublic
Definition: Mint.hpp:172
OTLOG_IMPORT OTLogStream otWarn
int32_t m_nDenominationCount
Definition: Mint.hpp:176
#define DIGEST_LENGTH
Definition: bank.h:15
OTLOG_IMPORT OTLogStream otErr
mapOfArmor m_mapPublic
Definition: Mint.hpp:164
#define MIN_COIN_LENGTH
Definition: bank.h:13
bool opentxs::MintLucre::SignToken ( OTPseudonym theNotary,
Token theToken,
OTString theOutput,
int32_t  nTokenIndex 
)
virtual

Implements opentxs::Mint.

Definition at line 343 of file MintLucre.cpp.

345 {
346  bool bReturnValue = false;
347 
348  // otErr << "%s <bank file> <coin request> <coin signature> [<signature
349  // repeats>]\n",
350  LucreDumper setDumper;
351 
352  // otErr << "OTMint::SignToken!!\nnTokenIndex: %d\n Denomination:
353  // %lld\n", nTokenIndex, theToken.GetDenomination());
354 
355  OpenSSL_BIO bioBank = BIO_new(BIO_s_mem()); // input
356  OpenSSL_BIO bioRequest = BIO_new(BIO_s_mem()); // input
357  OpenSSL_BIO bioSignature = BIO_new(BIO_s_mem()); // output
358 
359  OTASCIIArmor thePrivate;
360  GetPrivate(thePrivate, theToken.GetDenomination());
361 
362  // The Mint private info is encrypted in
363  // m_mapPrivates[theToken.GetDenomination()].
364  // So I need to extract that first before I can use it.
365  OTEnvelope theEnvelope(thePrivate);
366 
367  OTString strContents; // output from opening the envelope.
368  // Decrypt the Envelope into strContents
369  if (!theEnvelope.Open(theNotary, strContents)) return false;
370 
371  // copy strContents to a BIO
372  BIO_puts(bioBank, strContents.Get());
373 
374  // otErr << "BANK CONTENTS:\n%s--------------------------------------\n",
375  // strContents.Get());
376 
377  // Instantiate the Bank with its private key
378  Bank bank(bioBank);
379  // otErr << "BANK INSTANTIATED.--------------------------------------\n";
380 
381  // I need the request. the prototoken.
382  OTASCIIArmor ascPrototoken;
383  bool bFoundToken = theToken.GetPrototoken(ascPrototoken, nTokenIndex);
384 
385  if (bFoundToken) {
386  // base64-Decode the prototoken
387  OTString strPrototoken(ascPrototoken);
388 
389  // otErr << "\n--------------------------------------\nDEBUG:
390  // PROTOTOKEN CONTENTS:\n"
391  // "-----------------%s---------------------\n",
392  // strPrototoken.Get() );
393 
394  // copy strPrototoken to a BIO
395  BIO_puts(bioRequest, strPrototoken.Get());
396 
397  // Load up the coin request from the bio (the prototoken)
398  PublicCoinRequest req(bioRequest);
399  // otErr << "PROTOTOKEN
400  // INSTANTIATED.--------------------------------------\n";
401 
402  // Sign it with the bank we previously instantiated.
403  // results will be in bnSignature (BIGNUM)
404  BIGNUM* bnSignature = bank.SignRequest(req);
405 
406  if (nullptr == bnSignature) {
407  otErr << "MAJOR ERROR!: Bank.SignRequest failed in "
408  "MintLucre::SignToken\n";
409  }
410  else {
411  // otErr << "BANK.SIGNREQUEST
412  // SUCCESSFUL.--------------------------------------\n";
413 
414  // Write the request contents, followed by the signature contents,
415  // to the Signature bio. Then free the BIGNUM.
416  req.WriteBIO(bioSignature); // the original request contents
417  DumpNumber(bioSignature, "signature=",
418  bnSignature); // the new signature contents
419  BN_free(bnSignature);
420 
421  // Read the signature bio into a C-style buffer...
422  char sig_buf[1024]; // todo stop hardcoding these string lengths
423  // memset(sig_buf, 0, 1024); // zero it out. (I had this
424  // commented out, but the size was 2048, so maybe it's safe now at
425  // 1024.)
426 
427  int32_t sig_len = BIO_read(bioSignature, sig_buf,
428  1000); // cutting it a little short on
429  // purpose, with the buffer. Just
430  // makes me feel more comfortable
431  // for some reason.
432 
433  // Add the null terminator by hand (just in case.)
434  sig_buf[sig_len] = '\0';
435 
436  if (sig_len) { // ***********************************************
437  // otErr <<
438  // "\n--------------------------------------\n"
439  // "*** Siglen is %d. sig_str_len is
440  // %d.\nsig buf:\n------------%s------------\nLAST "
441  // "CHARACTER IS '%c' SECOND TO LAST
442  // CHARACTER IS '%c'\n",
443  // sig_len, sig_str_len, sig_buf,
444  // sig_buf[sig_str_len-1], sig_buf[sig_str_len-2]);
445 
446  // Copy the original coin request into the spendable field of
447  // the token object.
448  // (It won't actually be spendable until the client processes
449  // it, though.)
450  theToken.SetSpendable(ascPrototoken);
451 
452  // otErr << "***
453  // SPENDABLE:\n-----------%s---------------------\n",
454  // ascPrototoken.Get());
455 
456  // Base64-encode the signature contents into
457  // theToken.m_Signature.
458  OTString strSignature(sig_buf);
459  // strSignature.Set(sig_buf, sig_len-1); // sig_len
460  // includes null terminator, whereas Set() adds 1 for it.
461 
462  // otErr << "SIGNATURE:\n--------------------%s"
463  // "------------------\n",
464  // strSignature.Get());
465 
466  // Here we pass the signature back to the caller.
467  // He will probably set it onto the token.
468  theOutput.Set(sig_buf, sig_len);
469  bReturnValue = true;
470 
471  // This is also where we set the expiration date on the token.
472  // The client should have already done this, but we are
473  // explicitly
474  // setting the values here to prevent any funny business.
475  theToken.SetSeriesAndExpiration(m_nSeries, m_VALID_FROM,
476  m_VALID_TO);
477  }
478  }
479  }
480 
481  return bReturnValue;
482 }
int32_t m_nSeries
Definition: Mint.hpp:186
bool GetPrivate(OTASCIIArmor &theArmor, int64_t lDenomination)
Definition: Mint.cpp:557
void DumpNumber(BIO *out, const char *szTitle, const BIGNUM *bn, const char *szTrailer=_NL)
Definition: bank.h:75
OTLOG_IMPORT OTLogStream otErr
time64_t m_VALID_FROM
Definition: Mint.hpp:192
time64_t m_VALID_TO
Definition: Mint.hpp:194
bool opentxs::MintLucre::VerifyToken ( OTPseudonym theNotary,
OTString theCleartextToken,
int64_t  lDenomination 
)
virtual

Implements opentxs::Mint.

Definition at line 487 of file MintLucre.cpp.

489 {
490  bool bReturnValue = false;
491  // otErr << "%s <bank info> <coin>\n", argv[0]);
492  LucreDumper setDumper;
493 
494  OpenSSL_BIO bioBank = BIO_new(BIO_s_mem()); // input
495  OpenSSL_BIO bioCoin = BIO_new(BIO_s_mem()); // input
496 
497  // --- copy theCleartextToken to bioCoin so lucre can load it
498  BIO_puts(bioCoin, theCleartextToken.Get());
499 
500  // --- The Mint private info is encrypted in m_mapPrivate[lDenomination].
501  // So I need to extract that first before I can use it.
502  OTASCIIArmor theArmor;
503  GetPrivate(theArmor, lDenomination);
504  OTEnvelope theEnvelope(theArmor);
505 
506  OTString strContents; // will contain output from opening the envelope.
507  // Decrypt the Envelope into strContents
508  if (theEnvelope.Open(theNotary, strContents)) {
509  // copy strContents to a BIO
510  BIO_puts(bioBank, strContents.Get());
511 
512  // ---- Now the bank and coin bios are both ready to go...
513 
514  Bank bank(bioBank);
515  Coin coin(bioCoin);
516 
517  if (bank.Verify(coin)) // Here's the boolean output: coin is verified!
518  {
519  bReturnValue = true;
520 
521  // (Done): When a token is redeemed, need to store it in the spent
522  // token database.
523  // Right now I can verify the token, but unless I check it against a
524  // database, then
525  // even though the signature verifies, it doesn't stop people from
526  // redeeming the same
527  // token again and again and again.
528  //
529  // (done): also need to make sure issuer has double-entries for
530  // total amount outstanding.
531  //
532  // UPDATE: These are both done now. The Spent Token database is
533  // implemented in the transaction server,
534  // (not OTLib proper) and the same server also now keeps a cash
535  // account to match all cash withdrawals.
536  // (Meaning, if 10,000 clams total have been withdrawn by various
537  // users, then the server actually has
538  // a clam account containing 10,000 clams. As the cash comes in for
539  // redemption, the server debits it from
540  // this account again before sending it to its final destination.
541  // This way the server tracks total outstanding
542  // amount, as an additional level of security after the blind
543  // signature itself.)
544  }
545  }
546 
547  return bReturnValue;
548 }
bool GetPrivate(OTASCIIArmor &theArmor, int64_t lDenomination)
Definition: Mint.cpp:557
Definition: bank.h:185
Definition: bank.h:75

Friends And Related Function Documentation

friend class Mint
friend

Definition at line 155 of file MintLucre.hpp.


The documentation for this class was generated from the following files: