Skip to content

Commit 9822040

Browse files
danielabrozzonievanlinjin
authored andcommitted
doc(chain): add section for non-recommended K to descriptor assignments
1 parent de53d72 commit 9822040

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

crates/chain/src/keychain/txout_index.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,17 @@ const DEFAULT_LOOKAHEAD: u32 = 25;
168168
/// this is useful in case a user unassigns a keychain from a descriptor and after some time
169169
/// assigns it again.
170170
///
171-
/// Additionally, although a keychain can only be assigned to one descriptor, different keychains
172-
/// can be assigned to the same descriptor. When a method returns spks/outpoints that is associated
173-
/// with a descriptor, it may be associated with multiple keychain variants. The keychain variant
174-
/// with the higher rank will be returned. Rank is determined by the [`Ord`] implementation of the
175-
/// keychain type. Earlier keychain variants have higher rank.
171+
/// # Different keychains assigned to one descriptor
172+
///
173+
/// Although a keychain can only be assigned to one descriptor, different keychains
174+
/// can be assigned to the same descriptor. This is not recommended.
175+
///
176+
/// If multiple keycahins are assigned to the same descriptor:
177+
/// 1. Methods that take in a keychain, such as [`KeychainTxOutIndex::reveal_next_spk`],
178+
/// will work normally when either keychain is passed in.
179+
/// 2. Methods that return a keychain, such as [`KeychainTxOutIndex::outpoints`] will
180+
/// return only the keychain variant with the highest rank.
181+
/// Rank is determined by the [`Ord`] implementation of the keychain type.
176182
///
177183
/// [`Ord`]: core::cmp::Ord
178184
/// [`SpkTxOutIndex`]: crate::spk_txout_index::SpkTxOutIndex

0 commit comments

Comments
 (0)