Skip to content

V1 soon#14

Open
pythcoiner wants to merge 6 commits into
masterfrom
v1_soon
Open

V1 soon#14
pythcoiner wants to merge 6 commits into
masterfrom
v1_soon

Conversation

@pythcoiner
Copy link
Copy Markdown
Owner

No description provided.

dpk_to_pk now returns Result<_, Error::InvalidKeyExpression>: Single
literal pubkeys and bare xpubs (no derivation, no wildcard) are
rejected. descr_to_dpks and dpks_to_derivation_keys_paths silently
filter rejected expressions, falling through to DescriptorHasNoKeys
only when nothing valid remains. Test vectors gain
expected: Option<String> so disallowed cases pin "must error".
Add Warning enum (DisallowedKeyExpression, NumsKey) and switch
encrypt() to return Encrypted { bytes, warnings }. Encrypted carries
a to_base64() helper (gated on the base64 feature) so callers can
get bitcoin-core-compatible base64 output without losing access to
the warnings. EncryptedBackup gains a warnings field populated
through ToPayload::warnings; the Descriptor impl forwards to a new
descriptor::descr_warnings that walks the descriptor and reports
each excluded key expression. NUMS detection wins over the disallow
rule so a NUMS literal in tr() is reported with the more specific
Warning::NumsKey.

The CLI bin is migrated to the new return type to keep the cli
feature build green; warning printing follows in the next commit.
Iterate Encrypted::warnings and write a one-line message to stderr
per excluded key expression so users see when a cosigner's key was
sorted out of the encryption-key set.
Add a sanity-harness assertion in individual_secret: distinct
domain-separation tags for s and s_i make c_i = s ^ s_i = 0
statistically impossible, so seeing it means the secret derivation
is misconfigured. Rewrite the two zero-secret fixtures (encode-decode
and no-duplicates tests, plus individual_secrets.json) to use
non-zero patterns that match the spec's expected shape; spell out
the BTreeSet ordering in the encode-decode test.
@pythcoiner pythcoiner force-pushed the v1_soon branch 7 times, most recently from e7860fc to a1d9c42 Compare April 29, 2026 12:27
Add a transparent v0 decrypt path so backups produced by the
0.0.2 release stay readable after upgrade. Magic-byte dispatch in
set_encrypted_payload routes BIPXXX to the current parser and BEB
to a new Payload::DecryptV0 variant; decrypt() detects the variant
and delegates to the v0 crate via a private try_v0_decrypt helper
that re-maps Decrypted/Error variants. Both crates pin the same
miniscript version with identical features, so the Descriptor type
crosses the boundary without re-parsing.

The v0 dep is gated behind a `v0` cargo feature (on by default);
miniscript_12_3_5 / miniscript_12_0 selections propagate to the
v0 dep via `?/` so disabling `v0` keeps the dep tree minimal.
This is a decrypt-only path - encrypt() never emits BEB, pinned
by test_encrypt_never_emits_v0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant