confium 0.6.3 → 0.7.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +67 -0
- data/Cargo.lock +180 -11
- data/README.adoc +72 -4
- data/confium.gemspec +2 -0
- data/ext/confium_native/Cargo.toml +4 -1
- data/ext/confium_native/src/gvl.rs +56 -0
- data/ext/confium_native/src/lib.rs +26 -0
- data/ext/confium_native/src/net.rs +125 -0
- data/ext/confium_native/src/ots.rs +183 -0
- data/ext/confium_native/src/winsock.rs +784 -0
- data/lib/confium/transparency/ots.rb +42 -39
- data/lib/confium/transparency.rb +5 -5
- data/lib/confium/version.rb +1 -1
- metadata +6 -2
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Confium::Transparency::OTS — OpenTimestamps client
|
|
3
|
+
# Confium::Transparency::OTS — OpenTimestamps calendar client.
|
|
4
4
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
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
|
data/lib/confium/transparency.rb
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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'
|
data/lib/confium/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Open
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08
|
|
11
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -120,8 +120,11 @@ files:
|
|
|
120
120
|
- ext/confium_native/src/composite.rs
|
|
121
121
|
- ext/confium_native/src/deployment.rs
|
|
122
122
|
- ext/confium_native/src/ers.rs
|
|
123
|
+
- ext/confium_native/src/gvl.rs
|
|
123
124
|
- ext/confium_native/src/lib.rs
|
|
125
|
+
- ext/confium_native/src/net.rs
|
|
124
126
|
- ext/confium_native/src/openpgp_verify.rs
|
|
127
|
+
- ext/confium_native/src/ots.rs
|
|
125
128
|
- ext/confium_native/src/path.rs
|
|
126
129
|
- ext/confium_native/src/pki.rs
|
|
127
130
|
- ext/confium_native/src/store.rs
|
|
@@ -129,6 +132,7 @@ files:
|
|
|
129
132
|
- ext/confium_native/src/tc_session.rs
|
|
130
133
|
- ext/confium_native/src/transparency.rs
|
|
131
134
|
- ext/confium_native/src/util.rs
|
|
135
|
+
- ext/confium_native/src/winsock.rs
|
|
132
136
|
- lib/confium.rb
|
|
133
137
|
- lib/confium/audit.rb
|
|
134
138
|
- lib/confium/audit/otlp_sink.rb
|