The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Crypt::HashCash::Mint - Mint for HashCash digital cash

VERSION

 $Revision: 1.117 $
 $Date: Sat Jun 10 10:50:48 PDT 2017 $

SYNOPSIS

  use Crypt::HashCash::Mint;

  my $mint = new Crypt::HashCash::Mint ( Create => 1 );

  $mint->sigscheme('ECDSA');                   # Use ECDSA blind signatures
  $mint->keygen(Mint => 'Test Mint');          # 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->spent_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

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) 2001-2017 Ashish Gulhati.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

See http://www.perlfoundation.org/artistic_license_2_0 for the full license terms.