1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! Postage stamp primitives for Ethereum Swarm.
//!
//! This crate provides the core types and traits for postage stamps in the Swarm network.
//! It is optimized for verification use cases (such as `vertex` nodes).
//!
//! For stamp issuing and signing, use the
//! [`nectar-postage-issuer`](https://docs.rs/nectar-postage-issuer) crate.
//!
//! # Core Types
//!
//! - [`Batch`]: A postage batch representing prepaid storage
//! - [`Stamp`]: A postage stamp proving payment for chunk storage
//! - [`StampIndex`]: The bucket and position index within a stamp
//! - [`StampDigest`]: The data to be signed when creating a stamp
//! - [`PostageContext`]: Context for batch expiry calculations
//! - [`BatchEvent`]: Events emitted by the postage stamp contract (requires `std`)
//!
//! # Traits
//!
//! - [`StampValidator`]: Validate stamps against batches
//! - [`BatchStore`]: Persist and retrieve batches (requires `std`). The trait is
//! synchronous and, having an associated `Error` and no generic methods, is
//! naturally object-safe; drive it from an async edge (a gRPC service, an FFI
//! boundary) where async is genuinely needed, rather than colouring the core.
//! - [`SnapshotStore`]: Cache recovered issuer snapshot state by batch id (requires `std`)
//! - [`BatchEventHandler`]: Handle batch events from the blockchain (requires `std`)
//!
//! # Features
//!
//! - `std` (default): Enable standard library support, BatchStore, events
//! - `serde`: Enable serde serialization/deserialization
//! - `parallel`: Enable parallel verification with rayon
// k256 is a dependency only to enable the precomputed-tables feature for faster ECDSA
use k256 as _;
// `alloc` is required by the stamped-chunk codec (`Vec`). `nectar-primitives`,
// a hard dependency, also already requires an allocator, so this adds no new
// constraint to the `no_std` build.
extern crate alloc;
// Storage and events (std only)
// Parallel verification (requires rayon)
// Core types
pub use ;
pub use StampError;
pub use ;
pub use StampedChunk;
pub use ;
pub use StampValidator;
pub use StoreValidator;
// Storage and events (std only)
pub use ;
pub use SnapshotStore;
pub use ;
// Re-export VerifyingKey for cached pubkey verification optimization
pub use VerifyingKey;