Skip to content

Commit

Permalink
chore(chain): document insert_descriptor invariants better
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Jun 11, 2024
1 parent fd8322a commit d2629cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/chain/src/keychain/txout_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ pub const DEFAULT_LOOKAHEAD: u32 = 25;
///
/// There is a strict 1-to-1 relationship between descriptors and keychains. Each keychain has one
/// and only one descriptor and each descriptor has one and only one keychain. The
/// [`insert_descriptor`] method will return an error if you try and violate this invariant.
/// [`insert_descriptor`] method will return an error if you try and violate this invariant. This
/// rule is a proxy for a stronger rule: no two descriptors should produce the same script pubkey.
/// Having two descriptors produce the same script pubkey should cause whichever keychain derives the
/// script pubkey first to be the effective owner of it but you should not rely on this behaviour.
/// ⚠ It is up you, the developer, not to violate this invariant.
///
/// # Revealed script pubkeys
///
Expand Down

0 comments on commit d2629cb

Please sign in to comment.