From 1c7f9aaf758f6c8580a889fa6af675e6b365dbbf Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 1 Jun 2026 13:00:53 -0700 Subject: [PATCH] miniscript: Don't use StringType::COMPAT Previous versions did not pass down StringType::COMPAT when that was given as the serialization string type. As COMPAT is used for descriptor id calculation, we need to maintain the previous (incorrect) behavior of not passing StringType::COMPAT. --- src/script/descriptor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 5d9e6249472..080f7c135d8 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -1661,7 +1661,11 @@ public: if (!m_pubkeys[key]->ToNormalizedString(*m_arg, ret, m_cache)) return {}; break; case DescriptorImpl::StringType::COMPAT: - ret = m_pubkeys[key]->ToString(PubkeyProvider::StringType::COMPAT); + // For backwards compatibility, we do not pass StringType::COMPAT. + // Prior to 31.0, COMPAT was not provided, so PUBLIC was in use. From this string, + // DescriptorSPKM IDs were computed from this string, so the incorrect behavior + // must be preserved for wallets with Miniscript descriptors to be loaded + ret = m_pubkeys[key]->ToString(); break; } return ret;