Skip to content

Commit 9cbc87a

Browse files
committed
coldcard: update multisig patch
Manually re-applied the patch after the original code seems to have moved around a bit.
1 parent 8aec602 commit 9cbc87a

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

test/data/coldcard-multisig.patch

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ index 2706fb4..f9b533d 100644
2727
--
2828
2.38.1
2929

30+
From 8b4323c1e393d79d46248dd822ca9aaaeb2b2bc3 Mon Sep 17 00:00:00 2001
31+
From: Sjors Provoost <[email protected]>
32+
Date: Wed, 23 Jul 2025 10:16:22 +0200
33+
Subject: [PATCH] Allow multisigs to share master fingerprint
3034

31-
From 04aecb1005d997783e63bd6cd830c4a98f099cb8 Mon Sep 17 00:00:00 2001
32-
From: Andrew Chow <[email protected]>
33-
Date: Wed, 27 Jan 2021 21:50:22 -0500
34-
Subject: [PATCH 3/3] Allow multisigs to share master fingerprint
35-
35+
Co-Authored-By: Ava Chow <[email protected]>
3636
---
37-
shared/multisig.py | 40 +++++++++++++++++++++++++---------------
38-
1 file changed, 25 insertions(+), 15 deletions(-)
37+
shared/multisig.py | 37 ++++++++++++++++++++++++-------------
38+
1 file changed, 24 insertions(+), 13 deletions(-)
3939

4040
diff --git a/shared/multisig.py b/shared/multisig.py
41-
index 6f26644..6e190b5 100644
41+
index 446998a2..cabb2003 100644
4242
--- a/shared/multisig.py
4343
+++ b/shared/multisig.py
44-
@@ -144,9 +144,9 @@ class MultisigWallet:
44+
@@ -144,9 +144,9 @@ class MultisigWallet(WalletABC):
4545
# calc useful cache value: numeric xfp+subpath, with lookup
4646
self.xfp_paths = {}
4747
for xfp, deriv, xpub in self.xpubs:
@@ -53,7 +53,7 @@ index 6f26644..6e190b5 100644
5353

5454
@classmethod
5555
def render_addr_fmt(cls, addr_fmt):
56-
@@ -245,7 +245,11 @@ class MultisigWallet:
56+
@@ -270,7 +270,11 @@ class MultisigWallet(WalletABC):
5757

5858
def get_xfp_paths(self):
5959
# return list of lists [xfp, *deriv]
@@ -66,7 +66,7 @@ index 6f26644..6e190b5 100644
6666

6767
@classmethod
6868
def find_match(cls, M, N, xfp_paths, addr_fmt=None):
69-
@@ -280,24 +284,30 @@ class MultisigWallet:
69+
@@ -305,24 +309,31 @@ class MultisigWallet(WalletABC):
7070
# the same prefix path per-each xfp, as indicated
7171
# xfp_paths (unordered)?
7272
# - could also check non-prefix part is all non-hardened
@@ -79,22 +79,16 @@ index 6f26644..6e190b5 100644
7979
if x[0] not in self.xfp_paths:
8080
return False
8181
- prefix = self.xfp_paths[x[0]]
82-
-
83-
- if len(x) < len(prefix):
84-
- # PSBT specs a path shorter than wallet's xpub
85-
- #print('path len: %d vs %d' % (len(prefix), len(x)))
86-
- return False
87-
-
88-
- comm = len(prefix)
89-
- if tuple(prefix[:comm]) != tuple(x[:comm]):
90-
- # xfp => maps to wrong path
91-
- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm))
9282
+ for prefix in self.xfp_paths[x[0]]:
9383
+ if len(x) < len(prefix):
9484
+ # PSBT specs a path shorter than wallet's xpub
9585
+ #print('path len: %d vs %d' % (len(prefix), len(x)))
9686
+ return False
97-
+
87+
88+
- if len(x) < len(prefix):
89+
- # PSBT specs a path shorter than wallet's xpub
90+
- #print('path len: %d vs %d' % (len(prefix), len(x)))
91+
- return False
9892
+ comm = len(prefix)
9993
+ if tuple(prefix[:comm]) != tuple(x[:comm]):
10094
+ # xfp => maps to wrong path
@@ -106,9 +100,14 @@ index 6f26644..6e190b5 100644
106100
+ break
107101
+ else:
108102
+ # No match was found
103+
104+
- comm = len(prefix)
105+
- if tuple(prefix[:comm]) != tuple(x[:comm]):
106+
- # xfp => maps to wrong path
107+
- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm))
109108
return False
110109

111110
return True
112111
--
113-
2.38.1
112+
2.39.5 (Apple Git-154)
114113

0 commit comments

Comments
 (0)