Human-executable secret sharing for BIP39 mnemonics using GF(2053)
Project description
schiavinato-sharing-py
Python library for Schiavinato Sharing
Human-executable secret sharing for BIP39 mnemonics using GF(2053).
โ ๏ธ Status: Work in Progress
This library is functional but experimental (v0.4.1).
It is not professionally audited. Do not use for real funds until you have done your own review and the project has undergone independent security review.
Current Status
- Core GF(2053) arithmetic, polynomial ops, Lagrange interpolation
- BIP39 mnemonic split/recover with row + global checksums
- v0.4.1 parity with JS: dual-path checksum validation, checksum polynomials, security utilities, configurable randomness, and mnemonic helpers
- Comprehensive test suite (62 tests) with cross-implementation vectors
๐ฏ What is Schiavinato Sharing?
Schiavinato Sharing is a secret-sharing scheme specifically designed for BIP39 mnemonic phrases using basic arithmetic in GF(2053). Unlike other schemes, it can be performed entirely by hand with pencil and paper, making it ideal for:
- ๐ฆ Long-term inheritance planning
- ๐ Disaster recovery scenarios
- ๐ Situations where digital tools are unavailable or untrusted
- ๐จโ๐ฉโ๐งโ๐ฆ Family backup strategies
๐ฆ Installation
pip install schiavinato-sharing
๐ Quick Start
Splitting a Mnemonic
from schiavinato_sharing import split_mnemonic
mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'
k = 2 # threshold
n = 3 # total shares
shares = split_mnemonic(mnemonic, k, n)
print(shares[0].share_number)
print(shares[0].word_shares[:3])
print(shares[0].checksum_shares)
print(shares[0].global_integrity_check_share)
Recovering a Mnemonic
from schiavinato_sharing import recover_mnemonic
result = recover_mnemonic(shares[:2], word_count=12, strict_validation=True)
if result.success:
print(result.mnemonic)
else:
print(result.errors)
๐ Documentation
Specification
This library implements the Schiavinato Sharing specification:
Key documents:
- Whitepaper (LaTeX source) โ Complete mathematical description
- Test Vectors โ Validation data
- Reference Implementation โ HTML tool
Sister Implementation
The JavaScript library is the primary implementation for end users:
๐ JavaScript Library
npm install @grifortis/schiavinato-sharing
๐งช Development
Setup
# Clone the repository
git clone https://github.com/GRIFORTIS/schiavinato-sharing-py.git
cd schiavinato-sharing-py
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type checking
mypy schiavinato_sharing
# Linting
ruff check .
# Formatting
black .
Project Structure
schiavinato-sharing-py/
โโโ schiavinato_sharing/
โ โโโ __init__.py
โ โโโ field.py # GF(2053) field arithmetic
โ โโโ polynomial.py # Polynomial operations
โ โโโ lagrange.py # Lagrange interpolation
โ โโโ split.py # Mnemonic splitting
โ โโโ recover.py # Mnemonic recovery
โ โโโ checksums.py # Checksum generation/validation
โ โโโ security.py # Constant-time comparisons + best-effort wiping
โ โโโ seed.py # Mnemonic helpers + native BIP39 checksum validation
โ โโโ types.py # Dataclasses and typed error shape
โโโ tests/
โ โโโ ...
โโโ pyproject.toml
โโโ README.md
๐ค Contributing
We welcome contributions! This project is in early development, so there's plenty to do.
How to Help
- ๐ Implement core functionality โ Help write the library!
- ๐งช Write tests โ Ensure correctness with comprehensive tests
- ๐ Documentation โ Improve README, docstrings, examples
- ๐ Review โ Check for bugs, security issues, or improvements
Getting Started
- Read the spec: Schiavinato Sharing Whitepaper (LaTeX source)
- Check test vectors: TEST_VECTORS.md
- Look at JS implementation: schiavinato-sharing-js for reference
- Open an issue: Discuss your contribution before starting
See CONTRIBUTING.md for detailed guidelines.
๐ Security
Security Status: โ ๏ธ EXPERIMENTAL (Not Audited)
This library is experimental software that has NOT been professionally audited.
DO NOT USE FOR REAL FUNDS until:
- Professional security audit
- Extensive peer review
- v1.0.0 release
See SECURITY.md for reporting vulnerabilities.
๐ License
MIT License โ see file for details.
๐ Related Projects
- Specification โ Whitepaper and reference implementation
- JavaScript Library โ Primary npm library implementation
- GRIFORTIS โ Organization homepage
๐ฌ Contact
- ๐ Documentation: Specification repo
- ๐ Bug Reports: Open an issue
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Email: support@grifortis.com
๐ Acknowledgments
This implementation is based on:
- Shamir, A. (1979). "How to Share a Secret"
- BIP39: Mnemonic code for generating deterministic keys
- The Schiavinato Sharing specification by Renato Schiavinato Lopez, creator of Schiavinato Sharing and founder of GRIFORTIS
Made with โค๏ธ by GRIFORTIS
Empowering digital sovereignty through open-source tools.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schiavinato_sharing-0.4.1.tar.gz.
File metadata
- Download URL: schiavinato_sharing-0.4.1.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f4c08fb38d692c2a5f23ae2f3d3d8ca83026fc23aa6bcb134eb5c403016797e
|
|
| MD5 |
2ed1bc8c49b76d80d6a1cdc7ec1ac6dd
|
|
| BLAKE2b-256 |
01729c759fc10db79a6b4236f8223fdc65f6394782c3a7bd057f915b08610b17
|
Provenance
The following attestation bundles were made for schiavinato_sharing-0.4.1.tar.gz:
Publisher:
publish.yml on GRIFORTIS/schiavinato-sharing-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schiavinato_sharing-0.4.1.tar.gz -
Subject digest:
9f4c08fb38d692c2a5f23ae2f3d3d8ca83026fc23aa6bcb134eb5c403016797e - Sigstore transparency entry: 897069175
- Sigstore integration time:
-
Permalink:
GRIFORTIS/schiavinato-sharing-py@2cb22f572ad99414d1fd522e48d930e3e979bbee -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/GRIFORTIS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cb22f572ad99414d1fd522e48d930e3e979bbee -
Trigger Event:
release
-
Statement type:
File details
Details for the file schiavinato_sharing-0.4.1-py3-none-any.whl.
File metadata
- Download URL: schiavinato_sharing-0.4.1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bb1cde1169fe47008e88bd5a039e714431321d150109f0c75790e88a74fbbf7
|
|
| MD5 |
a8861c13dd902f818c32628026efd680
|
|
| BLAKE2b-256 |
92150a2b4efaa58b5e5cee7d707aaf0e329e1062e3dc8ba3e9acb977093ff75b
|
Provenance
The following attestation bundles were made for schiavinato_sharing-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on GRIFORTIS/schiavinato-sharing-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schiavinato_sharing-0.4.1-py3-none-any.whl -
Subject digest:
4bb1cde1169fe47008e88bd5a039e714431321d150109f0c75790e88a74fbbf7 - Sigstore transparency entry: 897069225
- Sigstore integration time:
-
Permalink:
GRIFORTIS/schiavinato-sharing-py@2cb22f572ad99414d1fd522e48d930e3e979bbee -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/GRIFORTIS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2cb22f572ad99414d1fd522e48d930e3e979bbee -
Trigger Event:
release
-
Statement type: