b4n1-notary 0.2.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c11ec746c4d5ab6663910582e487695edeb980971ee978f7d0158ed06d466dbe
4
+ data.tar.gz: 75d67750c8ec605a4a758b868369517034040ec62f830580eaffe3c5504d3fc2
5
+ SHA512:
6
+ metadata.gz: e423f685ce13d134a0236ce526c5a41783f0302d70d34755bf2473751fdc57fe0677154d3b8b7fc850f2a4f14a3c5cdc1fcfef2d6edd88107c267fbbb9bb4a0d
7
+ data.tar.gz: 1707c3c3a08ae049ab84f9a3063b056590b1224857c9fea43a954281dd2f24b847be7062f04877f1b7c81120ce19a8f166ab51cd14877df791a2793b42dc9b5a
data/EULA.txt ADDED
@@ -0,0 +1,87 @@
1
+ B4N1-NOTARY — END USER LICENSE AGREEMENT (BINARIES)
2
+ ==================================================
3
+
4
+ Version: 1.0 | Effective: 2026-11-23 | Applies to: b4n1-notary 0.2.0+
5
+
6
+ This End User License Agreement ("EULA") governs your use of the B4N1
7
+ BINARY ARTIFACTS of b4n1-notary — the bundled per-platform `b4n1notary`
8
+ executables (`b4n1notary-linux-amd64`, `b4n1notary-linux-arm64`,
9
+ `b4n1notary-linux-ia32`, `b4n1notary-macos-x64`,
10
+ `b4n1notary-macos-arm64`, `b4n1notary-windows-amd64.exe`,
11
+ `b4n1notary-windows-ia32.exe` and the remaining platform builds
12
+ shipped under each SDK's `bin/` directory), the packaged
13
+ per-language bindings (`*.whl`, npm tarball, `*.jar`, `*.nupkg`,
14
+ gem, composer package, Go module), and the `b4n1notary` standalone
15
+ executable.
16
+
17
+ The SDK wrapper source files (the thin per-language bindings) are licensed
18
+ separately under the Business Source License 1.1 — see the `LICENSE` file
19
+ and each registry's license metadata.
20
+
21
+ 1. DEFINITIONS
22
+ "Binaries" means the compiled artifacts described above.
23
+ "SDK" means the BUSL-1.1 licensed wrapper source distributed for each language.
24
+ "Source" means the Rust implementation, vault format, build scripts,
25
+ internal tests and internal documentation of the B4N1 engine. Source is
26
+ NOT distributed under this EULA or any other license and remains
27
+ proprietary.
28
+
29
+ 2. GRANT OF LICENSE
30
+ Subject to your compliance with this EULA and payment of any applicable
31
+ subscription, B4N1 grants you a limited, non-exclusive, non-transferable,
32
+ revocable license to install and use the Binaries within your own products
33
+ and internal tooling, in object form only.
34
+
35
+ 3. RESTRICTIONS (strictly enforced)
36
+ a. NO REDISTRIBUTION OF SOURCE. You may not publish, disclose, sublicense
37
+ or otherwise make the B4N1 Rust Source available, in whole or in part,
38
+ modified or unmodified, by any means, including in public repositories.
39
+ b. NO DECOMPILATION OR REVERSE ENGINEERING. You may not decompile,
40
+ disassemble, deobfuscate, or otherwise reverse engineer the Binaries
41
+ except to the extent such restriction is prohibited by applicable law
42
+ that cannot be waived.
43
+ c. NO REMOVAL OF NOTICES. You may not remove, alter, or obscure any
44
+ copyright, license, watermark, or proprietary notices in the Binaries.
45
+ d. NO RESALE AS A STANDALONE PRODUCT. The Binaries may not be resold,
46
+ sublicensed, or offered as a competing product.
47
+ e. NO VAULT-FORMAT DISCLOSURE AS A PRODUCT. You may interoperate
48
+ with the Binaries under this EULA, but you may not publish the
49
+ vault format, key-derivation scheme or storage layout as a
50
+ specification or as the basis of a competing vault.
51
+ f. COMPLIANCE AND AUDIT. You will cooperate with reasonable verification of
52
+ license status, including honoring embedded license validation.
53
+
54
+ 4. SUBSCRIPTION TIERS
55
+ The Binaries operate under the applicable tier, validated offline against a
56
+ license file (`.b4n1lic`):
57
+ - Community: free, with attribution/watermark obligations.
58
+ - Pro / Corporate / Enterprise: paid tiers, no watermark, per the
59
+ commercial license purchased from B4N1.
60
+ License files are validated fully offline; no network calls are made at
61
+ runtime to verify entitlement.
62
+
63
+ 5. TERMINATION
64
+ This EULA terminates automatically if you breach any term. Upon
65
+ termination you must cease all use and destroy the Binaries and copies.
66
+
67
+ 6. DISCLAIMER OF WARRANTY
68
+ The Binaries are provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or
69
+ implied, including merchantability, fitness for a particular purpose, and
70
+ non-infringement. B4N1 does not warrant that the Binaries will be
71
+ uninterrupted or error-free.
72
+
73
+ 7. LIMITATION OF LIABILITY
74
+ To the maximum extent permitted by law, B4N1 shall not be liable for any
75
+ indirect, incidental, special, consequential, or punitive damages, or for
76
+ any loss of profits, revenue, data, or goodwill, arising out of your use
77
+ of the Binaries, regardless of the legal theory, even if advised of the
78
+ possibility of such damages.
79
+
80
+ 8. GOVERNING LAW AND SEVERABILITY
81
+ This EULA is governed by applicable law. If any provision is held
82
+ unenforceable, the remaining provisions stay in full force.
83
+
84
+ 9. CONTACT
85
+ Licensing questions: licensing@b4n1.com | https://b4n1.com
86
+
87
+ B4N1 — All rights reserved. Proprietary source: private and secret.
data/LICENSE ADDED
@@ -0,0 +1,95 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ -----------------------------------------------------------------------------
7
+
8
+ Parameters
9
+
10
+ Licensor: B4N1 (b4n1.com)
11
+ Licensed Work: b4n1-notary — Authorship integrity and sealing: Merkle root of a
12
+ project plus an OpenTimestamps proof-of-existence.
13
+ Additional Use Grant: You may use the Licensed Work in production, free of
14
+ charge, provided that your organization's total annual
15
+ gross revenue does not exceed USD $100,000. Organizations
16
+ whose annual gross revenue exceeds USD $100,000 must
17
+ obtain a commercial license from the Licensor before any
18
+ production use. You may not resell or provide the
19
+ Licensed Work as a managed commercial service without
20
+ authorization from the Licensor.
21
+ Change Date: Four years after the first publicly available
22
+ distribution of the Licensed Work under this License.
23
+ Change License: Apache License, Version 2.0
24
+
25
+ For information about alternative licensing arrangements for the Licensed
26
+ Work, please contact b4n1@b4n1.com.
27
+
28
+ -----------------------------------------------------------------------------
29
+
30
+ Terms
31
+
32
+ The Licensor hereby grants you the right to copy, modify, create derivative
33
+ works, redistribute, and make non-production use of the Licensed Work. The
34
+ Licensor may make an Additional Use Grant, above, permitting limited
35
+ production use.
36
+
37
+ Effective on the Change Date, or the fourth anniversary of the first publicly
38
+ available distribution of a specific version of the Licensed Work under this
39
+ License, whichever comes first, the Licensor hereby grants you rights under
40
+ the terms of the Change License, and the rights granted in the paragraph
41
+ above terminate.
42
+
43
+ If your use of the Licensed Work does not comply with the requirements
44
+ currently in effect as described in this License, you must purchase a
45
+ commercial license from the Licensor, its affiliated entities, or authorized
46
+ resellers, or you must refrain from using the Licensed Work.
47
+
48
+ All copies of the original and modified Licensed Work, and derivative works
49
+ of the Licensed Work, are subject to this License. This License applies
50
+ separately for each version of the Licensed Work and the Change Date may vary
51
+ for each version of the Licensed Work released by Licensor.
52
+
53
+ You must conspicuously display this License on each original or modified copy
54
+ of the Licensed Work. If you receive the Licensed Work in original or
55
+ modified form from a third party, the terms and conditions set forth in this
56
+ License apply to your use of that work.
57
+
58
+ Any use of the Licensed Work in violation of this License will automatically
59
+ terminate your rights under this License for the current and all other
60
+ versions of the Licensed Work.
61
+
62
+ This License does not grant you any right in any trademark or logo of
63
+ Licensor or its affiliates (provided that you may use a trademark or logo of
64
+ Licensor as expressly required by this License).
65
+
66
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
67
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
68
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
69
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
70
+ TITLE. MariaDB hereby grants you permission to use this License's text to
71
+ license your works, and to refer to it using the trademark "Business Source
72
+ License", as long as you comply with the Covenants of Licensor below.
73
+
74
+ Covenants of Licensor
75
+
76
+ In consideration of the right to use this License's text and the "Business
77
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
78
+ other recipients of the licensed work to be provided by Licensor:
79
+
80
+ To specify as the Change License a license that is compatible with GPL
81
+ Version 2.0 or a later version, where "compatible" means that software
82
+ provided under the Change License can be included in a program with software
83
+ provided under GPL Version 2.0 or a later version. Licensor may specify
84
+ additional Change Licenses without limitation.
85
+
86
+ To either: (a) specify an additional grant of rights to use that does not
87
+ impose any additional restriction on the right granted in this License, as
88
+ the Additional Use Grant; or (b) insert the text "None" to specify a Change
89
+ License. Not to modify this License in any other way.
90
+
91
+ Notice
92
+
93
+ The Business Source License (this document, or the "License") is not an Open
94
+ Source license. However, the Licensed Work will eventually be made available
95
+ under an Open Source License, as stated in this License.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # b4n1-notary — Ruby SDK
2
+
3
+ Authorship integrity and sealing: one Merkle root over a project, a portable
4
+ proof file, optional Bitcoin-anchored receipts.
5
+
6
+ ```bash
7
+ gem install b4n1-notary
8
+ ```
9
+
10
+ ```ruby
11
+ require "b4n1notary"
12
+
13
+ client = B4N1Notary::Client.new
14
+ sealed = client.stamp("/path/to/project", identity: "team")
15
+ puts sealed.ok?
16
+ puts client.history("/path/to/project").stdout
17
+ ```
18
+
19
+ | Method | Engine verb |
20
+ |---|---|
21
+ | `stamp(path, identity:)` | `stamp` |
22
+ | `verify(path, proof)` | `verify` |
23
+ | `verify_ots(path, proof, check_calendar:, header:)` | `verify-ots` |
24
+ | `history(path)` | `history` |
25
+ | `license(action, key:, json:)` | `license` |
26
+
27
+ Resolution order: `B4N1NOTARY_BIN_PATH`, bundled `bin/`, then `PATH`.
28
+
29
+ ## Test
30
+
31
+ ```bash
32
+ ruby test/test_sdk.rb
33
+ ```
34
+
35
+ ## License
36
+
37
+ Business Source License 1.1 (BUSL-1.1). See `LICENSE`. Binaries ship with
38
+ `EULA.txt`.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/b4n1notary.rb ADDED
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ # b4n1-notary SDK — authorship integrity and sealing.
4
+ #
5
+ # Thin Ruby wrapper around the b4n1-notary binary (bundled per platform).
6
+ # Override: B4N1NOTARY_BIN_PATH=/path/to/b4n1-notary
7
+ require "open3"
8
+
9
+ module B4N1Notary
10
+ SDK_VERSION = "0.2.1"
11
+
12
+ # Ordered: the FIRST pattern that matches RUBY_PLATFORM wins.
13
+ PLATFORM_BINARIES = [
14
+ [/x86_64-linux/, "b4n1notary-linux-amd64"],
15
+ [/aarch64-linux|arm64-linux/, "b4n1notary-linux-arm64"],
16
+ [/i686-linux/, "b4n1notary-linux-ia32"],
17
+ [/x86_64-darwin/, "b4n1notary-macos-x64"],
18
+ [/arm64-darwin/, "b4n1notary-macos-arm64"],
19
+ [/mingw32|mswin/, "b4n1notary-windows-amd64.exe"]
20
+ ].freeze
21
+
22
+ Result = Struct.new(:exit_code, :stdout, :stderr) do
23
+ def ok?
24
+ exit_code.zero?
25
+ end
26
+ end
27
+
28
+ def self.platform_binary_name
29
+ match = PLATFORM_BINARIES.find { |pattern, _| RUBY_PLATFORM.match?(pattern) }
30
+ match && match[1]
31
+ end
32
+
33
+ def self.binary
34
+ exact = ENV["B4N1NOTARY_BIN_PATH"]
35
+ return exact if exact && File.file?(exact) && File.executable?(exact)
36
+
37
+ name = platform_binary_name
38
+ if name
39
+ bundled = File.expand_path(File.join(__dir__, "..", "bin", name))
40
+ return bundled if File.file?(bundled) && File.executable?(bundled)
41
+ end
42
+
43
+ ENV.fetch("PATH", "").split(File::PATH_SEPARATOR).each do |dir|
44
+ candidate = File.join(dir, "b4n1-notary")
45
+ return candidate if File.file?(candidate) && File.executable?(candidate)
46
+ end
47
+ nil
48
+ end
49
+
50
+ class Client
51
+ def initialize(binary_path = nil)
52
+ @binary = binary_path || B4N1Notary.binary
53
+ raise "b4n1-notary binary not found. Set B4N1NOTARY_BIN_PATH." unless @binary
54
+ end
55
+
56
+ def stamp(path = ".", identity: nil)
57
+ args = ["stamp", "--path", path]
58
+ args += ["--identity", identity] if identity
59
+ run(*args)
60
+ end
61
+
62
+ def verify(path, proof)
63
+ run("verify", "--path", path, "--proof", proof)
64
+ end
65
+
66
+ def verify_ots(path, proof, check_calendar: false, header: nil)
67
+ args = ["verify-ots", "--path", path, "--proof", proof]
68
+ args << "--check-calendar" if check_calendar
69
+ args += ["--header", header] if header
70
+ run(*args)
71
+ end
72
+
73
+ def history(path = ".")
74
+ run("history", "--path", path)
75
+ end
76
+
77
+ def license(action = nil, key: nil, json: false)
78
+ args = ["license"]
79
+ args << action if action
80
+ args << key if key
81
+ args << "--json" if json
82
+ run(*args)
83
+ end
84
+
85
+ private
86
+
87
+ def run(*args)
88
+ stdout, stderr, status = Open3.capture3(@binary, *args)
89
+ Result.new(status.exitstatus || -1, stdout, stderr)
90
+ end
91
+ end
92
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: b4n1-notary
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Bani Montoya
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-11-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Thin Ruby wrapper around the b4n1-notary engine, with precompiled binaries
14
+ bundled per platform. No compiler needed.
15
+ email:
16
+ - banimontoya@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - EULA.txt
22
+ - LICENSE
23
+ - README.md
24
+ - bin/b4n1notary-linux-amd64
25
+ - bin/b4n1notary-linux-arm64
26
+ - bin/b4n1notary-linux-ia32
27
+ - bin/b4n1notary-macos-arm64
28
+ - bin/b4n1notary-macos-x64
29
+ - bin/b4n1notary-windows-amd64.exe
30
+ - bin/b4n1notary-windows-ia32.exe
31
+ - lib/b4n1notary.rb
32
+ homepage: https://github.com/B4N1-com/b4n1-notary
33
+ licenses:
34
+ - BUSL-1.1
35
+ metadata:
36
+ homepage_uri: https://github.com/B4N1-com/b4n1-notary
37
+ source_code_uri: https://github.com/B4N1-com/b4n1-notary
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '2.7'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.3.5
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: 'Authorship integrity and sealing: stamp, verify and list the proofs of a
57
+ project.'
58
+ test_files: []