Anoncoin  0.9.4
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
libzerocoin::PrivateCoin Class Reference

A private coin. More...

#include <Coin.h>

Collaboration diagram for libzerocoin::PrivateCoin:
[legend]

Public Member Functions

template<typename Stream >
 PrivateCoin (const Params *p, Stream &strm)
 
 PrivateCoin (const Params *p, const CoinDenomination denomination)
 
PublicCoin getPublicCoin () const
 
Bignum getSerialNumber () const
 
Bignum getRandomness () const
 
void mintCoin (const CoinDenomination denomination)
 Mint a new coin. More...
 
void mintCoinFast (const CoinDenomination denomination)
 Mint a new coin using a faster process. More...
 

Public Attributes

IMPLEMENT_SERIALIZE(READWRITE(publicCoin);READWRITE(randomness);READWRITE(serialNumber);) private PublicCoin publicCoin
 
Bignum randomness
 
Bignum serialNumber
 

Detailed Description

A private coin.

As the name implies, the content of this should stay private except PublicCoin.

Contains a coin's serial number, a commitment to it, and opening randomness for the commitment.

Warning
Failure to keep this secret(or safe),
will result in the theft of your coins
and a TOTAL loss of anonymity.

Definition at line 129 of file Coin.h.

Constructor & Destructor Documentation

template<typename Stream >
libzerocoin::PrivateCoin::PrivateCoin ( const Params p,
Stream &  strm 
)
inline

Definition at line 132 of file Coin.h.

libzerocoin::PrivateCoin::PrivateCoin ( const Params p,
const CoinDenomination  denomination 
)

Definition at line 54 of file Coin.cpp.

Here is the call graph for this function:

Member Function Documentation

PublicCoin libzerocoin::PrivateCoin::getPublicCoin ( ) const

Definition at line 166 of file Coin.cpp.

Here is the caller graph for this function:

Bignum libzerocoin::PrivateCoin::getRandomness ( ) const

Definition at line 80 of file Coin.cpp.

Here is the caller graph for this function:

Bignum libzerocoin::PrivateCoin::getSerialNumber ( ) const
Returns
the coins serial number

Definition at line 76 of file Coin.cpp.

Here is the caller graph for this function:

void libzerocoin::PrivateCoin::mintCoin ( const CoinDenomination  denomination)

Mint a new coin.

Parameters
denominationthe denomination of the coin to mint
Exceptions
ZerocoinExceptionif the process takes too long

Generates a new Zerocoin by (a) selecting a random serial number, (b) committing to this serial number and repeating until the resulting commitment is prime. Stores the resulting commitment (coin) and randomness (trapdoor).

Definition at line 84 of file Coin.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void libzerocoin::PrivateCoin::mintCoinFast ( const CoinDenomination  denomination)

Mint a new coin using a faster process.

Parameters
denominationthe denomination of the coin to mint
Exceptions
ZerocoinExceptionif the process takes too long

Generates a new Zerocoin by (a) selecting a random serial number, (b) committing to this serial number and repeating until the resulting commitment is prime. Stores the resulting commitment (coin) and randomness (trapdoor). This routine is substantially faster than the mintCoin() routine, but could be more vulnerable to timing attacks. Don't use it if you think someone could be timing your coin minting.

Definition at line 117 of file Coin.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

IMPLEMENT_SERIALIZE ( READWRITE(publicCoin); READWRITE(randomness); READWRITE(serialNumber); ) private PublicCoin libzerocoin::PrivateCoin::publicCoin

Definition at line 141 of file Coin.h.

Bignum libzerocoin::PrivateCoin::randomness

Definition at line 149 of file Coin.h.

Bignum libzerocoin::PrivateCoin::serialNumber

Definition at line 150 of file Coin.h.


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