NAME

Crypt::HashCash::Mint - Mint for HashCash Digital Cash

VERSION

$Revision: 1.130 $
$Date: Sat Dec 22 18:42:26 PST 2018 $

SYNOPSIS

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

DESCRIPTION

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.

METHODS

new

Creates and returns a new Crypt::HashCash::Mint object.

keygen

Generates and saves blind signing keys for all coin denominations.

loadkeys

Loads saved mint keys from disk.

init

Returns an initialization vector for coin minting.

mint_coin

Mints and returns a blinded coin. Takes a single argument, the coin request.

verify_coin

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.

spend_coin

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.

unspend_coin

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.

SEE ALSO

http://www.hashcash.com

Crypt::HashCash

Crypt::HashCash::Client

Crypt::HashCash::Coin

Crypt::HashCash::Vault::Bitcoin

Business::HashCash

AUTHOR

Ashish Gulhati, <crypt-hashcash at hash.neo.tc>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Crypt::HashCash::Mint

You can also look for information at:

LICENSE AND COPYRIGHT

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.