Debian Codegraph @

hashcash.1

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