- SEE ALSO
- LICENSE AND COPYRIGHT
Crypt::HashCash::Mint - Mint for HashCash Digital Cash
$Revision: 1.130 $ $Date: Sat Dec 22 18:42:26 PST 2018 $
use Crypt::HashCash::Mint; my $mint = new Crypt::HashCash::Mint ( Create => 1 ); $mint->sigscheme('ECDSA'); # Use ECDSA blind signatures $mint->keygen; # Create a new mint keypair $mint->loadkeys; # Load saved mint keys my $init = $mint->init; # Initialize coin request my $bcoin = $mint->mint_coin($request); # Mint a blinded coin print "OK\n" if $mint->verify_coin($coin); # Verify a coin print "Spent\n" if $mint->spend_coin($coin); # Spend a coin
This module implements a mint for the HashCash digital cash system. It provides methods to mint blinded coins, and to verify and spend HashCash coins.
Creates and returns a new Crypt::HashCash::Mint object.
Generates and saves blind signing keys for all coin denominations.
Loads saved mint keys from disk.
Returns an initialization vector for coin minting.
Mints and returns a blinded coin. Takes a single argument, the coin request.
Verifies the coin provided as the only argument, and returns true if the coin verified successfully, or false if it didn't. This method doesn't add the coin to the spent coins database.
Spends the coin provided as the only argument, and returns true if the coin was spent successfully, or false if it wasn't. This method adds the coin to the spent coins database.
Unspends the coin provided as the only argument. Returns undef if there was an error in the argument, 0 if the coin wasn't in the spent DB, or 1 if it was successfully unspent.
<crypt-hashcash at hash.neo.tc>
Please report any bugs or feature requests to
bug-crypt-hashcash at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Crypt-HashCash. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Copyright (c) Ashish Gulhati.
This software package is Open Software; you can use, redistribute, and/or modify it under the terms of the Open Artistic License 2.0.
Please see http://www.opensoftwr.org/oal20.txt for the full license terms, and ensure that the license grant applies to you before using or modifying this software. By using or modifying this software, you indicate your agreement with the license terms.