Skip to main content

tiny-zk-auth

Tiny, zero-dependency authentication + commitment toolkit that runs byte-identically in the browser, Node.js, Python, and a $1 microcontroller (the field core is integer-only).

npm i tiny-zk-auth        # Node >= 12 (browser: field + fingerprint need no crypto)
pip install tiny-zk-auth  # Python >= 3.8

Three real pieces:

1. Mersenne-31 fingerprint (fast, cross-platform integrity)

const { fingerprintStr } = require('tiny-zk-auth');
fingerprintStr('hello world');   // 1951127573  — same number in Python, Node, browser, MCU

A polynomial (Horner) fingerprint over p = 2³¹−1. Deterministic everywhere, great for integrity / dedup / cache keys on tiny devices. Not a cryptographic hash (≈2⁻³¹ collision) — use it for integrity, not as a security boundary.

2. HMAC-SHA256 device auth (the real security)

const ch = makeChallenge();            // server
const resp = respond(secret, ch);      // device
verify(secret, ch, resp);              // server -> true

Symmetric shared-secret challenge-response, replay-resistant via random challenges.

3. Merkle commitment (prove one, hide the rest)

const root = merkleRoot(['alice','bob','carol','dave']);  // commit, reveals nothing
const proof = merkleProve(items, 1);
merkleVerify(root, 'bob', proof);       // true — and the proof leaks no other member

Honest scope (read this)

Despite the name, this is not a zero-knowledge proof system. A 31-bit field cannot give sound ZK. What you get is: a fast cross-platform fingerprint, symmetric (HMAC) auth, and Merkle commitments with selective disclosure. That combination is genuinely useful for IoT / DePIN / Web3 device identity and tamper-evident sets — just don't market it as "proving statements in zero knowledge." If you need real ZK, that's a separate, heavier lattice/elliptic construction.

Cross-platform guarantee

The JS and Python packages produce identical fingerprints, HMAC responses and Merkle roots — verified by a cross-language test fixture in both test suites.

Open-core

  • Free (MIT): everything above.
  • Pro: commercial license + support tier (proTier flag). It gates no cryptography — honesty: the crypto is all free. You sell support, SLAs, and signed release builds.

Tests

cd npm  && node test/test.js          # 7 tests incl. cross-language fixture
cd pypi && python3 tests/test_auth.py # 7 tests

License

MIT.

Metadata

Release files for tiny-zk-auth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiny-zk-auth 0.1.0
File Size Uploaded Provenance Actions
tiny_zk_auth-0.1.0.tar.gz 5.6 kB Without provenance Details for tiny_zk_auth-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tiny-zk-auth 0.1.0
File Interpreter ABI Platform Actions
tiny_zk_auth-0.1.0-py3-none-any.whl Python 3 none any Details for tiny_zk_auth-0.1.0-py3-none-any.whl

Total release size: 10.6 kB

Release files / tiny_zk_auth-0.1.0.tar.gz

Download URL tiny_zk_auth-0.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a91426028ce359f45f85b346e22bdf3f016bcc373ff365e0437364cfe050ea5
BLAKE2b-256 checksum
How to use checksums
2df988ae57adc081d50979a12107c6b7a73d4a975519ec61a34b2eb1267f2532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / tiny_zk_auth-0.1.0-py3-none-any.whl

Download URL tiny_zk_auth-0.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25ca9884526ad1098713de56f0efda292a712c08da04fee89d8f4a6c306d25b4
BLAKE2b-256 checksum
How to use checksums
fa20b3302a4677411bf75da3ab7d1ceb5fe4ab4c6874c0d9a44a628bb47a54c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for tiny-zk-auth 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page