See https://github.com/bitcoindevkit/bdk/pull/1072#issuecomment-1819593099 and follow-up comments.