| 633 | |
| 634 | public: |
| 635 | MuSigPubkeyProvider( |
| 636 | uint32_t exp_index, |
| 637 | std::vector<std::unique_ptr<PubkeyProvider>> providers, |
| 638 | KeyPath path, |
| 639 | DeriveType derive |
| 640 | ) |
| 641 | : PubkeyProvider(exp_index), |
| 642 | m_participants(std::move(providers)), |
| 643 | m_path(std::move(path)), |
| 644 | m_derive(derive), |
| 645 | m_ranged_participants(std::any_of(m_participants.begin(), m_participants.end(), [](const auto& pubkey) { return pubkey->IsRange(); })) |
| 646 | { |
| 647 | if (!Assume(!(m_ranged_participants && IsRangedDerivation()))) { |
| 648 | throw std::runtime_error("musig(): Cannot have both ranged participants and ranged derivation"); |
| 649 | } |
| 650 | if (!Assume(m_derive != DeriveType::HARDENED_RANGED)) { |
| 651 | throw std::runtime_error("musig(): Cannot have hardened derivation"); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | std::optional<CPubKey> GetPubKey(int pos, const SigningProvider& arg, FlatSigningProvider& out, const DescriptorCache* read_cache = nullptr, DescriptorCache* write_cache = nullptr) const override |
| 656 | { |