Module: Confium::Transparency::OTS
- Defined in:
- lib/confium/transparency/ots.rb
Constant Summary collapse
- DEFAULT_CALENDARS =
Default OTS calendar servers (from opentimestamps.org).
%w[ https://a.pool.opentimestamps.org https://b.pool.opentimestamps.org https://a.pool.eternitywall.com ].freeze
Class Method Summary collapse
-
.stamp(hash) ⇒ Confium::Transparency::OTS::Proof
Stamp a 32-byte digest via the default calendar pool.
-
.upgrade(proof) ⇒ Proof
Upgrade a pending proof (fetch a more complete one).
-
.verify(proof, digest = nil) ⇒ Hash
Verify a proof: replay its op tree from the digest and classify the attestations.
Class Method Details
.stamp(hash) ⇒ Confium::Transparency::OTS::Proof
Stamp a 32-byte digest via the default calendar pool. Returns a Proof (pending attestation — Bitcoin confirmation arrives later; poll with #upgrade).
30 31 32 |
# File 'lib/confium/transparency/ots.rb', line 30 def stamp(hash) default_client.stamp(hash) end |
.upgrade(proof) ⇒ Proof
Upgrade a pending proof (fetch a more complete one).
50 51 52 |
# File 'lib/confium/transparency/ots.rb', line 50 def upgrade(proof) default_client.upgrade(proof) end |
.verify(proof, digest = nil) ⇒ Hash
Verify a proof: replay its op tree from the digest and classify the attestations.
42 43 44 45 |
# File 'lib/confium/transparency/ots.rb', line 42 def verify(proof, digest = nil) proof = Proof.new(digest, proof) if digest && proof.is_a?(String) proof.verify end |