confium 0.7.0-aarch64-linux → 0.7.2-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.adoc CHANGED
@@ -103,7 +103,7 @@ end
103
103
  === `Confium::Transparency`
104
104
  - `MerkleTree.new` / `#append(artifact_hash)` / `#root` / `#length` / `#empty?` / `#inclusion_proof(seq)`
105
105
  - `InclusionProof#sequence` / `#steps` / `#verify(root)`
106
- - `Ots.stamp(hash)` / `Ots.verify(receipt, hash)` — OpenTimestamps anchoring interface (pure-Ruby stub; calendar-server wiring lands with the Rust client)
106
+ - `Ots.stamp(hash)` / `Ots.verify(proof)` / `Ots.upgrade(proof)` — real OpenTimestamps anchoring over the wire protocol (calendar HTTP, servers tried in order; the network round trip releases the GVL). `Ots::Client.new(servers)` for a custom pool; `Ots::Proof#verify` replays the op tree and classifies attestations. Network failures raise — there is no silent nil
107
107
 
108
108
  === `Confium::Composite` — PQ migration
109
109
  - `.generate_ed25519_keypair` → `{ private_key:, public_key: }`
@@ -1,14 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Confium::Transparency::OTS — OpenTimestamps client interface.
3
+ # Confium::Transparency::OTS — OpenTimestamps calendar client.
4
4
  #
5
- # Wraps confium-transparency::ots::Client for anchoring Merkle tree
6
- # roots in the Bitcoin blockchain via OTS calendar servers.
7
- #
8
- # This is a pure-Ruby stub that defines the interface. The actual
9
- # OTS stamping requires network access to calendar servers and
10
- # will be wired through the Rust extension in a future PR
11
- # (TODO.completion/011-ots-ers-exposure.md).
5
+ # Real wire-protocol implementation over the native extension
6
+ # (confium-transparency 0.8.5+): stamps POST the 32-byte digest to a
7
+ # calendar server and parse the returned partial proof; verification
8
+ # replays the op tree from the digest and classifies attestations.
9
+ # Network failures raise (Confium::Transparency::OTS is backed by a
10
+ # real HTTP client) there is no silent nil.
12
11
 
13
12
  module Confium
14
13
  module Transparency
@@ -20,44 +19,48 @@ module Confium
20
19
  https://a.pool.eternitywall.com
21
20
  ].freeze
22
21
 
23
- # An OTS receipt proving that a hash was anchored in Bitcoin
24
- # at a specific block height.
25
- class Receipt
26
- attr_reader :bytes, :block_height
22
+ class << self
23
+ # Stamp a 32-byte digest via the default calendar pool.
24
+ # Returns a Proof (pending attestation — Bitcoin confirmation
25
+ # arrives later; poll with #upgrade).
26
+ #
27
+ # @param hash [String] 32-byte SHA-256 digest to anchor
28
+ # @return [Confium::Transparency::OTS::Proof]
29
+ # @raise [IOError, ArgumentError]
30
+ def stamp(hash)
31
+ default_client.stamp(hash)
32
+ end
27
33
 
28
- def initialize(bytes:, block_height: nil)
29
- @bytes = bytes
30
- @block_height = block_height
34
+ # Verify a proof: replay its op tree from the digest and
35
+ # classify the attestations.
36
+ #
37
+ # @param proof [Proof, String] the proof (or raw .ots bytes —
38
+ # pass the digest alongside for the String form)
39
+ # @param digest [String, nil] required when proof is bytes
40
+ # @return [Hash] { pending: [uri], bitcoin: [height],
41
+ # litecoin: [height], anchored: bool }
42
+ def verify(proof, digest = nil)
43
+ proof = Proof.new(digest, proof) if digest && proof.is_a?(String)
44
+ proof.verify
31
45
  end
32
46
 
33
- def to_bytes
34
- @bytes
47
+ # Upgrade a pending proof (fetch a more complete one).
48
+ #
49
+ # @return [Proof]
50
+ def upgrade(proof)
51
+ default_client.upgrade(proof)
35
52
  end
36
- end
37
53
 
38
- # Stamp a 32-byte hash via OTS calendar servers.
39
- # Returns a Receipt (stub: returns nil — requires network).
40
- #
41
- # @param hash [String] 32-byte SHA-256 hash to anchor
42
- # @return [Receipt, nil]
43
- def self.stamp(_hash)
44
- # Real implementation: calls the Rust OTS client which
45
- # submits the hash to calendar servers and returns a
46
- # merged proof. Requires network access.
47
- nil
48
- end
54
+ private
49
55
 
50
- # Verify an OTS receipt against a hash.
51
- # Returns true if the receipt proves the hash was anchored.
52
- #
53
- # @param receipt [Receipt, String] the OTS proof
54
- # @param hash [String] the 32-byte hash
55
- # @return [Boolean]
56
- def self.verify(_receipt, _hash)
57
- # Real implementation: calls the Rust OTS verifier which
58
- # walks the Bitcoin blockchain proof.
59
- false
56
+ def default_client
57
+ @default_client ||= Client.new(DEFAULT_CALENDARS)
58
+ end
60
59
  end
60
+
61
+ # The native Client is defined by the extension
62
+ # (Confium::Transparency::OTS::Client) with #stamp / #upgrade;
63
+ # the Proof class carries #digest / #to_bytes / #verify.
61
64
  end
62
65
  end
63
66
  end
@@ -5,8 +5,8 @@
5
5
  # The Transparency module itself is defined by the native Rust
6
6
  # extension via magnus at require time. This file registers
7
7
  # pure-Ruby autoloads for the Transparency submodules.
8
- module Confium
9
- module Transparency
10
- autoload :OTS, 'confium/transparency/ots'
11
- end
12
- end
8
+ # `require`, not `autoload`: the native extension defines the OTS
9
+ # constant at load time, which would shadow the autoload entry and
10
+ # keep this file from ever running — the Ruby-level convenience
11
+ # methods would silently vanish.
12
+ require 'confium/transparency/ots'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Confium
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Open
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-07 00:00:00.000000000 Z
11
+ date: 2026-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake