Debian Codegraph @

hashcash.1

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 . ds -- \(*W-
36 . ds PI pi
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39 . ds L" ""
40 . ds R" ""
41 . ds C` ""
42 . ds C' ""
43 'br\}
44 .el\{\
45 . ds -- \|\(em\|
46 . ds PI \(*p
47 . ds L" ``
48 . ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 . de IX
57 . tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 . nr % 0
60 . rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
71 .if n \{\
72 . ds #H 0
73 . ds #V .8m
74 . ds #F .3m
75 . ds #[ \f1
76 . ds #] \fP
77 .\}
78 .if t \{\
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 . ds #V .6m
81 . ds #F 0
82 . ds #[ \&
83 . ds #] \&
84 .\}
85 . \" simple accents for nroff and troff
86 .if n \{\
87 . ds ' \&
88 . ds ` \&
89 . ds ^ \&
90 . ds , \&
91 . ds ~ ~
92 . ds /
93 .\}
94 .if t \{\
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 . ds : e
119 . ds 8 ss
120 . ds o a
121 . ds d- d\h'-1'\(ga
122 . ds D- D\h'-1'\(hy
123 . ds th \o'bp'
124 . ds Th \o'LP'
125 . ds ae ae
126 . ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "HASHCASH 1"
132 .TH HASHCASH 1 "2006-04-07" "1.22" "hashcash"
133 .SH "NAME"
134 hashcash \- hashcash anti\-spam / denial of service counter\-measure tool
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 .Sh "Mint (create) stamps:"
138 .IX Subsection "Mint (create) stamps:"
139 \&\fBhashcash\fR \fI\-m\fR [ [ \fIoptions\fR ] [ \fIresource\fR ... ] ... ]
140 .Sh "Check stamps:"
141 .IX Subsection "Check stamps:"
142 \&\fBhashcash\fR \fI\-c\fR [ [ \fIoptions\fR ] \fI\-r resource\fR ... ] [ \fIstamp\fR ... ]
143 .Sh "Speed estimates:"
144 .IX Subsection "Speed estimates:"
145 \&\fBhashcash\fR \fI\-s\fR [ \fIoptions\fR ] [ \fI\-b bits\fR ]
146 .Sh "Purge database:"
147 .IX Subsection "Purge database:"
148 \&\fBhashcash\fR \fI\-p now\fR [ \fI\-j resource\fR ] [ \fI\-k\fR ] [ \fI\-t time\fR ] [ \fI\-u\fR ]
149 .Sh "Count partial preimage bits:"
150 .IX Subsection "Count partial preimage bits:"
151 \&\fBhashcash\fR \fI\-w\fR [ \fIoptions\fR ] [ \fIstamp\fR ... ]
152 .Sh "Get resource name:"
153 .IX Subsection "Get resource name:"
154 \&\fBhashcash\fR \fI\-n\fR [ \fIoptions\fR ] [ \fIstamp\fR ... ]
155 .Sh "Get time remaining until expiry"
156 .IX Subsection "Get time remaining until expiry"
157 \&\fBhashcash\fR \fI\-l\fR [ \fIoptions\fR ] \fI\-e period\fR [ \fIstamp\fR ... ]
158 .SH "DESCRIPTION"
159 .IX Header "DESCRIPTION"
160 Hashcash is a denial-of-service counter measure tool. Its main
161 current use is to help hashcash users avoid losing email due to
162 content based and blacklist based anti-spam systems.
163 .PP
164 The hashcash tool allows you to create hashcash stamps to attach to
165 emails you send, and to verify hashcash stamps attached to emails you
166 receive. Email senders attach hashcash stamps with the X\-Hashcash:
167 header. Vendors and authors of anti-spam tools are encouraged to
168 exempt mail sent with hashcash from their blacklists and content based
169 filtering rules.
170 .PP
171 A hashcash stamp constitutes a proof-of-work which takes a
172 parameterizable amount of work to compute for the sender. The
173 recipient can verify received stamps efficiently. This package also
174 includes a sha1 implementation which is equivalent in functionality to
175 the sha1sum program available on some systems.
176 .PP
177 The hashcash proof-of-work function is to compute partial hash
178 preimages (the \s-1SHA1\s0 hash function is used). By choosing the number of
179 bits of the preimage that are equal to 0, the work required to compute
180 a partial preimage can be made arbitrarily expensive \*(-- from fractions
181 of a second to minutes or hours. The verification is efficient
182 requiring the same small cost whatever the preimage size.
183 .PP
184 For more detailed discussion of other applications hashcash has been
185 used for see http://www.hashcash.org/
186 .SH "USAGE NOTES"
187 .IX Header "USAGE NOTES"
188 In this man page a resource name is the name of the service or address
189 the stamp is created for. In the case of email, the resource name is
190 the recipient's email address in the form [email protected].
191 .Sh "Minting stamps"
192 .IX Subsection "Minting stamps"
193 The \fI\-m\fR flag must be given to mint a stamp.
194 .PP
195 The resource name (recipient's email address) to mint the stamp
196 against can be passed as an argument, or if omitted is read from
197 stdin. If stdin is a tty the user is prompted, if stdin is a pipe the
198 resource name is just silently read. The desired preimage size can
199 be specified with the \-b option. If no preimage size is specified,
200 the default is 20 bits. See also the \fI\-b default\fR option.
201 .Sh "Checking stamps"
202 .IX Subsection "Checking stamps"
203 The \fI\-c\fR flag must be given to check a stamps expiry. The stamp to
204 check can be given as an argument to \f(CW\*(C`hashcash\*(C'\fR. If no stamp is
205 given the stamp is read from stdin. If stdin is a tty the user will
206 be prompted, if stdin is a pipe the stamp is just silently read. A
207 resource name (the recipient's email address) can be given with the
208 \&\fI\-r\fR option. If a resource name is given the resource name is
209 compared to the resource name in the stamp, if they do not match, the
210 stamp is rejected.
211 .PP
212 Note: if no resource name is given the stamp is anyway checked to see
213 if it is otherwise valid, but it could be minted for a different
214 resource, which would allow stamps to be reused across different
215 resources, so hashcash will return unchecked exit code on exit.
216 .PP
217 Stamps are by default considered to be valid for 28 days. The validity
218 period can be changed using the \fI\-e\fR flag.
219 .PP
220 If the stamp has expired or has a date in the future the stamp is
221 rejected and the program exits immediately.
222 .PP
223 If a required preimage size is given with the \fI\-b\fR flag, the stamps value
224 is computed and compared, if the stamp has insufficent value it is rejected,
225 and the program exits immediately. If the \fI\-b\fR flag is not given, the
226 stamp is checked to see if it is otherwise valid, but hashcash will return
227 unchecked exit code on exit.
228 .PP
229 If the stamp is double spent the stamp is rejected. Double spending
230 protection is discussed in more detail below in
231 \&\*(L"Double Spending Protection\*(R". If double spending protection is not
232 enabled, the stamp could be double spent, so hashcash will return
233 unchecked exit code (exit code 2) on exit.
234 .PP
235 The \fI\-w\fR flag can be used to request that the number of bits of the
236 preimage are counted and displayed. The \fI\-n\fR flag can be used to
237 request that the resource name in the stamp is parsed out and
238 displayed. The \fI\-l\fR flag can be used to request the number of
239 seconds until expiry of the stamp is output.
240 .PP
241 The program will only return exit codes valid or invalid if the \fI\-c\fR
242 flag is used, the \fI\-b\fR flag is used, \fI\-d\fR, \fI\-r resource\fR are used.
243 These are the minimum set of options necessary to fully check the
244 validty of a stamp. If these criteria are not met, the program will
245 return exit code unchecked (exit code 2) on exit. (See also the \fI\-y\fR
246 flag.)
247 .Sh "Double Spending Protection"
248 .IX Subsection "Double Spending Protection"
249 If the \fI\-d\fR flag is used when checking stamps, a database of spent
250 stamps is kept.
251 .PP
252 By default stamps expire after 28 days, without expiry the database
253 would grow indefinately. You can specify an alternate expiry period
254 with the \fI\-e\fR flag. The recommended (and default) expiry period for
255 email is 28 days. After the expiry period amount of time, the stamp
256 is anyway considered expired and may be purged from the database to
257 save space. (See \*(L"Purging Periodically vs on Next Access\*(R" for how to
258 purge stamps.)
259 .PP
260 For efficiency reasons a stamp is verified before it is checked in the
261 database; if it is otherwise invalid no database activity will occur.
262 .PP
263 Note: The decision about how long the stamp should be considered valid
264 is up to the verifier. If it is too short it is possible for some
265 applications that the stamp will expire before arriving at the
266 recipient (eg with email.) The suggested value of 28 days should be
267 safe for normal email delivery delays. The choice is a trade-off
268 between database size and risk of expiry prior to arrival, and depends
269 on the application.
270 .PP
271 Note: Different stamps in the same database can have different
272 validity periods, so for example stamps for different resources with
273 different validity periods can be stored in the same database, or the
274 recipient may change the validity period for future stamps without
275 affecting the validity of old stamps.
276 .Sh "Purging Periodically vs on Next Access"
277 .IX Subsection "Purging Periodically vs on Next Access"
278 To purge old stamps periodically while checking stamps use the \fI\-p
279 period\fR option to purge no sooner than the given time period since the
280 last purge. Purging can be used with the \fI\-k\fR option to purge
281 unexpired stamps also, and with the \fI\-j resource\fR flag to purge only
282 stamps for the given resource.
283 .PP
284 There are circumstances where it may be inconvenient to purge stamps
285 on the next access, for example if there is a large double spend
286 database which takes some time to purge, and the response time of the
287 hashcash checker is important. To avoid this problem, purging can be
288 done separately using just the \fI\-p now\fR option to request just the
289 purge operation. On unix for example you could call \f(CW\*(C`hashcash \-p
290 now\*(C'\fR in a cron job once per day, or on demand when disk was running
291 low.
292 .Sh "Speed Estimates"
293 .IX Subsection "Speed Estimates"
294 The \fI\-s\fR flag requests measurement of how many preimage can be
295 tested per second. No stamp is minted, or verified.
296 .PP
297 If the \fI\-b\fR flag is used with this option, instead an estimate of how
298 many seconds it would take to mint a stamp of the given size in bits
299 is computed. To find out how much time it will take to mint a default
300 sized stamp use \fI\-s \-b default\fR.
301 .Sh "Notes"
302 .IX Subsection "Notes"
303 All informational output is printed on stderr. Minted stamps, and
304 results of stamp verification and timing are printed on stdout. The
305 quiet flag \fI\-q\fR suppresses all informational output. The \fI\-v\fR flag
306 requests more informational output. The requested output, which is
307 the only information that is output in quiet mode (when \fI\-q\fR is
308 specified) is printed on standard output. If stdout is a pipe, or
309 when quiet mode is in effect the output is printed without description
310 (ie just bits, just seconds, just resource).
311 .SH "OPTIONS"
312 .IX Header "OPTIONS"
313 .IP "\fI\-c\fR" 4
314 .IX Item "-c"
315 Check the expiry information of stamps given as an argument or on
316 stdin. (Use with \fI\-b\fR, \fI\-d\fR and \fI\-r resource\fR to fully check
317 stamps).
318 .IP "\fI\-m\fR" 4
319 .IX Item "-m"
320 Mint stamps with the resources given as arguments or on stdin.
321 .IP "\fI\-b bits\fR" 4
322 .IX Item "-b bits"
323 When minting a stamp, create a preimage of at least this many bits.
324 When verifying a stamp require that it have a preimage of at minimum
325 this many bits, otherwise reject it. If omitted the default is used.
326 .Sp
327 When checking stamps, require that the stamps have this many bits.
328 .Sp
329 The default number of bits can be specified with \fI\-b default\fR. Bits
330 relative to the default can also be specified with \fI\-b +n\fR for n bits
331 more than the default and \fI\-b \-n\fR for n bits less than the default.
332 .Sp
333 \&\fI\-b default\fR, \fI\-b +0\fR and \fI\-b \-0\fR are all equivalent.
334 .Sp
335 When doing the speed test \fI\-s\fR, can to measure speed of default
336 token with \fI\-s \-b default\fR.
337 .IP "\fI\-r resource\fR" 4
338 .IX Item "-r resource"
339 When minting stamps, the resource name (recipient's email address) to
340 mint the stamp against can be given either with \fI\-r resource\fR or as
341 an argument to \f(CW\*(C`hashcash\*(C'\fR.
342 .Sp
343 When checking stamps, the resource name (your own email address) is
344 given with the \fI\-r\fR option. If the resource name is given it is
345 checked against the resource name in the stamp, and if they do not
346 match the stamp is rejected. Note if the resource name is not given,
347 stamps for other resources would be accepted, and therefore hashcash
348 returns exit code unchecked (exit code 2) on exit.
349 .IP "\fI\-o\fR" 4
350 .IX Item "-o"
351 When verifying stamps multiple resources can be given. By default the
352 resources are just checked one by one until a matching valid resource is
353 found. However when you use wildcards or regular expressions (see \fI\-E\fR),
354 it is useful to be able to specify that one resource overrides another. For
355 example this: \fI\-b15 \-r [email protected] \-o \-b10 *@dev.null\fR states that mail
356 to address \[email protected]\fR requires 15 bits, but mail to \fI*@dev.null\fR
357 requires only 10 bits. If we omitted the \fI\-o\fR override relationship
358 between the two resources, a stamp of 10 bits would be accepted for address
359 \&\[email protected]\fR because while it would be rejected as having insufficient
360 bits under the first rule, it would be accepted under the 2nd rule. The
361 \&\fI\-o\fR option allows you avoid this problem.
362 .IP "\fI\-e time\fR" 4
363 .IX Item "-e time"
364 Expiry period for spent stamps. While checking stamps (using the \fI\-c\fR
365 flag), if the stamp was minted more than the specified amount of time ago,
366 it is considered expired. If this option is not used, by default stamps
367 expire after 28 days. The expiry period is given in seconds by default (an
368 argument of 0 means forever). A single character suffix can be used to
369 specify alternate units (m = minutes, h = hours, d = days, M = months, y = Y
370 = years, and s = seconds).
371 .Sp
372 If used with the \fI\-d\fR option, the spent stamp and its expiry period
373 is recorded in the database. See the \fI\-p\fR option for description of
374 how to purge stamps from the database.
375 .Sp
376 While minting stamps, the \fI\-e\fR flag can have an effect on the
377 resolution of time created in the stamp. Without the \fI\-e\fR option,
378 the default resolution is days (time format: \s-1YYMMDD\s0). Alternate
379 formats based on range of expiry period are as follows:
380 .Sp
381 While minting you can also given an explicit time width with the \fI\-z\fR
382 option instead. (\fI\-z\fR overrides \fI\-e\fR if both are given. If neither
383 are given the default is 6 chars (time format: \s-1YYMMDD\s0)).
384 .Sp
385 The rules for automatically determining appropriate time width from
386 \&\fI\-e\fR if no \fI\-z\fR option is given are:
387 .RS 4
388 .IP "* period >= 2 years then time format \s-1YY\s0 is used rounded down to the nearest year start;" 8
389 .IX Item "period >= 2 years then time format YY is used rounded down to the nearest year start;"
390 .PD 0
391 .IP "* 2 years < period <= 2 months then time format \s-1YYMM\s0 is used rounded down to the nearest month start;" 8
392 .IX Item "2 years < period <= 2 months then time format YYMM is used rounded down to the nearest month start;"
393 .IP "* 2 months < period <= 2 days then time format \s-1YYMMDD\s0 is used rounded down to the begining of the nearest day;" 8
394 .IX Item "2 months < period <= 2 days then time format YYMMDD is used rounded down to the begining of the nearest day;"
395 .IP "* 2 days < period <= 2 minutes then time format YYMMDDhhmm is used rounded down to the begining of the nearest minute;" 8
396 .IX Item "2 days < period <= 2 minutes then time format YYMMDDhhmm is used rounded down to the begining of the nearest minute;"
397 .IP "* period < 2 minutes then time format YYMMDDhhmmss is used in seconds." 8
398 .IX Item "period < 2 minutes then time format YYMMDDhhmmss is used in seconds."
399 .RE
400 .RS 4
401 .PD
402 .Sp
403 Note the rounding down is based on \s-1UTC\s0 time, not local time. This can
404 lead to initially suprising results when rounding down to eg days in
405 time zones other than \s-1GMT\s0 (\s-1UTC\s0 = \s-1GMT\s0). It may be clearer to
406 understand if you use the \fI\-u\fR option.
407 .RE
408 .IP "\fI\-z width\fR" 4
409 .IX Item "-z width"
410 The \fI\-z\fR option is for use during minting and allows user choice of
411 width of time width field. See also the \fI\-e\fR option given in
412 combination with \fI\-m\fR to specify an implicit time field width under
413 the description of the \fI\-e\fR flag. Valid widths are 6,10 or 12 chars
414 corresponding respectively to: \s-1YYMMDD\s0, YYMMDDhhmm, and YYMMDDhhmmss
415 rounded down to the nearest day, or minute respectively.
416 .Sp
417 Note the rounding down is based on \s-1UTC\s0 time, not local time. This can
418 lead to initially suprising results when rounding down to eg days in
419 time zones other than \s-1GMT\s0 (\s-1UTC\s0 = \s-1GMT\s0). It may be clearer to
420 understand if you use the \fI\-u\fR option.
421 .IP "\fI\-g period\fR" 4
422 .IX Item "-g period"
423 The \fI\-g\fR option is for use when checking hashcash stamps with the
424 \&\fI\-c\fR option and specifies a grace period for clock skew, ie if a
425 hashcash stamp arrives with a date in the future or in the past it
426 will not be rejected as having a futuristic date (or as being expired)
427 unless it is more futuristic (or has been expired for longer) than
428 this period. The default is 2 days, which means as long as the
429 sending system's clock is no more than 2 days ahead (or 2 days behind)
430 of the receiving system's clock, the hashcash stamp will still be
431 accepted.
432 .Sp
433 The default units for grace period are seconds. A single character
434 suffix can be used to specify alternate units (m = minutes, h = hours,
435 d = days, M = months, y = Y = years, and s = seconds).
436 .IP "\fI\-d\fR" 4
437 .IX Item "-d"
438 Store stamps in a double spend database. If stamp has been seen
439 before it will be rejected even if it is otherwise valid. The default
440 database file is \fIdatabase.sdb\fR in the current directory. Only
441 otherwise valid stamps will be stored in the database. Only fully
442 validated stamps will be stored in the database, unless the \fI\-y\fR
443 option is given.
444 .IP "\fI\-f dbname\fR" 4
445 .IX Item "-f dbname"
446 Use \fIdbname\fR instead of default filename for double spend database.
447 .IP "\fI\-p period\fR" 4
448 .IX Item "-p period"
449 Purges the database of expired stamps if the given time period has
450 passed since the last time it was purged. As a convenience \fI\-p now\fR
451 is equivalent to \fI\-p 0\fR both of which mean purge now, regardless of
452 when the database was last purged.
453 .Sp
454 If used in combination with \fI\-j resource\fR only the stamps minted for
455 the given resource are purged.
456 .Sp
457 If used in combination with \fI\-k\fR all stamps even un-expired stamps
458 are purged. Can be used in combination with \fI\-t time\fR to expire as
459 if the current time were the given time.
460 .IP "\fI\-k\fR" 4
461 .IX Item "-k"
462 Use with option \fI\-p\fR to request all stamps are purged rather than
463 just expired ones.
464 .IP "\fI\-j resource\fR" 4
465 .IX Item "-j resource"
466 Use with option \fI\-p\fR to request that just stamps matching the given
467 resource name are to be purged, rather than the default which is to
468 purge all expired stamps. If the resource name is the empty string,
469 all stamps are matched (this is equivalent to omitting the \fI\-j\fR
470 option).
471 .Sp
472 Note the \fI\-E\fR, \fI\-M\fR and \fI\-S\fR type of match flags also apply to
473 resources given with the \fI\-j resource\fR flag.
474 .IP "\fI\-s\fR" 4
475 .IX Item "-s"
476 Print timing information only, and don't proceed to create a stamp.
477 If combined with \fI\-b bits\fR flag print estimate of how long the
478 requested preimage size would take to compute, if \fI\-s\fR given by
479 itself, just prints speed of the preimage finder. To print an
480 estimate of how long the default number of bits would take use \fI\-b
481 default\fR.
482 .IP "\fI\-h\fR" 4
483 .IX Item "-h"
484 Print short usage information.
485 .IP "\fI\-v\fR" 4
486 .IX Item "-v"
487 Print more verbose informational output about the stamp minting or
488 verification. (If \-v is the only argument, prints the tool version
489 number.)
490 .IP "\fI\-V\fR" 4
491 .IX Item "-V"
492 Prints tool version number.
493 .IP "\fI\-q\fR" 4
494 .IX Item "-q"
495 Batch mode. Prints no information other than output. This option
496 overrides the \fI\-v\fR option.
497 .IP "\fI\-X\fR" 4
498 .IX Item "-X"
499 When minting, prints the hashcash email X\-header 'X\-Hashcash: ' before
500 the stamp. Without this option just the bare stamp is printed.
501 .Sp
502 When checking, after scanning stamps given as arguments, scans stdin
503 for lines starting with the string 'X\-Hashcash:', and uses the rest of
504 the matching line as the stamp. Only the lines up to and ending at
505 the first blank line are scanned (see also \fI\-i\fR flag which can be
506 used to override this). A blank line is the separator used to
507 separate the headers from the body of a mail message or \s-1USENET\s0
508 article. This is meant to make it convenient to pipe a mail message
509 or \s-1USENET\s0 article to hashcash on stdin.
510 .IP "\fI\-x extension\fR" 4
511 .IX Item "-x extension"
512 An extension string composed of name value sets. The extension format
513 is described below in the section on the hashcash stamp format. This
514 allows users to define their own stamp extensions which are hashed
515 into the stamp, verified by recipients that support them, and ignored
516 by recipients that don't support them. Note the extension hook
517 mechanism has not yet been implemented. This will come in a
518 subsequent release.
519 .IP "\fI\-i\fR" 4
520 .IX Item "-i"
521 When checking and using the \fI\-X\fR flag, ignore the blank line
522 boundary between headers and body of the message, and check for
523 stamps in the body too if one is not found in the headers.
524 .IP "\fI\-t time\fR" 4
525 .IX Item "-t time"
526 Pretend the current time is the time given for purposes of minting
527 stamps, verifying stamps and purging old stamps from the database.
528 Time is given in a format based on \s-1UTCTIME\s0 format
529 YYMMDD[hhmm[ss]].
530 .Sp
531 Time is expressed in local time by default. Use with \fI\-u\fR flag to
532 give time in \s-1UTC\s0 (\s-1GMT\s0).
533 .Sp
534 You can also give time relative to the current time by prefixing the
535 argument with + or \-. The default units for relative time are
536 seconds. A single character suffix can be used to specify alternate
537 units (m = minutes, h = hours, d = days, M = months, y = Y = years,
538 and s = seconds).
539 .Sp
540 Note: when time is expressed in local time, if there is daylight
541 savings in your timezone, there are one or two ambiguous hours per
542 year at the time of change from daylight savings time to normal time.
543 .IP "\fI\-u\fR" 4
544 .IX Item "-u"
545 Input and output absolute times in \s-1UTC\s0 (\s-1GMT\s0) instead of local time.
546 .IP "\fI\-a period\fR" 4
547 .IX Item "-a period"
548 Add (or subtract if number is negative) a random value from the
549 current time before minting the stamp. This hides the time the stamp
550 was created, which may be useful for anonymous users. Note adding
551 (rather than subtracting) a random time may be risky if the stamp
552 takes less than the added time to arrive as the recipient will reject
553 stamps with time stamps in the future.
554 .IP "\fI\-n\fR" 4
555 .IX Item "-n"
556 Print resource name parsed from stamp being verified. Returns exit
557 code unchecked on exit.
558 .IP "\fI\-l\fR" 4
559 .IX Item "-l"
560 Print number of seconds left before stamp expires. Returns exit code
561 unchecked on exit.
562 .Sp
563 Note: the calculation includes the grace period, so can be up to 2
564 times grace period longer than you might otherwise expect (clock fast
565 but system has to presume it could be slow). If you want to exclude
566 the grace period add \fI\-g0\fR to set grace period to 0 for the
567 calculation.
568 .IP "\fI\-w\fR" 4
569 .IX Item "-w"
570 Print number of bits of preimage of stamp. Returns exit code
571 unchecked on exit.
572 .IP "\fI\-y\fR" 4
573 .IX Item "-y"
574 Returns success if the stamp is valid even if it is not fully checked.
575 Use with \fI\-c\fR where not all of \fI\-d\fR, \fI\-r\fR are specified to get
576 success exit code on valid but partially checked stamp. Similarly can
577 use with \fI\-n\fR, \fI\-l\fR, \fI\-w\fR with same effect.
578 .IP "\fI\-M\fR" 4
579 .IX Item "-M"
580 When checking stamps, allow wildcard \fI*\fR matching in the resource
581 name to make it simpler to specify multiple email addresses and to
582 allow matching catch-all addresses and addresses including subdomains.
583 This is the default. See also \fI\-S\fR, \fI\-E\fR and \fI\-C\fR
584 .IP "\fI\-S\fR" 4
585 .IX Item "-S"
586 When checking stamps use simple text compare to compare resource names
587 to those in stamps. See also \fI\-M\fR, \fI\-E\fR and \fI\-C\fR.
588 .IP "\fI\-E\fR" 4
589 .IX Item "-E"
590 When checking stamps use regular expressions to specify resource names
591 to make it simpler to specify multiple email addresses, catch-all
592 addresses, classes of extension addresses and addresses including
593 subdomains. Note regular expression syntax is \s-1POSIX\s0 style: special
594 characters do not need to be quoted to have their special meaning; but
595 they do have to be quoted with \e to that character in the searched
596 string. The regular expression automatically has ^ added at the
597 beginning and $ added at the end, if they are not specified. The
598 special characters ^ matches the beginning of the resouce, and $
599 matches the end of resource.
600 .Sp
601 (Note even if compiled with \s-1BSD\s0 regular expressions, \s-1POSIX\s0 style
602 syntax is used; also note \s-1BSD\s0 regular expressions do not support
603 ranges {}.)
604 .IP "\fI\-C\fR" 4
605 .IX Item "-C"
606 By default resources are canonicalized to lower case on minting and on
607 checking. The \fI\-C\fR flag overrides this so that resources are treated
608 as case sensitive on checking, and not canonizalized on minting.
609 .IP "\fI\-P\fR" 4
610 .IX Item "-P"
611 Print progress info (number of iterations, expected iterations,
612 percentage done, best stamp size found so far).
613 .IP "\fI\-O core\fR" 4
614 .IX Item "-O core"
615 Select hashcash core with that number. Currently 0\-9 are valid cores.
616 Not all cores work on all architectures. Eg some are x86 specific
617 assembler, others \s-1PPC\s0 specific assembler. If a core is not valid
618 hashcash returns failure and explains what happened.
619 .IP "\fI\-Z n\fR" 4
620 .IX Item "-Z n"
621 Compress the stamp. This is a time vs space trade off. Larger stamps
622 are faster, but arguably slightly ugly. For fastest stamps (the
623 default) use \-Z 0; for partly compressed stamps use \-Z 1; for very
624 compressed, but somewhat slow stamps use \-Z 2. (Note: due to a late
625 discovered bug, \-Z2 is the same as \-Z1 for now until I can fix that.)
626 .SH "EXAMPLES"
627 .IX Header "EXAMPLES"
628 .Sh "Creating stamps"
629 .IX Subsection "Creating stamps"
630 .ie n .IP """hashcash \-s""" 4
631 .el .IP "\f(CWhashcash \-s\fR" 4
632 .IX Item "hashcash -s"
633 Print timing information about how many preimages the machine can try
634 per second.
635 .ie n .IP """hashcash \-sv""" 4
636 .el .IP "\f(CWhashcash \-sv\fR" 4
637 .IX Item "hashcash -sv"
638 More accurate but quite slow benchmarking of different processor
639 specific minting cores.
640 .ie n .IP """hashcash \-s \-b default""" 4
641 .el .IP "\f(CWhashcash \-s \-b default\fR" 4
642 .IX Item "hashcash -s -b default"
643 Print how long it would take the machine to compute a default sized
644 preimage (but don't actually compute a preimage).
645 .ie n .IP """hashcash \-s \-b 32""" 4
646 .el .IP "\f(CWhashcash \-s \-b 32\fR" 4
647 .IX Item "hashcash -s -b 32"
648 Print how long it would take the machine to compute a 32 bit preimage
649 (but don't actually compute a preimage).
650 .ie n .IP """hashcash \-m""" 4
651 .el .IP "\f(CWhashcash \-m\fR" 4
652 .IX Item "hashcash -m"
653 Mint a stamp. Will prompt for resource name and mint with default
654 value (number of preimage bits).
655 .ie n .IP """hashcash \-m foo""" 4
656 .el .IP "\f(CWhashcash \-m foo\fR" 4
657 .IX Item "hashcash -m foo"
658 Compute preimage on resource foo. Will mint with default value
659 (number of preimage bits).
660 .ie n .IP """hashcash \-m foo \-b 10""" 4
661 .el .IP "\f(CWhashcash \-m foo \-b 10\fR" 4
662 .IX Item "hashcash -m foo -b 10"
663 Compute 10 bit preimage on resource foo.
664 .ie n .IP """hashcash \-a \-3d""" 4
665 .el .IP "\f(CWhashcash \-a \-3d\fR" 4
666 .IX Item "hashcash -a -3d"
667 Subtract a random time of between 0 days and 3 days from the stamp's
668 creation time. This is the same fuzz factor used by mixmaster to
669 reduce risk of timing\-correlations.
670 .Sh "Examining Stamps"
671 .IX Subsection "Examining Stamps"
672 .ie n .IP """hashcash \-w 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
673 .el .IP "\f(CWhashcash \-w 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
674 .IX Item "hashcash -w 1:24:040806:foo::511801694b4cd6b0:1e7297a"
675 Report the value of the stamp (how many bits of preimage) there are.
676 The example is a 24 bit preimage, which takes on average 25 seconds
677 to create on a 3Ghz P4.
678 .ie n .IP """hashcash \-mq \-b 10 foo | hashcash \-w""" 4
679 .el .IP "\f(CWhashcash \-mq \-b 10 foo | hashcash \-w\fR" 4
680 .IX Item "hashcash -mq -b 10 foo | hashcash -w"
681 Create a stamp in batch mode, pass to hashcash on stdin to verify,
682 have it print how many bits there were.
683 .ie n .IP """hashcash \-n 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
684 .el .IP "\f(CWhashcash \-n 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
685 .IX Item "hashcash -n 1:24:040806:foo::511801694b4cd6b0:1e7297a"
686 Report the resource name from the stamp. The resource name in the
687 example is foo.
688 .ie n .IP """hashcash \-l \-e 30y 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
689 .el .IP "\f(CWhashcash \-l \-e 30y 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
690 .IX Item "hashcash -l -e 30y 1:24:040806:foo::511801694b4cd6b0:1e7297a"
691 Report how long until the stamp expires if it expires in 30 years from
692 its creation date. (Note dates too far into the future run into the
693 2038 end of Epoch, which is the unix time analog of the y2k bug).
694 .Sh "Verifying Stamps"
695 .IX Subsection "Verifying Stamps"
696 .ie n .IP """hashcash \-c 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
697 .el .IP "\f(CWhashcash \-c 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
698 .IX Item "hashcash -c 1:24:040806:foo::511801694b4cd6b0:1e7297a"
699 Check if the stamp is valid. Note as we are not checking the stamp in
700 a double spend database, and did not specify a resource name or
701 required number of bits of preimage and hashcash will consider the
702 stamp not fully checked, and it will report it as valid but not fully
703 unchecked, or as invalid if there is any problem with the stamp.
704 .ie n .IP """hashcash \-c \-b24 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
705 .el .IP "\f(CWhashcash \-c \-b24 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
706 .IX Item "hashcash -c -b24 1:24:040806:foo::511801694b4cd6b0:1e7297a"
707 Check that the value of the stamp is greater or equal to 24 bits.
708 This example has 24 bit value. If you increase the requested number
709 of bits or replace the stamp with one with less than 24 bit preimage
710 the stamp will be rejected.
711 .ie n .IP """hashcash \-c \-b24 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
712 .el .IP "\f(CWhashcash \-c \-b24 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
713 .IX Item "hashcash -c -b24 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a"
714 As above check if the stamp has sufficient value, but in addition
715 check that the resource name given matches the resource name in the
716 stamp.
717 .Sh "Double Spending Prevention"
718 .IX Subsection "Double Spending Prevention"
719 The examples given in \*(L"Verifying Stamps\*(R" can be modified to keep a
720 double spend database so that the same stamp will not be accepted
721 twice. Note a stamp will only be checked in and added to the database
722 if it is otherwise valid and fully checked (a required number of bits
723 of preimage has been specified and a resource has been specified).
724 .ie n .IP """hashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
725 .el .IP "\f(CWhashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
726 .IX Item "hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a"
727 Check the stamp and add to double spent database if it's valid (has
728 correct resource name and sufficient value).
729 .ie n .IP """hashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
730 .el .IP "\f(CWhashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
731 .IX Item "hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a"
732 Try to double spend the stamp. It will be rejected as double spent.
733 .Sh "Stamp Expiry"
734 .IX Subsection "Stamp Expiry"
735 To prevent the double spend database growing indefinately, the
736 recipient can request that stamps be no older than a specified period.
737 After expiry old stamps can dropped from the double spend database as
738 they will no longer be needed \*(-- expired stamps can be rejected based
739 purely on their old date, so the space taken by expired stamps in the
740 double spend database can be saved without risk of accepting an
741 expired though otherwise valid stamp.
742 .PP
743 The third field of the stamp is the \s-1UTC\s0 time since 1st January 1970.
744 The default time format is \s-1YYMMDD\s0, time rounded down to the nearest
745 day. The default validity period is 28 days.
746 .PP
747 You can provide an alternative validity period with the \fI\-e\fR option.
748 .ie n .IP """hashcash \-cd \-b 10 \-e 2d \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
749 .el .IP "\f(CWhashcash \-cd \-b 10 \-e 2d \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
750 .IX Item "hashcash -cd -b 10 -e 2d -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a"
751 Try verifying an old stamp, the above stamp was created 11 Aug 2002.
752 .Sp
753 We gave option \fI\-e 2d\fR so the stamps expiry date is 2 days after
754 creation, which is now in the past.
755 .Sp
756 Note: if the creation time is expressed in the stamp in days, the
757 precise creation date is the begining of the specified day in \s-1UTC\s0 time
758 (similarly for alternate units the creation time is rounded down to
759 the begining of the unit it is expressed in). For units in days, for
760 example, this may mean depending on your time zone that the stamp
761 appears to be considered invalid in under the specified expiry period
762 in days relative to your relative view of what day it is, as the
763 calculation is based on current time in \s-1UTC\s0, and the creation time of
764 the stamp is expressed in \s-1UTC\s0 time.
765 .ie n .IP """hashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a""" 4
766 .el .IP "\f(CWhashcash \-cd \-b 10 \-r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a\fR" 4
767 .IX Item "hashcash -cd -b 10 -r foo 1:24:040806:foo::511801694b4cd6b0:1e7297a"
768 Test whether the stamp is otherwise valid, apart from having expired.
769 Omitting the \fI\-e\fR tells hashcash that the stamp will never expire.
770 An expiry period of forever can also be given explitly like this: \fI\-e
771 0\fR, where an expiry period of 0 means forever.
772 .Sh "Purging old stamps"
773 .IX Subsection "Purging old stamps"
774 If the \fI\-c\fR, \fI\-d\fR options are used together, each time a stamp is
775 checked, if it is valid and all of the mandatory aspects of the stamp
776 are verified (preimage bits check, resource name check) then the
777 stamp and its expiry period is written to the database file. The
778 default expiry period if an expiry period is not given explicitly with
779 the \fI\-e\fR option is 28 days (ie stamps expire after 4 weeks).
780 .PP
781 First mint and then add a stamp:
782 .ie n .IP """hashcash \-m \-b 10 foo \-e 1m > stamp""" 4
783 .el .IP "\f(CWhashcash \-m \-b 10 foo \-e 1m > stamp\fR" 4
784 .IX Item "hashcash -m -b 10 foo -e 1m > stamp"
785 Note: we specified an expiry on minting in this example, to ensure
786 that the stamp creation time is given in high enough resolution in the
787 stamp that the stamp will not be considered expired at time of
788 creation. (Recall the default resolution is in days, a stamp created
789 with a creation time rounded down to the beginging of the day is
790 unlikely to be considered valid 1 minute later unless you mint it at
791 midnight \s-1UTC\s0 time.)
792 .ie n .IP """hashcash \-cd \-e 1m \-b 10 \-r foo < stamp""" 4
793 .el .IP "\f(CWhashcash \-cd \-e 1m \-b 10 \-r foo < stamp\fR" 4
794 .IX Item "hashcash -cd -e 1m -b 10 -r foo < stamp"
795 The stamp expires in 1 minute. Wait 1 minute and then explicitly
796 request that expired stamps be purged:
797 .ie n .IP """hashcash \-p now""" 4
798 .el .IP "\f(CWhashcash \-p now\fR" 4
799 .IX Item "hashcash -p now"
800 Then try resubmitting the same stamp:
801 .ie n .IP """hashcash \-cd \-e 1m \-b 10 \-r foo < stamp""" 4
802 .el .IP "\f(CWhashcash \-cd \-e 1m \-b 10 \-r foo < stamp\fR" 4
803 .IX Item "hashcash -cd -e 1m -b 10 -r foo < stamp"
804 and the stamp will be rejected anyway as it has expired, illustrating
805 why it was not necessary to keep this stamp in the database.
806 .Sp
807 With the default database (the sdb format) the database contents are
808 human readable, so you can view their contents by cating them to the
809 terminal:
810 .ie n .IP """cat hashcash.sdb""" 4
811 .el .IP "\f(CWcat hashcash.sdb\fR" 4
812 .IX Item "cat hashcash.sdb"
813 to see that the stamp really is added and then after puring
814 subsequently purged due to expiry.
815 .Sh "Purging old stamps on Demand"
816 .IX Subsection "Purging old stamps on Demand"
817 As a convenience you can purge at the same time as checking stamps by
818 using the \fI\-p\fR option with the \fI\-c\fR option.
819 .ie n .IP """hashcash \-m \-b 10 foo > stamp""" 4
820 .el .IP "\f(CWhashcash \-m \-b 10 foo > stamp\fR" 4
821 .IX Item "hashcash -m -b 10 foo > stamp"
822 .PD 0
823 .ie n .IP """hashcash \-cd \-p now \-e 1 \-b 10 \-r foo < stamp""" 4
824 .el .IP "\f(CWhashcash \-cd \-p now \-e 1 \-b 10 \-r foo < stamp\fR" 4
825 .IX Item "hashcash -cd -p now -e 1 -b 10 -r foo < stamp"
826 .PD
827 It may be inefficient to purge stamps on every use as the entire
828 database has to be scanned for expired stamps. By giving a time
829 period to the \fI\-p\fR option, you can tell \f(CW\*(C`hashcash\*(C'\fR to purge no more
830 frequently than that time period since the previous purge.
831 .Sp
832 For example:
833 .ie n .IP """hashcash \-cd \-p 1d \-e 1 \-b 10 \-r foo < stamp""" 4
834 .el .IP "\f(CWhashcash \-cd \-p 1d \-e 1 \-b 10 \-r foo < stamp\fR" 4
835 .IX Item "hashcash -cd -p 1d -e 1 -b 10 -r foo < stamp"
836 tells \f(CW\*(C`hashcash\*(C'\fR to purge any expired stamps no more than once per
837 day.
838 .ie n .IP """hashcash \-p 1M \-j foo""" 4
839 .el .IP "\f(CWhashcash \-p 1M \-j foo\fR" 4
840 .IX Item "hashcash -p 1M -j foo"
841 tells \f(CW\*(C`hashcash\*(C'\fR to purge only expired stamps matching resource foo
842 once per month.
843 .ie n .IP """hashcash \-p now \-k""" 4
844 .el .IP "\f(CWhashcash \-p now \-k\fR" 4
845 .IX Item "hashcash -p now -k"
846 tells \f(CW\*(C`hashcash\*(C'\fR to purge all stamps (expired and unexpired) now.
847 .SH "stamp format (version 1)"
848 .IX Header "stamp format (version 1)"
849 The current stamp format is version 1. This tool can verify hashcash
850 version 0 stamps also, but version 0 stamps are no longer created as
851 they are being phased out in favor of the more extensible v1 stamp
852 format.
853 .IP "\fIver\fR:\fIbits\fR:\fIdate\fR:\fIresource\fR:[\fIext\fR]:\fIrand\fR:\fIcounter\fR" 4
854 .IX Item "ver:bits:date:resource:[ext]:rand:counter"
855 .PP
856 where
857 .IP "\fIver\fR = 1" 4
858 .IX Item "ver = 1"
859 .PD 0
860 .IP "\fIbits\fR = how many bits of partial-preimage the stamp is claimed to have" 4
861 .IX Item "bits = how many bits of partial-preimage the stamp is claimed to have"
862 .IP "\fIdate\fR = YYMMDD[hhmm[ss]]" 4
863 .IX Item "date = YYMMDD[hhmm[ss]]"
864 .IP "\fIresource\fR = resource string (eg \s-1IP\s0 address, email address)" 4
865 .IX Item "resource = resource string (eg IP address, email address)"
866 .IP "\fIext\fR = extension \*(-- ignored in the current version" 4
867 .IX Item "ext = extension ignored in the current version"
868 .PD
869 Format of extension:
870 .RS 4
871 .IP "[name1[=val1[,val2...]];[name2[=val1[,val2...]]...]]" 4
872 .IX Item "[name1[=val1[,val2...]];[name2[=val1[,val2...]]...]]"
873 Note the value can also contain =. Example extension (not a real one):
874 .Sp
875 .Vb 1
876 \& name1=2,3;name2;name3=var1=2,var2=3,2,val
877 .Ve
878 .Sp
879 Which would be extension name1 has values 2 and 3; extension name2 has
880 no values; extension name3 has 3 values \*(L"var1=2\*(R", \*(L"var2=3\*(R", \*(L"2\*(R" and
881 \&\*(L"val\*(R". The hashcash extension may interpret the values as it sees fit
882 eg \*(L"var1=2\*(R" could be the value of an option to the extension name3.
883 .RE
884 .RS 4
885 .RE
886 .IP "\fIrand\fR = string of random characters from alphabet a\-zA\-Z0\-9+/= to avoid preimage with other sender's stamps" 4
887 .IX Item "rand = string of random characters from alphabet a-zA-Z0-9+/= to avoid preimage with other sender's stamps"
888 .PD 0
889 .IP "\fIcounter\fR = to find a stamp with the desired number of preimage 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)." 4
890 .IX Item "counter = to find a stamp with the desired number of preimage 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)."
891 .PD
892 .SH "FILES"
893 .IX Header "FILES"
894 .IP "\fIhashcash.sdb\fR" 4
895 .IX Item "hashcash.sdb"
896 default double spend database
897 .SH "EXIT STATUS"
898 .IX Header "EXIT STATUS"
899 \&\f(CW\*(C`hashcash\*(C'\fR returns success (exit code 0) after successfully minting a
900 stamp, after fully checking a stamp and finding it valid, and after a
901 timing test.
902 .PP
903 If when checking a stamp it is found to be invalid (due to being
904 malformed, being expired, having insufficient value, having a date in
905 the future, or being double spent), \f(CW\*(C`hashcash\*(C'\fR returns failure (exit
906 code 1).
907 .PP
908 If insufficient options are given to fully check a stamp, if the stamp
909 is otherwise valid return unchecked (exit code 2). If the \fI\-y\fR flag
910 is given and hashcash would normally return unchecked, exit code
911 success is returned instead.
912 .PP
913 If any exception occurs (file read failure for database checking or
914 corrupted database contents) an exit status of 3 is returned.
915 .SH "AUTHOR"
916 .IX Header "AUTHOR"
917 Written by Adam Back <[email protected]>
918 .SH "SEE ALSO"
919 .IX Header "SEE ALSO"
920 \&\fIsha1sum\fR\|(1), \fIsha1\-hashcash\fR\|(1), \fIsha1\fR\|(1), http://www.hashcash.org/