File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,14 @@ const getControlBlock = witness => {
4040 return witness [ witness . length - 1 ]
4141}
4242
43+ export const isSimplicityTapleafVersion = ( controlBlock ) => {
44+ return controlBlock && ( controlBlock . startsWith ( 'be' ) || controlBlock . startsWith ( 'bf' ) )
45+ }
46+
4347// Check if a vin is a P2TR Simplicity spend
4448// A P2TR Simplicity spend has:
4549// - 4 witness elements (or 5 with optional annex)
46- // - Control block starts with 'be' or 'bf' (leaf version for Simplicity)
50+ // - is a simplicity Tapleaf
4751export const isSimplicitySpend = ( vin ) => {
4852 if ( ! process . env . IS_ELEMENTS || ! vin . witness ) return false
4953
@@ -54,7 +58,7 @@ export const isSimplicitySpend = (vin) => {
5458 if ( witnessLen !== 4 && ! ( witnessLen === 5 && hasAnnexBlock ) ) return false
5559
5660 const controlBlock = getControlBlock ( vin . witness )
57- return controlBlock && ( controlBlock . startsWith ( 'be' ) || controlBlock . startsWith ( 'bf' ) )
61+ return isSimplicityTapleafVersion ( controlBlock )
5862}
5963
6064// Extract Simplicity witness components from a vin
You can’t perform that action at this time.
0 commit comments