![]() |
Anoncoin
0.9.4
P2P Digital Currency
|
The complete proof needed to spend a zerocoin. More...
#include <CoinSpend.h>
Public Member Functions | |
template<typename Stream > | |
CoinSpend (const Params *p, Stream &strm) | |
CoinSpend (const Params *p, const PrivateCoin &coin, Accumulator &a, const AccumulatorWitness &witness, const SpendMetaData &m) | |
Generates a proof spending a zerocoin. More... | |
Bignum | getCoinSerialNumber () const |
Returns the serial number of the coin spend by this proof. More... | |
CoinDenomination | getDenomination () const |
Gets the denomination of the coin spent in this proof. More... | |
bool | Verify (const Accumulator &a, const SpendMetaData &metaData) const |
The complete proof needed to spend a zerocoin.
Composes together a proof that a coin is accumulated and that it has a given serial number.
Definition at line 32 of file CoinSpend.h.
|
inline |
Definition at line 35 of file CoinSpend.h.
libzerocoin::CoinSpend::CoinSpend | ( | const Params * | p, |
const PrivateCoin & | coin, | ||
Accumulator & | a, | ||
const AccumulatorWitness & | witness, | ||
const SpendMetaData & | m | ||
) |
Generates a proof spending a zerocoin.
To use this, provide an unspent PrivateCoin, the latest Accumulator (e.g from the most recent Anoncoin block) containing the public part of the coin, a witness to that, and the transaction hash.
Once constructed, this proof can be serialized and sent. It is validated simply by calling validate.
p | cryptographic parameters |
coin | The coin to be spend |
a | The current accumulator containing the coin |
witness | The witness showing that the accumulator contains the coin |
m | the transaction hash as described in docs/zerocoin.md; this is "signed" by the ZC spend (specifically the snSoK). |
ZerocoinException | if the process fails |
Definition at line 18 of file CoinSpend.cpp.
Bignum libzerocoin::CoinSpend::getCoinSerialNumber | ( | ) | const |
Returns the serial number of the coin spend by this proof.
Definition at line 62 of file CoinSpend.cpp.
CoinDenomination libzerocoin::CoinSpend::getDenomination | ( | ) | const |
Gets the denomination of the coin spent in this proof.
Definition at line 67 of file CoinSpend.cpp.
bool libzerocoin::CoinSpend::Verify | ( | const Accumulator & | a, |
const SpendMetaData & | metaData | ||
) | const |
Definition at line 72 of file CoinSpend.cpp.
Bignum libzerocoin::CoinSpend::accCommitmentToCoinValue |
Definition at line 96 of file CoinSpend.h.
AccumulatorProofOfKnowledge libzerocoin::CoinSpend::accumulatorPoK |
Definition at line 99 of file CoinSpend.h.
Bignum libzerocoin::CoinSpend::coinSerialNumber |
Definition at line 98 of file CoinSpend.h.
CommitmentProofOfKnowledge libzerocoin::CoinSpend::commitmentPoK |
Definition at line 101 of file CoinSpend.h.
CoinDenomination libzerocoin::CoinSpend::denomination |
Definition at line 95 of file CoinSpend.h.
Bignum libzerocoin::CoinSpend::serialCommitmentToCoinValue |
Definition at line 97 of file CoinSpend.h.
SerialNumberSignatureOfKnowledge libzerocoin::CoinSpend::serialNumberSoK |
Definition at line 100 of file CoinSpend.h.