Module: Confium::Transparency::OTS

Defined in:
lib/confium/transparency/ots.rb

Defined Under Namespace

Classes: Receipt

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

Class Method Details

.stamp(_hash) ⇒ Receipt?

Stamp a 32-byte hash via OTS calendar servers. Returns a Receipt (stub: returns nil — requires network).

Parameters:

  • hash (String)

    32-byte SHA-256 hash to anchor

Returns:



43
44
45
46
47
48
# File 'lib/confium/transparency/ots.rb', line 43

def self.stamp(_hash)
  # Real implementation: calls the Rust OTS client which
  # submits the hash to calendar servers and returns a
  # merged proof. Requires network access.
  nil
end

.verify(_receipt, _hash) ⇒ Boolean

Verify an OTS receipt against a hash. Returns true if the receipt proves the hash was anchored.

Parameters:

  • receipt (Receipt, String)

    the OTS proof

  • hash (String)

    the 32-byte hash

Returns:

  • (Boolean)


56
57
58
59
60
# File 'lib/confium/transparency/ots.rb', line 56

def self.verify(_receipt, _hash)
  # Real implementation: calls the Rust OTS verifier which
  # walks the Bitcoin blockchain proof.
  false
end