diff --git a/docs/developer/api.md b/docs/developer/api.md index f68ba67..51c9fb5 100644 --- a/docs/developer/api.md +++ b/docs/developer/api.md @@ -169,9 +169,14 @@ boundary; there is no legacy decoder. The one-shot function creates only unshared secrets: ```python -generate_master_seed(seed_bytes=None, *, byte_length=None, identifier=None) +generate_master_seed(seed_bytes=None, *, byte_length=None, identifier=None, fingerprint=None) ``` +A fresh seed with no `identifier` needs `fingerprint`: a callable that takes +the seed bytes and returns their four-byte BIP32 master fingerprint. This +package has no secp256k1 arithmetic, so the CLI asks Bitcoin Core. Without +either argument, fresh generation raises `ValueError`. + Shared creation uses `CreationCeremony.master_seed(...)` or `CreationCeremony.from_secret(...)`. Exactly one of `share_count` and `indices` is required. `next_share()` returns one pending share, `confirm(text)` must diff --git a/src/codex32/bech32.py b/src/codex32/bech32.py index 59befc7..7704f01 100644 --- a/src/codex32/bech32.py +++ b/src/codex32/bech32.py @@ -1,3 +1,28 @@ +# Portions of this file are derived from work by: +# Copyright (c) 2017, 2020 Pieter Wuille +# Source: https://github.com/sipa/bech32/blob/master/ref/python/segwit_addr.py +# +# Additional code and modifications: +# Copyright (c) 2026 Ben Westgate +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + """Bech32 character, container, and bit-conversion helpers.""" from codex32.checksums import _Checksum diff --git a/src/codex32/checksums.py b/src/codex32/checksums.py index 95bf742..6061d1e 100644 --- a/src/codex32/checksums.py +++ b/src/codex32/checksums.py @@ -1,3 +1,32 @@ +# The polymod arithmetic in this file is derived from work by: +# Copyright (c) 2017, 2020 Pieter Wuille, MIT License +# Source: https://github.com/sipa/bech32/blob/master/ref/python/segwit_addr.py +# codex32 constants in this file are derived from work by: +# Author: Leon Olsson Curr and Pearlwort Sneed +# License: BSD-3-Clause +# Source: https://github.com/bitcoin/bips/blob/master/bip-0093.mediawiki +# +# Additional code: +# Copyright (c) 2026 Ben Westgate , MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + """Immutable checksum specifications used by codex32.""" from dataclasses import dataclass