This file is indexed.

/usr/share/doc/hashcash/hashcash.html is in hashcash 1.21-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hashcash</title>
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<ul>

		<li><a href="#mint__create__stamps_">Mint (create) stamps:</a></li>
		<li><a href="#check_stamps_">Check stamps:</a></li>
		<li><a href="#speed_estimates_">Speed estimates:</a></li>
		<li><a href="#purge_database_">Purge database:</a></li>
		<li><a href="#count_collision_bits_">Count collision bits:</a></li>
		<li><a href="#get_resource_name_">Get resource name:</a></li>
		<li><a href="#get_time_remaining_until_expiry">Get time remaining until expiry</a></li>
	</ul>

	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#usage_notes">USAGE NOTES</a></li>
	<ul>

		<li><a href="#minting_stamps">Minting stamps</a></li>
		<li><a href="#checking_stamps">Checking stamps</a></li>
		<li><a href="#double_spending_protection">Double Spending Protection</a></li>
		<li><a href="#purging_periodically_vs_on_next_access">Purging Periodically vs on Next Access</a></li>
		<li><a href="#speed_estimates">Speed Estimates</a></li>
		<li><a href="#notes">Notes</a></li>
	</ul>

	<li><a href="#options">OPTIONS</a></li>
	<li><a href="#examples">EXAMPLES</a></li>
	<ul>

		<li><a href="#creating_stamps">Creating stamps</a></li>
		<li><a href="#examining_stamps">Examining Stamps</a></li>
		<li><a href="#verifying_stamps">Verifying Stamps</a></li>
		<li><a href="#double_spending_prevention">Double Spending Prevention</a></li>
		<li><a href="#stamp_expiry">Stamp Expiry</a></li>
		<li><a href="#purging_old_stamps">Purging old stamps</a></li>
		<li><a href="#purging_old_stamps_on_demand">Purging old stamps on Demand</a></li>
	</ul>

	<li><a href="#stamp_format__version_1_">stamp format (version 1)</a></li>
	<li><a href="#files">FILES</a></li>
	<li><a href="#exit_status">EXIT STATUS</a></li>
	<li><a href="#author">AUTHOR</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>hashcash - hashcash anti-spam / denial of service counter-measure tool</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>
</p>
<h2><a name="mint__create__stamps_">Mint (create) stamps:</a></h2>
<p><strong>hashcash</strong> <em>-m</em> [ [ <em>options</em> ] [ <em>resource</em> ... ] ... ]</p>
<p>
</p>
<h2><a name="check_stamps_">Check stamps:</a></h2>
<p><strong>hashcash</strong> <em>-c</em> [ [ <em>options</em> ] <em>-r resource</em> ... ] [ <em>stamp</em> ... ]</p>
<p>
</p>
<h2><a name="speed_estimates_">Speed estimates:</a></h2>
<p><strong>hashcash</strong> <em>-s</em> [ <em>options</em> ] [ <em>-b bits</em> ]</p>
<p>
</p>
<h2><a name="purge_database_">Purge database:</a></h2>
<p><strong>hashcash</strong> <em>-p now</em> [ <em>-j resource</em> ] [ <em>-k</em> ] [ <em>-t time</em> ] [ <em>-u</em> ]</p>
<p>
</p>
<h2><a name="count_collision_bits_">Count collision bits:</a></h2>
<p><strong>hashcash</strong> <em>-w</em> [ <em>options</em> ] [ <em>stamp</em> ... ]</p>
<p>
</p>
<h2><a name="get_resource_name_">Get resource name:</a></h2>
<p><strong>hashcash</strong> <em>-n</em> [ <em>options</em> ] [ <em>stamp</em> ... ]</p>
<p>
</p>
<h2><a name="get_time_remaining_until_expiry">Get time remaining until expiry</a></h2>
<p><strong>hashcash</strong> <em>-l</em> [ <em>options</em> ] <em>-e period</em> [ <em>stamp</em> ... ]</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Hashcash is a denial-of-service counter measure tool.  Its main
current use is to help hashcash users avoid losing email due to
content based and blacklist based anti-spam systems.</p>
<p>The hashcash tool allows you to create hashcash stamps to attach to
emails you send, and to verify hashcash stamps attached to emails you
receive.  Email senders attach hashcash stamps with the X-Hashcash:
header.  Vendors and authors of anti-spam tools are encouraged to
exempt mail sent with hashcash from their blacklists and content based
filtering rules.</p>
<p>A hashcash stamp constitutes a proof-of-work which takes a
parameterizable amount of work to compute for the sender.  The
recipient can verify received stamps efficiently.</p>
<p>The hashcash proof-of-work function is to compute partial hash
collisions (the SHA1 hash function is used).  By choosing the number
of bits of collision, the work required to compute a collision can be
made arbitrarily expensive -- from fractions of a second to minutes or
hours.  The verification is efficient requiring the same small cost
whatever the collision size.</p>
<p>For more detailed discussion of other applications hashcash has been
used for see <a href="http://www.hashcash.org/">http://www.hashcash.org/</a></p>
<p>
</p>
<hr />
<h1><a name="usage_notes">USAGE NOTES</a></h1>
<p>In this man page a resource name is the name of the service or address
the stamp is created for.  In the case of email, the resource name is
the recipient's email address in the form <a href="mailto:user@domain.com.">user@domain.com.</a></p>
<p>
</p>
<h2><a name="minting_stamps">Minting stamps</a></h2>
<p>The <em>-m</em> flag must be given to mint a stamp.</p>
<p>The resource name (recipient's email address) to mint the stamp
against can be passed as an argument, or if omitted is read from
stdin.  If stdin is a tty the user is prompted, if stdin is a pipe the
resource name is just silently read.  The desired collision size can
be specified with the -b option.  If no collision size is specified,
the default is 20 bits.  See also the <em>-b default</em> option.</p>
<p>
</p>
<h2><a name="checking_stamps">Checking stamps</a></h2>
<p>The <em>-c</em> flag must be given to check a stamps expiry.  The stamp to
check can be given as an argument to <code>hashcash</code>.  If no stamp is
given the stamp is read from stdin.  If stdin is a tty the user will
be prompted, if stdin is a pipe the stamp is just silently read.  A
resource name (the recipient's email address) can be given with the
<em>-r</em> option.  If a resource name is given the resource name is
compared to the resource name in the stamp, if they do not match, the
stamp is rejected.</p>
<p>Note: if no resource name is given the stamp is anyway checked to see
if it is otherwise valid, but it could be minted for a different
resource, which would allow stamps to be reused across different
resources, so hashcash will return unchecked exit code on exit.</p>
<p>Stamps are by default considered to be valid for 28 days.  The validity
period can be changed using the <em>-e</em> flag.</p>
<p>If the stamp has expired or has a date in the future the stamp is
rejected and the program exits immediately.</p>
<p>If a required collision size is given with the <em>-b</em> flag, the stamps value
is computed and compared, if the stamp has insufficent value it is rejected,
and the program exits immediately.  If the <em>-b</em> flag is not given, the
stamp is checked to see if it is otherwise valid, but hashcash will return
unchecked exit code on exit.</p>
<p>If the stamp is double spent the stamp is rejected.  Double spending
protection is discussed in more detail below in 
<a href="#double_spending_protection">Double Spending Protection</a>.  If double spending protection is not
enabled, the stamp could be double spent, so hashcash will return
unchecked exit code (exit code 2) on exit.</p>
<p>The <em>-w</em> flag can be used to request that the number of bits of the
collision are counted and displayed. The <em>-n</em> flag can be used to
request that the resource name in the stamp is parsed out and
displayed.  The <em>-l</em> flag can be used to request the number of
seconds until expiry of the stamp is output.</p>
<p>The program will only return exit codes valid or invalid if the <em>-c</em>
flag is used, the <em>-b</em> flag is used, <em>-d</em>, <em>-r resource</em> are used.
These are the minimum set of options necessary to fully check the
validty of a stamp.  If these criteria are not met, the program will
return exit code unchecked (exit code 2) on exit.  (See also the <em>-y</em>
flag.)</p>
<p>
</p>
<h2><a name="double_spending_protection">Double Spending Protection</a></h2>
<p>If the <em>-d</em> flag is used when checking stamps, a database of spent
stamps is kept.</p>
<p>By default stamps expire after 28 days, without expiry the database
would grow indefinately.  You can specify an alternate expiry period
with the <em>-e</em> flag.  The recommended (and default) expiry period for
email is 28 days.  After the expiry period amount of time, the stamp
is anyway considered expired and may be purged from the database to
save space.  (See <a href="#purging_periodically_vs_on_next_access">Purging Periodically vs on Next Access</a> for how to
purge stamps.)</p>
<p>For efficiency reasons a stamp is verified before it is checked in the
database; if it is otherwise invalid no database activity will occur.</p>
<p>Note: The decision about how long the stamp should be considered valid
is up to the verifier.  If it is too short it is possible for some
applications that the stamp will expire before arriving at the
recipient (eg with email.)  The suggested value of 28 days should be
safe for normal email delivery delays.  The choice is a trade-off
between database size and risk of expiry prior to arrival, and depends
on the application.</p>
<p>Note: Different stamps in the same database can have different
validity periods, so for example stamps for different resources with
different validity periods can be stored in the same database, or the
recipient may change the validity period for future stamps without
affecting the validity of old stamps.</p>
<p>
</p>
<h2><a name="purging_periodically_vs_on_next_access">Purging Periodically vs on Next Access</a></h2>
<p>To purge old stamps periodically while checking stamps use the <em>-p
period</em> option to purge no sooner than the given time period since the
last purge.  Purging can be used with the <em>-k</em> option to purge
unexpired stamps also, and with the <em>-j resource</em> flag to purge only
stamps for the given resource.</p>
<p>There are circumstances where it may be inconvenient to purge stamps
on the next access, for example if there is a large double spend
database which takes some time to purge, and the response time of the
hashcash checker is important.  To avoid this problem, purging can be
done separately using just the <em>-p now</em> option to request just the
purge operation.  On unix for example you could call <a href="#item_hashcash__2dp_now"><code>hashcash -p
now</code></a> in a cron job once per day, or on demand when disk was running
low.</p>
<p>
</p>
<h2><a name="speed_estimates">Speed Estimates</a></h2>
<p>The <em>-s</em> flag requests measurement of how many collisions can be
tested per second.  No stamp is minted, or verified.</p>
<p>If the <em>-b</em> flag is used with this option, instead an estimate of how
many seconds it would take to mint a stamp of the given size in bits
is computed.  To find out how much time it will take to mint a default
sized stamp use <em>-s -b default</em>.</p>
<p>
</p>
<h2><a name="notes">Notes</a></h2>
<p>All informational output is printed on stderr.  Minted stamps, and
results of stamp verification and timing are printed on stdout.  The
quiet flag <em>-q</em> suppresses all informational output.  The <em>-v</em> flag
requests more informational output.  The requested output, which is
the only information that is output in quiet mode (when <em>-q</em> is
specified) is printed on standard output.  If stdout is a pipe, or
when quiet mode is in effect the output is printed without description
(ie just bits, just seconds, just resource).</p>
<p>
</p>
<hr />
<h1><a name="options">OPTIONS</a></h1>
<dl>
<dt><strong><a name="item__2dc"><em>-c</em></a></strong><br />
</dt>
<dd>
Check the expiry information of stamps given as an argument or on
stdin.  (Use with <em>-b</em>, <em>-d</em> and <em>-r resource</em> to fully check
stamps).
</dd>
<p></p>
<dt><strong><a name="item__2dm"><em>-m</em></a></strong><br />
</dt>
<dd>
Mint stamps with the resources given as arguments or on stdin.
</dd>
<p></p>
<dt><strong><a name="item__2db_bits"><em>-b bits</em></a></strong><br />
</dt>
<dd>
When minting a stamp, create a collision of at least this many bits.
When verifying a stamp require that it have a collision of at minimum
this many bits, otherwise reject it.  If omitted the default is used.
</dd>
<dd>
<p>When checking stamps, require that the stamps have this many bits.</p>
</dd>
<dd>
<p>The default number of bits can be specified with <em>-b default</em>.  Bits
relative to the default can also be specified with <em>-b +n</em> for n bits
more than the default and <em>-b -n</em> for n bits less than the default.</p>
</dd>
<dd>
<p><em>-b default</em>, <em>-b +0</em> and <em>-b -0</em> are all equivalent.</p>
</dd>
<dd>
<p>When doing the speed test <em>-s</em>, can to measure speed of default
token with <em>-s -b default</em>.</p>
</dd>
<p></p>
<dt><strong><a name="item__2dr_resource"><em>-r resource</em></a></strong><br />
</dt>
<dd>
When minting stamps, the resource name (recipient's email address) to
mint the stamp against can be given either with <em>-r resource</em> or as
an argument to <code>hashcash</code>.
</dd>
<dd>
<p>When checking stamps, the resource name (your own email address) is
given with the <em>-r</em> option.  If the resource name is given it is
checked against the resource name in the stamp, and if they do not
match the stamp is rejected.  Note if the resource name is not given,
stamps for other resources would be accepted, and therefore hashcash
returns exit code unchecked (exit code 2) on exit.</p>
</dd>
<p></p>
<dt><strong><a name="item__2do"><em>-o</em></a></strong><br />
</dt>
<dd>
When verifying stamps multiple resources can be given.  By default the
resources are just checked one by one until a matching valid resource is
found.  However when you use wildcards or regular expressions (see <em>-E</em>),
it is useful to be able to specify that one resource overrides another.  For
example this: <em>-b15 -r <a href="mailto:adam@dev.null">adam@dev.null</a> -o -b10 *@dev.null</em> states that mail
to address <em><a href="mailto:adam@dev.null">adam@dev.null</a></em> requires 15 bits, but mail to <em>*@dev.null</em>
requires only 10 bits.  If we omitted the <em>-o</em> override relationship
between the two resources, a stamp of 10 bits would be accepted for address
<em><a href="mailto:adam@dev.null">adam@dev.null</a></em> because while it would be rejected as having insufficient
bits under the first rule, it would be accepted under the 2nd rule.  The
<em>-o</em> option allows you avoid this problem.
</dd>
<p></p>
<dt><strong><a name="item__2de_time"><em>-e time</em></a></strong><br />
</dt>
<dd>
Expiry period for spent stamps.  While checking stamps (using the <em>-c</em>
flag), if the stamp was minted more than the specified amount of time ago,
it is considered expired.  If this option is not used, by default stamps
expire after 28 days.  The expiry period is given in seconds by default (an
argument of 0 means forever).  A single character suffix can be used to
specify alternate units (m = minutes, h = hours, d = days, M = months, y = Y
= years, and s = seconds).
</dd>
<dd>
<p>If used with the <em>-d</em> option, the spent stamp and its expiry period
is recorded in the database.  See the <em>-p</em> option for description of
how to purge stamps from the database.</p>
</dd>
<dd>
<p>While minting stamps, the <em>-e</em> flag can have an effect on the
resolution of time created in the stamp.  Without the <em>-e</em> option,
the default resolution is days (time format: YYMMDD).  Alternate
formats based on range of expiry period are as follows:</p>
</dd>
<dd>
<p>While minting you can also given an explicit time width with the <em>-z</em>
option instead.  (<em>-z</em> overrides <em>-e</em> if both are given.  If neither
are given the default is 6 chars (time format: YYMMDD)).</p>
</dd>
<dd>
<p>The rules for automatically determining appropriate time width from
<em>-e</em> if no <em>-z</em> option is given are:</p>
</dd>
<ul>
<li><strong><a name="item_period__3e_3d_2_years_then_time_format_yy_is_used_">period &gt;= 2 years then time format YY is used rounded down
to the nearest year start;</a></strong><br />
</li>
<li><strong><a name="item_2_years__3c_period__3c_3d_2_months_then_time_forma">2 years &lt; period &lt;= 2 months then time format YYMM is
used rounded down to the nearest month start;</a></strong><br />
</li>
<li><strong><a name="item_2_months__3c_period__3c_3d_2_days_then_time_format">2 months &lt; period &lt;= 2 days then time format YYMMDD is
used rounded down to the begining of the nearest day;</a></strong><br />
</li>
<li><strong><a name="item_2_days__3c_period__3c_3d_2_minutes_then_time_forma">2 days &lt; period &lt;= 2 minutes then time format
YYMMDDhhmm is used rounded down to the begining of the nearest minute;</a></strong><br />
</li>
<li><strong><a name="item_period__3c_2_minutes_then_time_format_yymmddhhmmss">period &lt; 2 minutes then time format YYMMDDhhmmss is used in
seconds.</a></strong><br />
</li>
</ul>
<p>Note the rounding down is based on UTC time, not local time.  This can
lead to initially suprising results when rounding down to eg days in
time zones other than GMT (UTC = GMT).  It may be clearer to
understand if you use the <em>-u</em> option.</p>
<dt><strong><a name="item__2dz_width"><em>-z width</em></a></strong><br />
</dt>
<dd>
The <em>-z</em> option is for use during minting and allows user choice of
width of time width field.  See also the <em>-e</em> option given in
combination with <em>-m</em> to specify an implicit time field width under
the description of the <em>-e</em> flag.  Valid widths are 6,10 or 12 chars
corresponding respectively to: YYMMDD, YYMMDDhhmm, and YYMMDDhhmmss
rounded down to the nearest day, or minute respectively.
</dd>
<dd>
<p>Note the rounding down is based on UTC time, not local time.  This can
lead to initially suprising results when rounding down to eg days in
time zones other than GMT (UTC = GMT).  It may be clearer to
understand if you use the <em>-u</em> option.</p>
</dd>
<p></p>
<dt><strong><a name="item__2dg_period"><em>-g period</em></a></strong><br />
</dt>
<dd>
The <em>-g</em> option is for use when checking hashcash stamps with the
<em>-c</em> option and specifies a grace period for clock skew, ie if a
hashcash stamp arrives with a date in the future or in the past it
will not be rejected as having a futuristic date (or as being expired)
unless it is more futuristic (or has been expired for longer) than
this period.  The default is 2 days, which means as long as the
sending system's clock is no more than 2 days ahead (or 2 days behind)
of the receiving system's clock, the hashcash stamp will still be
accepted.
</dd>
<dd>
<p>The default units for grace period are seconds.  A single character
suffix can be used to specify alternate units (m = minutes, h = hours,
d = days, M = months, y = Y = years, and s = seconds).</p>
</dd>
<p></p>
<dt><strong><a name="item__2dd"><em>-d</em></a></strong><br />
</dt>
<dd>
Store stamps in a double spend database.  If stamp has been seen
before it will be rejected even if it is otherwise valid.  The default
database file is <em>database.sdb</em> in the current directory.  Only
otherwise valid stamps will be stored in the database.  Only fully
validated stamps will be stored in the database, unless the <em>-y</em>
option is given.
</dd>
<p></p>
<dt><strong><a name="item__2df_dbname"><em>-f dbname</em></a></strong><br />
</dt>
<dd>
Use <em>dbname</em> instead of default filename for double spend database.
</dd>
<p></p>
<dt><strong><a name="item__2dp_period"><em>-p period</em></a></strong><br />
</dt>
<dd>
Purges the database of expired stamps if the given time period has
passed since the last time it was purged.  As a convenience <em>-p now</em>
is equivalent to <em>-p 0</em> both of which mean purge now, regardless of
when the database was last purged.
</dd>
<dd>
<p>If used in combination with <em>-j resource</em> only the stamps minted for
the given resource are purged.</p>
</dd>
<dd>
<p>If used in combination with <em>-k</em> all stamps even un-expired stamps
are purged.  Can be used in combination with <em>-t time</em> to expire as
if the current time were the given time.</p>
</dd>
<p></p>
<dt><strong><a name="item__2dk"><em>-k</em></a></strong><br />
</dt>
<dd>
Use with option <em>-p</em> to request all stamps are purged rather than
just expired ones.
</dd>
<p></p>
<dt><strong><a name="item__2dj_resource"><em>-j resource</em></a></strong><br />
</dt>
<dd>
Use with option <em>-p</em> to request that just stamps matching the given
resource name are to be purged, rather than the default which is to
purge all expired stamps.  If the resource name is the empty string,
all stamps are matched (this is equivalent to omitting the <em>-j</em>
option).
</dd>
<dd>
<p>Note the <em>-E</em>, <em>-M</em> and <em>-S</em> type of match flags also apply to
resources given with the <em>-j resource</em> flag.</p>
</dd>
<p></p>
<dt><strong><a name="item__2ds"><em>-s</em></a></strong><br />
</dt>
<dd>
Print timing information only, and don't proceed to create a stamp.
If combined with <em>-b bits</em> flag print estimate of how long the
requested collision size would take to compute, if <em>-s</em> given by
itself, just prints speed of the collision finder.  To print an
estimate of how long the default number of bits would take use <em>-b
default</em>.
</dd>
<p></p>
<dt><strong><a name="item__2dh"><em>-h</em></a></strong><br />
</dt>
<dd>
Print short usage information.
</dd>
<p></p>
<dt><strong><a name="item__2dv"><em>-v</em></a></strong><br />
</dt>
<dd>
Print more verbose informational output about the stamp minting or
verification.  (If -v is the only argument, prints the tool version
number.)
</dd>
<p></p>
<dt><strong><a name="item__2dv"><em>-V</em></a></strong><br />
</dt>
<dd>
Prints tool version number.
</dd>
<p></p>
<dt><strong><a name="item__2dq"><em>-q</em></a></strong><br />
</dt>
<dd>
Batch mode.  Prints no information other than output.  This option
overrides the <em>-v</em> option.
</dd>
<p></p>
<dt><strong><a name="item__2dx"><em>-X</em></a></strong><br />
</dt>
<dd>
When minting, prints the hashcash email X-header 'X-Hashcash: ' before
the stamp.  Without this option just the bare stamp is printed.
</dd>
<dd>
<p>When checking, after scanning stamps given as arguments, scans stdin
for lines starting with the string 'X-Hashcash:', and uses the rest of
the matching line as the stamp.  Only the lines up to and ending at
the first blank line are scanned (see also <em>-i</em> flag which can be
used to override this).  A blank line is the separator used to
separate the headers from the body of a mail message or USENET
article.  This is meant to make it convenient to pipe a mail message
or USENET article to hashcash on stdin.</p>
</dd>
<p></p>
<dt><strong><a name="item__2dx_extension"><em>-x extension</em></a></strong><br />
</dt>
<dd>
An extension string composed of name value sets.  The extension format
is described below in the section on the hashcash stamp format.  This
allows users to define their own stamp extensions which are hashed
into the stamp, verified by recipients that support them, and ignored
by recipients that don't support them.  Note the extension hook
mechanism has not yet been implemented.  This will come in a
subsequent release.
</dd>
<p></p>
<dt><strong><a name="item__2di"><em>-i</em></a></strong><br />
</dt>
<dd>
When checking and using the <em>-X</em> flag, ignore the blank line
boundary between headers and body of the message, and check for
collision in the body too if one is not found in the headers.
</dd>
<p></p>
<dt><strong><a name="item__2dt_time"><em>-t time</em></a></strong><br />
</dt>
<dd>
Pretend the current time is the time given for purposes of minting
stamps, verifying stamps and purging old stamps from the database.
Time is given in a format based on UTCTIME format
YYMMDD[hhmm[ss]].
</dd>
<dd>
<p>Time is expressed in local time by default.  Use with <em>-u</em> flag to
give time in UTC (GMT).</p>
</dd>
<dd>
<p>You can also give time relative to the current time by prefixing the
argument with + or -.  The default units for relative time are
seconds.  A single character suffix can be used to specify alternate
units (m = minutes, h = hours, d = days, M = months, y = Y = years,
and s = seconds).</p>
</dd>
<dd>
<p>Note: when time is expressed in local time, if there is daylight
savings in your timezone, there are one or two ambiguous hours per
year at the time of change from daylight savings time to normal time.</p>
</dd>
<p></p>
<dt><strong><a name="item__2du"><em>-u</em></a></strong><br />
</dt>
<dd>
Input and output absolute times in UTC (GMT) instead of local time.
</dd>
<p></p>
<dt><strong><a name="item__2da_period"><em>-a period</em></a></strong><br />
</dt>
<dd>
Add (or subtract if number is negative) a random value from the
current time before minting the stamp.  This hides the time the stamp
was created, which may be useful for anonymous users.  Note adding
(rather than subtracting) a random time may be risky if the stamp
takes less than the added time to arrive as the recipient will reject
stamps with time stamps in the future.
</dd>
<p></p>
<dt><strong><a name="item__2dn"><em>-n</em></a></strong><br />
</dt>
<dd>
Print resource name parsed from stamp being verified.  Returns exit
code unchecked on exit.
</dd>
<p></p>
<dt><strong><a name="item__2dl"><em>-l</em></a></strong><br />
</dt>
<dd>
Print number of seconds left before stamp expires.  Returns exit code
unchecked on exit.
</dd>
<dd>
<p>Note: the calculation includes the grace period, so can be up to 2
times grace period longer than you might otherwise expect (clock fast
but system has to presume it could be slow).  If you want to exclude
the grace period add <em>-g0</em> to set grace period to 0 for the
calculation.</p>
</dd>
<p></p>
<dt><strong><a name="item__2dw"><em>-w</em></a></strong><br />
</dt>
<dd>
Print number of bits of collision of stamp.  Returns exit code
unchecked on exit.
</dd>
<p></p>
<dt><strong><a name="item__2dy"><em>-y</em></a></strong><br />
</dt>
<dd>
Returns success if the stamp is valid even if it is not fully checked.
Use with <em>-c</em> where not all of <em>-d</em>, <em>-r</em> are specified to get
success exit code on valid but partially checked stamp.  Similarly can
use with <em>-n</em>, <em>-l</em>, <em>-w</em> with same effect.
</dd>
<p></p>
<dt><strong><a name="item__2dm"><em>-M</em></a></strong><br />
</dt>
<dd>
When checking stamps, allow wildcard <em>*</em> matching in the resource
name to make it simpler to specify multiple email addresses and to
allow matching catch-all addresses and addresses including subdomains.
This is the default.  See also <em>-S</em>, <em>-E</em> and <em>-C</em>
</dd>
<p></p>
<dt><strong><a name="item__2ds"><em>-S</em></a></strong><br />
</dt>
<dd>
When checking stamps use simple text compare to compare resource names
to those in stamps.  See also <em>-M</em>, <em>-E</em> and <em>-C</em>.
</dd>
<p></p>
<dt><strong><a name="item__2de"><em>-E</em></a></strong><br />
</dt>
<dd>
When checking stamps use regular expressions to specify resource names
to make it simpler to specify multiple email addresses, catch-all
addresses, classes of extension addresses and addresses including
subdomains.  Note regular expression syntax is POSIX style: special
characters do not need to be quoted to have their special meaning; but
they do have to be quoted with \ to that character in the searched
string.  The regular expression automatically has ^ added at the
beginning and $ added at the end, if they are not specified.  The
special characters ^ matches the beginning of the resouce, and $
matches the end of resource.
</dd>
<dd>
<p>(Note even if compiled with BSD regular expressions, POSIX style
syntax is used; also note BSD regular expressions do not support
ranges {}.)</p>
</dd>
<p></p>
<dt><strong><a name="item__2dc"><em>-C</em></a></strong><br />
</dt>
<dd>
By default resources are canonicalized to lower case on minting and on
checking.  The <em>-C</em> flag overrides this so that resources are treated
as case sensitive on checking, and not canonizalized on minting.
</dd>
<p></p>
<dt><strong><a name="item__2dp"><em>-P</em></a></strong><br />
</dt>
<dd>
Print progress info (number of iterations, expected iterations,
percentage done, best stamp size found so far).
</dd>
<p></p>
<dt><strong><a name="item__2do_core"><em>-O core</em></a></strong><br />
</dt>
<dd>
Select hashcash core with that number.  Currently 0-9 are valid cores.
Not all cores work on all architectures.  Eg some are x86 specific
assembler, others PPC specific assembler.  If a core is not valid
hashcash returns failure and explains what happened.
</dd>
<p></p>
<dt><strong><a name="item__2dz_n"><em>-Z n</em></a></strong><br />
</dt>
<dd>
Compress the stamp.  This is a time vs space trade off.  Larger stamps
are faster, but arguably slightly ugly.  For fastest stamps (the
default) use -Z 0; for partly compressed stamps use -Z 1; for very
compressed, but somewhat slow stamps use -Z 2.  (Note: due to a late
discovered bug, -Z2 is the same as -Z1 for now until I can fix that.)
</dd>
<p></p></dl>
<p>
</p>
<hr />
<h1><a name="examples">EXAMPLES</a></h1>
<p>
</p>
<h2><a name="creating_stamps">Creating stamps</a></h2>
<dl>
<dt><strong><a name="item_hashcash__2ds"><code>hashcash -s</code></a></strong><br />
</dt>
<dd>
Print timing information about how many collisions the machine can try
per second.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dsv"><code>hashcash -sv</code></a></strong><br />
</dt>
<dd>
More accurate but quite slow benchmarking of different processor
specific minting cores.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2ds__2db_default"><code>hashcash -s -b default</code></a></strong><br />
</dt>
<dd>
Print how long it would take the machine to compute a default sized
collision (but don't actually compute a collision).
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2ds__2db_32"><code>hashcash -s -b 32</code></a></strong><br />
</dt>
<dd>
Print how long it would take the machine to compute a 32 bit collision
(but don't actually compute a collision).
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dm"><code>hashcash -m</code></a></strong><br />
</dt>
<dd>
Mint a stamp.  Will prompt for resource name and mint with default
value (number of collision bits).
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dm_foo"><code>hashcash -m foo</code></a></strong><br />
</dt>
<dd>
Compute collision on resource foo.  Will mint with default value
(number of collision bits).
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dm_foo__2db_10"><code>hashcash -m foo -b 10</code></a></strong><br />
</dt>
<dd>
Compute 10 bit collision on resource foo.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2da__2d3d"><code>hashcash -a -3d</code></a></strong><br />
</dt>
<dd>
Subtract a random time of between 0 days and 3 days from the stamp's
creation time.  This is the same fuzz factor used by mixmaster to
reduce risk of timing-correlations.
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="examining_stamps">Examining Stamps</a></h2>
<dl>
<dt><strong><a name="item_hashcash__2dw_1_3a24_3a040806_3afoo_3a_3a511801694"><code>hashcash -w 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Report the value of the stamp (how many bits of collision) there are.
The example is a 24 bit collision, which takes on average 25 seconds
to create on a 3Ghz P4.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dmq__2db_10_foo__7c_hashcash__2dw"><code>hashcash -mq -b 10 foo | hashcash -w</code></a></strong><br />
</dt>
<dd>
Create a stamp in batch mode, pass to hashcash on stdin to verify,
have it print how many bits there were.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dn_1_3a24_3a040806_3afoo_3a_3a511801694"><code>hashcash -n 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Report the resource name from the stamp.  The resource name in the
example is foo.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dl__2de_30y_1_3a24_3a040806_3afoo_3a_3a"><code>hashcash -l -e 30y 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Report how long until the stamp expires if it expires in 30 years from
its creation date.  (Note dates too far into the future run into the
2038 end of Epoch, which is the unix time analog of the y2k bug).
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="verifying_stamps">Verifying Stamps</a></h2>
<dl>
<dt><strong><a name="item_hashcash__2dc_1_3a24_3a040806_3afoo_3a_3a511801694"><code>hashcash -c 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Check if the stamp is valid.  Note as we are not checking the stamp in
a double spend database, and did not specify a resource name or
required number of bits of collision and hashcash will consider the
stamp not fully checked, and it will report it as valid but not fully
unchecked, or as invalid if there is any problem with the stamp.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dc__2db24_1_3a24_3a040806_3afoo_3a_3a51"><code>hashcash -c -b24 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Check that the value of the stamp is greater or equal to 24 bits.
This example has 24 bit value.  If you increase the requested number
of bits or replace the stamp with one with less than 24 bit collision
the stamp will be rejected.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dc__2db24__2dr_foo_1_3a24_3a040806_3afo"><code>hashcash -c -b24 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
As above check if the stamp has sufficient value, but in addition
check that the resource name given matches the resource name in the
stamp.
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="double_spending_prevention">Double Spending Prevention</a></h2>
<p>The examples given in <a href="#verifying_stamps">Verifying Stamps</a> can be modified to keep a
double spend database so that the same stamp will not be accepted
twice.  Note a stamp will only be checked in and added to the database
if it is otherwise valid and fully checked (a required number of bits
of collision has been specified and a resource has been specified).</p>
<dl>
<dt><strong><a name="item_hashcash__2dcd__2db_10__2dr_foo_1_3a24_3a040806_3a"><code>hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Check the stamp and add to double spent database if it's valid (has
correct resource name and sufficient value).
</dd>
<p></p>
<dt><strong><code>hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></strong><br />
</dt>
<dd>
Try to double spend the stamp.  It will be rejected as double spent.
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="stamp_expiry">Stamp Expiry</a></h2>
<p>To prevent the double spend database growing indefinately, the
recipient can request that stamps be no older than a specified period.
After expiry old stamps can dropped from the double spend database as
they will no longer be needed -- expired stamps can be rejected based
purely on their old date, so the space taken by expired stamps in the
double spend database can be saved without risk of accepting an
expired though otherwise valid stamp.</p>
<p>The third field of the stamp is the UTC time since 1st January 1970.
The default time format is YYMMDD, time rounded down to the nearest
day.  The default validity period is 28 days.</p>
<p>You can provide an alternative validity period with the <em>-e</em> option.</p>
<dl>
<dt><strong><a name="item_hashcash__2dcd__2db_10__2de_2d__2dr_foo_1_3a24_3a0"><code>hashcash -cd -b 10 -e 2d -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></a></strong><br />
</dt>
<dd>
Try verifying an old stamp, the above stamp was created 11 Aug 2002.
</dd>
<dd>
<p>We gave option <em>-e 2d</em> so the stamps expiry date is 2 days after
creation, which is now in the past.</p>
</dd>
<dd>
<p>Note: if the creation time is expressed in the stamp in days, the
precise creation date is the begining of the specified day in UTC time
(similarly for alternate units the creation time is rounded down to
the begining of the unit it is expressed in).  For units in days, for
example, this may mean depending on your time zone that the stamp
appears to be considered invalid in under the specified expiry period
in days relative to your relative view of what day it is, as the
calculation is based on current time in UTC, and the creation time of
the stamp is expressed in UTC time.</p>
</dd>
<p></p>
<dt><strong><code>hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a</code></strong><br />
</dt>
<dd>
Test whether the stamp is otherwise valid, apart from having expired.
Omitting the <em>-e</em> tells hashcash that the stamp will never expire.
An expiry period of forever can also be given explitly like this: <em>-e
0</em>, where an expiry period of 0 means forever.
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="purging_old_stamps">Purging old stamps</a></h2>
<p>If the <em>-c</em>, <em>-d</em> options are used together, each time a stamp is
checked, if it is valid and all of the mandatory aspects of the stamp
are verified (collision bits check, resource name check) then the
stamp and its expiry period is written to the database file.  The
default expiry period if an expiry period is not given explicitly with
the <em>-e</em> option is 28 days (ie stamps expire after 4 weeks).</p>
<p>First mint and then add a stamp:</p>
<dl>
<dt><strong><a name="item_hashcash__2dm__2db_10_foo__2de_1m__3e_stamp"><code>hashcash -m -b 10 foo -e 1m &gt; stamp</code></a></strong><br />
</dt>
<dd>
Note: we specified an expiry on minting in this example, to ensure
that the stamp creation time is given in high enough resolution in the
stamp that the stamp will not be considered expired at time of
creation.  (Recall the default resolution is in days, a stamp created
with a creation time rounded down to the beginging of the day is
unlikely to be considered valid 1 minute later unless you mint it at
midnight UTC time.)
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dcd__2de_1m__2db_10__2dr_foo__3c_stamp"><code>hashcash -cd -e 1m -b 10 -r foo &lt; stamp</code></a></strong><br />
</dt>
<dd>
The stamp expires in 1 minute.  Wait 1 minute and then explicitly
request that expired stamps be purged:
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dp_now"><code>hashcash -p now</code></a></strong><br />
</dt>
<dd>
Then try resubmitting the same stamp:
</dd>
<p></p>
<dt><strong><code>hashcash -cd -e 1m -b 10 -r foo &lt; stamp</code></strong><br />
</dt>
<dd>
and the stamp will be rejected anyway as it has expired, illustrating
why it was not necessary to keep this stamp in the database.
</dd>
<dd>
<p>With the default database (the sdb format) the database contents are
human readable, so you can view their contents by cating them to the
terminal:</p>
</dd>
<p></p>
<dt><strong><a name="item_cat_hashcash_2esdb"><code>cat hashcash.sdb</code></a></strong><br />
</dt>
<dd>
to see that the stamp really is added and then after puring
subsequently purged due to expiry.
</dd>
<p></p></dl>
<p>
</p>
<h2><a name="purging_old_stamps_on_demand">Purging old stamps on Demand</a></h2>
<p>As a convenience you can purge at the same time as checking stamps by
using the <em>-p</em> option with the <em>-c</em> option.</p>
<dl>
<dt><strong><a name="item_hashcash__2dm__2db_10_foo__3e_stamp"><code>hashcash -m -b 10 foo &gt; stamp</code></a></strong><br />
</dt>
<dt><strong><a name="item_hashcash__2dcd__2dp_now__2de_1__2db_10__2dr_foo__3"><code>hashcash -cd -p now -e 1 -b 10 -r foo &lt; stamp</code></a></strong><br />
</dt>
<dd>
It may be inefficient to purge stamps on every use as the entire
database has to be scanned for expired stamps.  By giving a time
period to the <em>-p</em> option, you can tell <code>hashcash</code> to purge no more
frequently than that time period since the previous purge.
</dd>
<dd>
<p>For example:</p>
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dcd__2dp_1d__2de_1__2db_10__2dr_foo__3c"><code>hashcash -cd -p 1d -e 1 -b 10 -r foo &lt; stamp</code></a></strong><br />
</dt>
<dd>
tells <code>hashcash</code> to purge any expired stamps no more than once per
day.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dp_1m__2dj_foo"><code>hashcash -p 1M -j foo</code></a></strong><br />
</dt>
<dd>
tells <code>hashcash</code> to purge only expired stamps matching resource foo
once per month.
</dd>
<p></p>
<dt><strong><a name="item_hashcash__2dp_now__2dk"><code>hashcash -p now -k</code></a></strong><br />
</dt>
<dd>
tells <code>hashcash</code> to purge all stamps (expired and unexpired) now.
</dd>
<p></p></dl>
<p>
</p>
<hr />
<h1><a name="stamp_format__version_1_">stamp format (version 1)</a></h1>
<p>The current stamp format is version 1.  This tool can verify hashcash
version 0 stamps also, but version 0 stamps are no longer created as
they are being phased out in favor of the more extensible v1 stamp
format.</p>
<dl>
<dt><strong><a name="item_ver_3abits_3adate_3aresource_3a_5bext_5d_3arand_3a"><em>ver</em>:<em>bits</em>:<em>date</em>:<em>resource</em>:[<em>ext</em>]:<em>rand</em>:<em>counter</em></a></strong><br />
</dt>
</dl>
<p>where</p>
<dl>
<dt><strong><a name="item_ver__3d_1"><em>ver</em> = 1</a></strong><br />
</dt>
<dt><strong><a name="item_bits__3d_how_many_bits_of_partial_2dcollision_the_"><em>bits</em> = how many bits of partial-collision the stamp is claimed to have</a></strong><br />
</dt>
<dt><strong><a name="item_date__3d_yymmdd_5bhhmm_5bss_5d_5d"><em>date</em> = YYMMDD[hhmm[ss]]</a></strong><br />
</dt>
<dt><strong><a name="item_string"><em>resource</em> = resource string (eg IP address, email address)</a></strong><br />
</dt>
<dt><strong><a name="item_ext__3d_extension__2d_2d_ignored_in_the_current_ve"><em>ext</em> = extension -- ignored in the current version</a></strong><br />
</dt>
<dd>
Format of extension:
</dd>
<dl>
<dt><strong><a name="item__5bname1_5b_3dval1_5b_2cval2_2e_2e_2e_5d_5d_3b_5bn">[name1[=val1[,val2...]];[name2[=val1[,val2...]]...]]</a></strong><br />
</dt>
<dd>
Note the value can also contain =.  Example extension (not a real one):
</dd>
<dd>
<pre>
        name1=2,3;name2;name3=var1=2,var2=3,2,val</pre>
</dd>
<dd>
<p>Which would be extension name1 has values 2 and 3; extension name2 has
no values; extension name3 has 3 values ``var1=2'', ``var2=3'', ``2'' and
``val''.  The hashcash extension may interpret the values as it sees fit
eg ``var1=2'' could be the value of an option to the extension name3.</p>
</dd>
<p></p></dl>
<dt><strong><a name="item_rand__3d_string_of_random_characters_from_alphabet"><em>rand</em> = string of random characters from alphabet
		a-zA-Z0-9+/= to avoid collisions with other sender's
		stamps</a></strong><br />
</dt>
<dt><strong><a name="item_counter__3d_to_find_a_stamp_with_the_desired_numbe"><em>counter</em> = to find a stamp with the desired number of
		   collision bits need to try lots of different strings
                   this counter is incremented on each try.  
		   The Counter is also composed of characters from the
		   alphabet a-zA-Z0-9+/=.  (Note an implementation is
		   not required to count sequentially).</a></strong><br />
</dt>
</dl>
<p>
</p>
<hr />
<h1><a name="files">FILES</a></h1>
<dl>
<dt><strong><a name="item_hashcash_2esdb"><em>hashcash.sdb</em></a></strong><br />
</dt>
<dd>
default double spend database
</dd>
<p></p></dl>
<p>
</p>
<hr />
<h1><a name="exit_status">EXIT STATUS</a></h1>
<p><code>hashcash</code> returns success (exit code 0) after successfully minting a
stamp, after fully checking a stamp and finding it valid, and after a
timing test.</p>
<p>If when checking a stamp it is found to be invalid (due to being
malformed, being expired, having insufficient value, having a date in
the future, or being double spent), <code>hashcash</code> returns failure (exit
code 1).</p>
<p>If insufficient options are given to fully check a stamp, if the stamp
is otherwise valid return unchecked (exit code 2).  If the <em>-y</em> flag
is given and hashcash would normally return unchecked, exit code
success is returned instead.</p>
<p>If any exception occurs (file read failure for database checking or
corrupted database contents) an exit status of 3 is returned.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Written by Adam Back &lt;<a href="mailto:adam@cypherspace.org">adam@cypherspace.org</a>&gt;</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>sha1sum(1), sha1(1), <a href="http://www.hashcash.org/">http://www.hashcash.org/</a></p>

</body>

</html>