@btc-vision/transaction 1.8.6 → 1.8.7-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.js +1448 -1266
- package/browser/noble-curves.js +2179 -1307
- package/browser/noble-hashes.js +282 -261
- package/browser/rolldown-runtime.js +7 -7
- package/browser/src/_version.d.ts +1 -0
- package/browser/{abi → src/abi}/ABICoder.d.ts +0 -1
- package/browser/{abi → src/abi}/ABIDataTypes.d.ts +0 -1
- package/browser/{abi → src/abi}/AbiTypes.d.ts +0 -1
- package/browser/{abi → src/abi}/TupleUtils.d.ts +0 -1
- package/browser/{branded → src/branded}/Branded.d.ts +0 -1
- package/browser/{buffer → src/buffer}/BinaryReader.d.ts +0 -1
- package/browser/{buffer → src/buffer}/BinaryWriter.d.ts +0 -1
- package/browser/{bytecode → src/bytecode}/Compressor.d.ts +0 -1
- package/browser/{chain → src/chain}/ChainData.d.ts +1 -2
- package/browser/{consensus → src/consensus}/Consensus.d.ts +0 -1
- package/browser/{consensus → src/consensus}/ConsensusConfig.d.ts +0 -1
- package/browser/{consensus → src/consensus}/IConsensusConfig.d.ts +0 -1
- package/browser/{consensus → src/consensus}/metadata/RoswellConsensus.d.ts +0 -1
- package/browser/{crypto → src/crypto}/crypto.d.ts +1 -2
- package/browser/{deterministic → src/deterministic}/AddressMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/AddressSet.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/CustomMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/DeterministicMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/DeterministicSet.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/ExtendedAddressMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/FastMap.d.ts +0 -1
- package/browser/{ecc → src/ecc}/backend.d.ts +1 -2
- package/browser/{epoch → src/epoch}/ChallengeSolution.d.ts +0 -1
- package/browser/{epoch → src/epoch}/interfaces/IChallengeSolution.d.ts +0 -1
- package/browser/{epoch → src/epoch}/validator/EpochValidator.d.ts +0 -1
- package/browser/{event → src/event}/NetEvent.d.ts +0 -1
- package/browser/{generators → src/generators}/AddressGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/Features.d.ts +0 -1
- package/browser/{generators → src/generators}/Generator.d.ts +1 -2
- package/browser/{generators → src/generators}/MLDSAData.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/CalldataGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/CustomGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/DeploymentGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/HashCommitmentGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/LegacyCalldataGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/MultiSignGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/P2WDAGenerator.d.ts +1 -2
- package/browser/{index.d.ts → src/index.d.ts} +0 -1
- package/browser/{keypair → src/keypair}/Address.d.ts +2 -3
- package/browser/{keypair → src/keypair}/AddressVerificator.d.ts +2 -3
- package/browser/{keypair → src/keypair}/EcKeyPair.d.ts +2 -3
- package/browser/{keypair → src/keypair}/MessageSigner.d.ts +2 -3
- package/browser/{keypair → src/keypair}/Secp256k1PointDeriver.d.ts +0 -1
- package/browser/{keypair → src/keypair}/Wallet.d.ts +2 -3
- package/browser/{keypair → src/keypair}/interfaces/IWallet.d.ts +0 -1
- package/browser/{metadata → src/metadata}/ContractBaseMetadata.d.ts +1 -2
- package/browser/{mnemonic → src/mnemonic}/BIPStandard.d.ts +0 -1
- package/browser/{mnemonic → src/mnemonic}/Mnemonic.d.ts +2 -3
- package/browser/{mnemonic → src/mnemonic}/MnemonicStrength.d.ts +0 -1
- package/browser/{network → src/network}/ChainId.d.ts +0 -1
- package/browser/{opnet.d.ts → src/opnet.d.ts} +2 -2
- package/browser/{p2wda → src/p2wda}/P2WDADetector.d.ts +1 -2
- package/browser/{polyfill → src/polyfill}/disposable.d.ts +0 -1
- package/browser/{signer → src/signer}/AddressRotation.d.ts +0 -1
- package/browser/{signer → src/signer}/IRotationSigner.d.ts +1 -2
- package/browser/{signer → src/signer}/ParallelSignerAdapter.d.ts +1 -2
- package/browser/{signer → src/signer}/SignerUtils.d.ts +1 -2
- package/browser/{signer → src/signer}/TweakedSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/ContractAddress.d.ts +0 -1
- package/browser/{transaction → src/transaction}/TransactionFactory.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/BrowserSignerBase.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/WalletNetworks.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/Web3Provider.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/extensions/UnisatSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/extensions/XverseSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/types/OPWallet.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/types/Unisat.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/types/Xverse.d.ts +0 -1
- package/browser/{transaction → src/transaction}/builders/CancelTransaction.d.ts +1 -2
- package/browser/src/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/browser/{transaction → src/transaction}/builders/ConsolidatedInteractionTransaction.d.ts +0 -1
- package/browser/{transaction → src/transaction}/builders/CustomScriptTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/DeploymentTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/FundingTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/InteractionTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/InteractionTransactionP2WDA.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/MultiSignTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/SharedInteractionTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/TransactionBuilder.d.ts +1 -2
- package/browser/{transaction → src/transaction}/enums/TransactionType.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ICancelTransactionParameters.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/IConsolidatedTransactionParameters.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ICustomTransactionParameters.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/ITransactionParameters.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/ITransactionResponses.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ITweakedTransactionData.d.ts +2 -3
- package/browser/{transaction → src/transaction}/interfaces/IWeb3ProviderTypes.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/Tap.d.ts +1 -2
- package/browser/src/transaction/mineable/CSVMultisigProvider.d.ts +102 -0
- package/browser/{transaction → src/transaction}/mineable/IP2WSHAddress.d.ts +0 -1
- package/browser/{transaction → src/transaction}/mineable/TimelockGenerator.d.ts +1 -2
- package/browser/{transaction → src/transaction}/offline/OfflineTransactionManager.d.ts +1 -2
- package/browser/{transaction → src/transaction}/offline/TransactionReconstructor.d.ts +2 -3
- package/browser/{transaction → src/transaction}/offline/TransactionSerializer.d.ts +0 -1
- package/browser/{transaction → src/transaction}/offline/TransactionStateCapture.d.ts +0 -1
- package/browser/{transaction → src/transaction}/offline/interfaces/ISerializableState.d.ts +0 -1
- package/browser/{transaction → src/transaction}/offline/interfaces/ITypeSpecificData.d.ts +0 -1
- package/browser/{transaction → src/transaction}/psbt/PSBTTypes.d.ts +0 -1
- package/browser/{transaction → src/transaction}/shared/P2MR_MS.d.ts +1 -2
- package/browser/{transaction → src/transaction}/shared/P2TR_MS.d.ts +1 -2
- package/browser/{transaction → src/transaction}/shared/TweakedTransaction.d.ts +21 -3
- package/browser/{transaction → src/transaction}/utils/WitnessUtils.d.ts +0 -1
- package/browser/{utils → src/utils}/BitcoinUtils.d.ts +0 -1
- package/browser/{utils → src/utils}/BufferHelper.d.ts +0 -1
- package/browser/{utils → src/utils}/StringToBuffer.d.ts +0 -1
- package/browser/{utils → src/utils}/lengths.d.ts +0 -1
- package/browser/{utils → src/utils}/types.d.ts +0 -1
- package/browser/{utxo → src/utxo}/OPNetLimitedProvider.d.ts +1 -2
- package/browser/{utxo → src/utxo}/interfaces/BroadcastResponse.d.ts +0 -1
- package/browser/{utxo → src/utxo}/interfaces/IUTXO.d.ts +0 -1
- package/browser/{verification → src/verification}/TapscriptVerificator.d.ts +1 -2
- package/browser/vendors.js +13 -13
- package/build/_version.d.ts +1 -2
- package/build/_version.js +1 -2
- package/build/abi/ABICoder.d.ts +0 -1
- package/build/abi/ABICoder.js +0 -1
- package/build/abi/ABIDataTypes.d.ts +0 -1
- package/build/abi/ABIDataTypes.js +0 -1
- package/build/abi/AbiTypes.d.ts +0 -1
- package/build/abi/AbiTypes.js +0 -1
- package/build/abi/TupleUtils.d.ts +0 -1
- package/build/abi/TupleUtils.js +0 -1
- package/build/branded/Branded.d.ts +0 -1
- package/build/branded/Branded.js +0 -1
- package/build/buffer/BinaryReader.d.ts +0 -1
- package/build/buffer/BinaryReader.js +0 -1
- package/build/buffer/BinaryWriter.d.ts +0 -1
- package/build/buffer/BinaryWriter.js +0 -1
- package/build/bytecode/Compressor.d.ts +0 -1
- package/build/bytecode/Compressor.js +0 -1
- package/build/chain/ChainData.d.ts +0 -1
- package/build/chain/ChainData.js +0 -1
- package/build/consensus/Consensus.d.ts +0 -1
- package/build/consensus/Consensus.js +0 -1
- package/build/consensus/ConsensusConfig.d.ts +0 -1
- package/build/consensus/ConsensusConfig.js +0 -1
- package/build/consensus/IConsensusConfig.d.ts +0 -1
- package/build/consensus/IConsensusConfig.js +0 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts +0 -1
- package/build/consensus/metadata/RoswellConsensus.js +0 -1
- package/build/crypto/crypto.d.ts +0 -1
- package/build/crypto/crypto.js +0 -1
- package/build/deterministic/AddressMap.d.ts +0 -1
- package/build/deterministic/AddressMap.js +0 -1
- package/build/deterministic/AddressSet.d.ts +0 -1
- package/build/deterministic/AddressSet.js +0 -1
- package/build/deterministic/CustomMap.d.ts +0 -1
- package/build/deterministic/CustomMap.js +0 -1
- package/build/deterministic/DeterministicMap.d.ts +0 -1
- package/build/deterministic/DeterministicMap.js +0 -1
- package/build/deterministic/DeterministicSet.d.ts +0 -1
- package/build/deterministic/DeterministicSet.js +0 -1
- package/build/deterministic/ExtendedAddressMap.d.ts +0 -1
- package/build/deterministic/ExtendedAddressMap.js +0 -1
- package/build/deterministic/FastMap.d.ts +0 -1
- package/build/deterministic/FastMap.js +0 -1
- package/build/ecc/backend.d.ts +0 -1
- package/build/ecc/backend.js +0 -1
- package/build/epoch/ChallengeSolution.d.ts +0 -1
- package/build/epoch/ChallengeSolution.js +0 -1
- package/build/epoch/interfaces/IChallengeSolution.d.ts +0 -1
- package/build/epoch/interfaces/IChallengeSolution.js +0 -1
- package/build/epoch/validator/EpochValidator.d.ts +0 -1
- package/build/epoch/validator/EpochValidator.js +0 -1
- package/build/event/NetEvent.d.ts +0 -1
- package/build/event/NetEvent.js +0 -1
- package/build/generators/AddressGenerator.d.ts +0 -1
- package/build/generators/AddressGenerator.js +0 -1
- package/build/generators/Features.d.ts +0 -1
- package/build/generators/Features.js +0 -1
- package/build/generators/Generator.d.ts +0 -1
- package/build/generators/Generator.js +0 -1
- package/build/generators/MLDSAData.d.ts +0 -1
- package/build/generators/MLDSAData.js +0 -1
- package/build/generators/builders/CalldataGenerator.d.ts +0 -1
- package/build/generators/builders/CalldataGenerator.js +0 -1
- package/build/generators/builders/CustomGenerator.d.ts +0 -1
- package/build/generators/builders/CustomGenerator.js +0 -1
- package/build/generators/builders/DeploymentGenerator.d.ts +0 -1
- package/build/generators/builders/DeploymentGenerator.js +0 -1
- package/build/generators/builders/HashCommitmentGenerator.d.ts +0 -1
- package/build/generators/builders/HashCommitmentGenerator.js +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.js +0 -1
- package/build/generators/builders/MultiSignGenerator.d.ts +0 -1
- package/build/generators/builders/MultiSignGenerator.js +0 -1
- package/build/generators/builders/P2WDAGenerator.d.ts +0 -1
- package/build/generators/builders/P2WDAGenerator.js +0 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -1
- package/build/keypair/Address.d.ts +0 -1
- package/build/keypair/Address.js +0 -1
- package/build/keypair/AddressVerificator.d.ts +0 -1
- package/build/keypair/AddressVerificator.js +0 -1
- package/build/keypair/EcKeyPair.d.ts +0 -1
- package/build/keypair/EcKeyPair.js +0 -1
- package/build/keypair/MessageSigner.d.ts +0 -1
- package/build/keypair/MessageSigner.js +0 -1
- package/build/keypair/Secp256k1PointDeriver.d.ts +0 -1
- package/build/keypair/Secp256k1PointDeriver.js +0 -1
- package/build/keypair/Wallet.d.ts +0 -1
- package/build/keypair/Wallet.js +0 -1
- package/build/keypair/interfaces/IWallet.d.ts +0 -1
- package/build/keypair/interfaces/IWallet.js +0 -1
- package/build/metadata/ContractBaseMetadata.d.ts +0 -1
- package/build/metadata/ContractBaseMetadata.js +0 -1
- package/build/mnemonic/BIPStandard.d.ts +0 -1
- package/build/mnemonic/BIPStandard.js +0 -1
- package/build/mnemonic/Mnemonic.d.ts +0 -1
- package/build/mnemonic/Mnemonic.js +0 -1
- package/build/mnemonic/MnemonicStrength.d.ts +0 -1
- package/build/mnemonic/MnemonicStrength.js +0 -1
- package/build/network/ChainId.d.ts +0 -1
- package/build/network/ChainId.js +0 -1
- package/build/opnet.d.ts +1 -1
- package/build/opnet.js +1 -1
- package/build/p2wda/P2WDADetector.d.ts +0 -1
- package/build/p2wda/P2WDADetector.js +0 -1
- package/build/polyfill/disposable.d.ts +0 -1
- package/build/polyfill/disposable.js +0 -1
- package/build/signer/AddressRotation.d.ts +0 -1
- package/build/signer/AddressRotation.js +0 -1
- package/build/signer/IRotationSigner.d.ts +0 -1
- package/build/signer/IRotationSigner.js +0 -1
- package/build/signer/ParallelSignerAdapter.d.ts +0 -1
- package/build/signer/ParallelSignerAdapter.js +0 -1
- package/build/signer/SignerUtils.d.ts +0 -1
- package/build/signer/SignerUtils.js +0 -1
- package/build/signer/TweakedSigner.d.ts +0 -1
- package/build/signer/TweakedSigner.js +0 -1
- package/build/transaction/ContractAddress.d.ts +0 -1
- package/build/transaction/ContractAddress.js +0 -1
- package/build/transaction/TransactionFactory.d.ts +0 -1
- package/build/transaction/TransactionFactory.js +0 -1
- package/build/transaction/browser/BrowserSignerBase.d.ts +0 -1
- package/build/transaction/browser/BrowserSignerBase.js +0 -1
- package/build/transaction/browser/WalletNetworks.d.ts +0 -1
- package/build/transaction/browser/WalletNetworks.js +0 -1
- package/build/transaction/browser/Web3Provider.d.ts +0 -1
- package/build/transaction/browser/Web3Provider.js +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.js +0 -1
- package/build/transaction/browser/extensions/XverseSigner.d.ts +0 -1
- package/build/transaction/browser/extensions/XverseSigner.js +0 -1
- package/build/transaction/browser/types/OPWallet.d.ts +0 -1
- package/build/transaction/browser/types/OPWallet.js +0 -1
- package/build/transaction/browser/types/Unisat.d.ts +0 -1
- package/build/transaction/browser/types/Unisat.js +0 -1
- package/build/transaction/browser/types/Xverse.d.ts +0 -1
- package/build/transaction/browser/types/Xverse.js +0 -1
- package/build/transaction/builders/CancelTransaction.d.ts +0 -1
- package/build/transaction/builders/CancelTransaction.js +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.js +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js +0 -1
- package/build/transaction/builders/CustomScriptTransaction.d.ts +0 -1
- package/build/transaction/builders/CustomScriptTransaction.js +0 -1
- package/build/transaction/builders/DeploymentTransaction.d.ts +0 -1
- package/build/transaction/builders/DeploymentTransaction.js +0 -1
- package/build/transaction/builders/FundingTransaction.d.ts +0 -1
- package/build/transaction/builders/FundingTransaction.js +0 -1
- package/build/transaction/builders/InteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/InteractionTransaction.js +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.js +0 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts +0 -1
- package/build/transaction/builders/MultiSignTransaction.js +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.js +0 -1
- package/build/transaction/builders/TransactionBuilder.d.ts +0 -1
- package/build/transaction/builders/TransactionBuilder.js +7 -1
- package/build/transaction/enums/TransactionType.d.ts +0 -1
- package/build/transaction/enums/TransactionType.js +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.js +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.js +0 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ITransactionParameters.js +0 -1
- package/build/transaction/interfaces/ITransactionResponses.d.ts +0 -1
- package/build/transaction/interfaces/ITransactionResponses.js +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.js +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js +0 -1
- package/build/transaction/interfaces/Tap.d.ts +0 -1
- package/build/transaction/interfaces/Tap.js +0 -1
- package/build/transaction/mineable/CSVMultisigProvider.d.ts +102 -0
- package/build/transaction/mineable/CSVMultisigProvider.js +348 -0
- package/build/transaction/mineable/IP2WSHAddress.d.ts +0 -1
- package/build/transaction/mineable/IP2WSHAddress.js +0 -1
- package/build/transaction/mineable/TimelockGenerator.d.ts +0 -1
- package/build/transaction/mineable/TimelockGenerator.js +0 -1
- package/build/transaction/offline/OfflineTransactionManager.d.ts +0 -1
- package/build/transaction/offline/OfflineTransactionManager.js +0 -1
- package/build/transaction/offline/TransactionReconstructor.d.ts +0 -1
- package/build/transaction/offline/TransactionReconstructor.js +0 -1
- package/build/transaction/offline/TransactionSerializer.d.ts +0 -1
- package/build/transaction/offline/TransactionSerializer.js +0 -1
- package/build/transaction/offline/TransactionStateCapture.d.ts +0 -1
- package/build/transaction/offline/TransactionStateCapture.js +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.js +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.js +0 -1
- package/build/transaction/psbt/PSBTTypes.d.ts +0 -1
- package/build/transaction/psbt/PSBTTypes.js +0 -1
- package/build/transaction/shared/P2MR_MS.d.ts +0 -1
- package/build/transaction/shared/P2MR_MS.js +0 -1
- package/build/transaction/shared/P2TR_MS.d.ts +0 -1
- package/build/transaction/shared/P2TR_MS.js +0 -1
- package/build/transaction/shared/TweakedTransaction.d.ts +19 -1
- package/build/transaction/shared/TweakedTransaction.js +69 -7
- package/build/transaction/utils/WitnessUtils.d.ts +0 -1
- package/build/transaction/utils/WitnessUtils.js +0 -1
- package/build/utils/BitcoinUtils.d.ts +0 -1
- package/build/utils/BitcoinUtils.js +0 -1
- package/build/utils/BufferHelper.d.ts +0 -1
- package/build/utils/BufferHelper.js +0 -1
- package/build/utils/StringToBuffer.d.ts +0 -1
- package/build/utils/StringToBuffer.js +0 -1
- package/build/utils/lengths.d.ts +0 -1
- package/build/utils/lengths.js +0 -1
- package/build/utils/types.d.ts +0 -1
- package/build/utils/types.js +0 -1
- package/build/utxo/OPNetLimitedProvider.d.ts +0 -1
- package/build/utxo/OPNetLimitedProvider.js +0 -1
- package/build/utxo/interfaces/BroadcastResponse.d.ts +0 -1
- package/build/utxo/interfaces/BroadcastResponse.js +0 -1
- package/build/utxo/interfaces/IUTXO.d.ts +0 -1
- package/build/utxo/interfaces/IUTXO.js +0 -1
- package/build/verification/TapscriptVerificator.d.ts +0 -1
- package/build/verification/TapscriptVerificator.js +0 -1
- package/eslint.config.js +5 -0
- package/package.json +20 -17
- package/src/_version.ts +1 -1
- package/src/keypair/Address.ts +1 -1
- package/src/opnet.ts +1 -0
- package/src/transaction/builders/TransactionBuilder.ts +10 -0
- package/src/transaction/mineable/CSVMultisigProvider.ts +465 -0
- package/src/transaction/shared/TweakedTransaction.ts +90 -5
- package/test/csv-multisig-spend.test.ts +363 -0
- package/test/web3-provider-types.test.ts +349 -0
- package/test/zero-amount-funding.test.ts +311 -0
- package/tsconfig.base.json +2 -2
- package/tsconfig.build.json +4 -1
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +9 -3
- package/browser/_version.d.ts +0 -2
- package/browser/_version.d.ts.map +0 -1
- package/browser/abi/ABICoder.d.ts.map +0 -1
- package/browser/abi/ABIDataTypes.d.ts.map +0 -1
- package/browser/abi/AbiTypes.d.ts.map +0 -1
- package/browser/abi/TupleUtils.d.ts.map +0 -1
- package/browser/branded/Branded.d.ts.map +0 -1
- package/browser/buffer/BinaryReader.d.ts.map +0 -1
- package/browser/buffer/BinaryWriter.d.ts.map +0 -1
- package/browser/bytecode/Compressor.d.ts.map +0 -1
- package/browser/chain/ChainData.d.ts.map +0 -1
- package/browser/consensus/Consensus.d.ts.map +0 -1
- package/browser/consensus/ConsensusConfig.d.ts.map +0 -1
- package/browser/consensus/IConsensusConfig.d.ts.map +0 -1
- package/browser/consensus/metadata/RoswellConsensus.d.ts.map +0 -1
- package/browser/crypto/crypto.d.ts.map +0 -1
- package/browser/deterministic/AddressMap.d.ts.map +0 -1
- package/browser/deterministic/AddressSet.d.ts.map +0 -1
- package/browser/deterministic/CustomMap.d.ts.map +0 -1
- package/browser/deterministic/DeterministicMap.d.ts.map +0 -1
- package/browser/deterministic/DeterministicSet.d.ts.map +0 -1
- package/browser/deterministic/ExtendedAddressMap.d.ts.map +0 -1
- package/browser/deterministic/FastMap.d.ts.map +0 -1
- package/browser/ecc/backend.d.ts.map +0 -1
- package/browser/epoch/ChallengeSolution.d.ts.map +0 -1
- package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +0 -1
- package/browser/epoch/validator/EpochValidator.d.ts.map +0 -1
- package/browser/event/NetEvent.d.ts.map +0 -1
- package/browser/generators/AddressGenerator.d.ts.map +0 -1
- package/browser/generators/Features.d.ts.map +0 -1
- package/browser/generators/Generator.d.ts.map +0 -1
- package/browser/generators/MLDSAData.d.ts.map +0 -1
- package/browser/generators/builders/CalldataGenerator.d.ts.map +0 -1
- package/browser/generators/builders/CustomGenerator.d.ts.map +0 -1
- package/browser/generators/builders/DeploymentGenerator.d.ts.map +0 -1
- package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +0 -1
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +0 -1
- package/browser/generators/builders/MultiSignGenerator.d.ts.map +0 -1
- package/browser/generators/builders/P2WDAGenerator.d.ts.map +0 -1
- package/browser/index.d.ts.map +0 -1
- package/browser/keypair/Address.d.ts.map +0 -1
- package/browser/keypair/AddressVerificator.d.ts.map +0 -1
- package/browser/keypair/EcKeyPair.d.ts.map +0 -1
- package/browser/keypair/MessageSigner.d.ts.map +0 -1
- package/browser/keypair/Secp256k1PointDeriver.d.ts.map +0 -1
- package/browser/keypair/Wallet.d.ts.map +0 -1
- package/browser/keypair/interfaces/IWallet.d.ts.map +0 -1
- package/browser/metadata/ContractBaseMetadata.d.ts.map +0 -1
- package/browser/mnemonic/BIPStandard.d.ts.map +0 -1
- package/browser/mnemonic/Mnemonic.d.ts.map +0 -1
- package/browser/mnemonic/MnemonicStrength.d.ts.map +0 -1
- package/browser/network/ChainId.d.ts.map +0 -1
- package/browser/opnet.d.ts.map +0 -1
- package/browser/p2wda/P2WDADetector.d.ts.map +0 -1
- package/browser/polyfill/disposable.d.ts.map +0 -1
- package/browser/signer/AddressRotation.d.ts.map +0 -1
- package/browser/signer/IRotationSigner.d.ts.map +0 -1
- package/browser/signer/ParallelSignerAdapter.d.ts.map +0 -1
- package/browser/signer/SignerUtils.d.ts.map +0 -1
- package/browser/signer/TweakedSigner.d.ts.map +0 -1
- package/browser/transaction/ContractAddress.d.ts.map +0 -1
- package/browser/transaction/TransactionFactory.d.ts.map +0 -1
- package/browser/transaction/browser/BrowserSignerBase.d.ts.map +0 -1
- package/browser/transaction/browser/WalletNetworks.d.ts.map +0 -1
- package/browser/transaction/browser/Web3Provider.d.ts.map +0 -1
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +0 -1
- package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +0 -1
- package/browser/transaction/browser/types/OPWallet.d.ts.map +0 -1
- package/browser/transaction/browser/types/Unisat.d.ts.map +0 -1
- package/browser/transaction/browser/types/Xverse.d.ts.map +0 -1
- package/browser/transaction/builders/CancelTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +0 -2
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/DeploymentTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/FundingTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/InteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +0 -1
- package/browser/transaction/builders/MultiSignTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/TransactionBuilder.d.ts.map +0 -1
- package/browser/transaction/enums/TransactionType.d.ts.map +0 -1
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +0 -1
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +0 -1
- package/browser/transaction/interfaces/Tap.d.ts.map +0 -1
- package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +0 -1
- package/browser/transaction/mineable/TimelockGenerator.d.ts.map +0 -1
- package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionReconstructor.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionSerializer.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionStateCapture.d.ts.map +0 -1
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +0 -1
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +0 -1
- package/browser/transaction/psbt/PSBTTypes.d.ts.map +0 -1
- package/browser/transaction/shared/P2MR_MS.d.ts.map +0 -1
- package/browser/transaction/shared/P2TR_MS.d.ts.map +0 -1
- package/browser/transaction/shared/TweakedTransaction.d.ts.map +0 -1
- package/browser/transaction/utils/WitnessUtils.d.ts.map +0 -1
- package/browser/utils/BitcoinUtils.d.ts.map +0 -1
- package/browser/utils/BufferHelper.d.ts.map +0 -1
- package/browser/utils/StringToBuffer.d.ts.map +0 -1
- package/browser/utils/lengths.d.ts.map +0 -1
- package/browser/utils/types.d.ts.map +0 -1
- package/browser/utxo/OPNetLimitedProvider.d.ts.map +0 -1
- package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +0 -1
- package/browser/utxo/interfaces/IUTXO.d.ts.map +0 -1
- package/browser/verification/TapscriptVerificator.d.ts.map +0 -1
- package/build/_version.d.ts.map +0 -1
- package/build/_version.js.map +0 -1
- package/build/abi/ABICoder.d.ts.map +0 -1
- package/build/abi/ABICoder.js.map +0 -1
- package/build/abi/ABIDataTypes.d.ts.map +0 -1
- package/build/abi/ABIDataTypes.js.map +0 -1
- package/build/abi/AbiTypes.d.ts.map +0 -1
- package/build/abi/AbiTypes.js.map +0 -1
- package/build/abi/TupleUtils.d.ts.map +0 -1
- package/build/abi/TupleUtils.js.map +0 -1
- package/build/branded/Branded.d.ts.map +0 -1
- package/build/branded/Branded.js.map +0 -1
- package/build/buffer/BinaryReader.d.ts.map +0 -1
- package/build/buffer/BinaryReader.js.map +0 -1
- package/build/buffer/BinaryWriter.d.ts.map +0 -1
- package/build/buffer/BinaryWriter.js.map +0 -1
- package/build/bytecode/Compressor.d.ts.map +0 -1
- package/build/bytecode/Compressor.js.map +0 -1
- package/build/chain/ChainData.d.ts.map +0 -1
- package/build/chain/ChainData.js.map +0 -1
- package/build/consensus/Consensus.d.ts.map +0 -1
- package/build/consensus/Consensus.js.map +0 -1
- package/build/consensus/ConsensusConfig.d.ts.map +0 -1
- package/build/consensus/ConsensusConfig.js.map +0 -1
- package/build/consensus/IConsensusConfig.d.ts.map +0 -1
- package/build/consensus/IConsensusConfig.js.map +0 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts.map +0 -1
- package/build/consensus/metadata/RoswellConsensus.js.map +0 -1
- package/build/crypto/crypto.d.ts.map +0 -1
- package/build/crypto/crypto.js.map +0 -1
- package/build/deterministic/AddressMap.d.ts.map +0 -1
- package/build/deterministic/AddressMap.js.map +0 -1
- package/build/deterministic/AddressSet.d.ts.map +0 -1
- package/build/deterministic/AddressSet.js.map +0 -1
- package/build/deterministic/CustomMap.d.ts.map +0 -1
- package/build/deterministic/CustomMap.js.map +0 -1
- package/build/deterministic/DeterministicMap.d.ts.map +0 -1
- package/build/deterministic/DeterministicMap.js.map +0 -1
- package/build/deterministic/DeterministicSet.d.ts.map +0 -1
- package/build/deterministic/DeterministicSet.js.map +0 -1
- package/build/deterministic/ExtendedAddressMap.d.ts.map +0 -1
- package/build/deterministic/ExtendedAddressMap.js.map +0 -1
- package/build/deterministic/FastMap.d.ts.map +0 -1
- package/build/deterministic/FastMap.js.map +0 -1
- package/build/ecc/backend.d.ts.map +0 -1
- package/build/ecc/backend.js.map +0 -1
- package/build/epoch/ChallengeSolution.d.ts.map +0 -1
- package/build/epoch/ChallengeSolution.js.map +0 -1
- package/build/epoch/interfaces/IChallengeSolution.d.ts.map +0 -1
- package/build/epoch/interfaces/IChallengeSolution.js.map +0 -1
- package/build/epoch/validator/EpochValidator.d.ts.map +0 -1
- package/build/epoch/validator/EpochValidator.js.map +0 -1
- package/build/event/NetEvent.d.ts.map +0 -1
- package/build/event/NetEvent.js.map +0 -1
- package/build/generators/AddressGenerator.d.ts.map +0 -1
- package/build/generators/AddressGenerator.js.map +0 -1
- package/build/generators/Features.d.ts.map +0 -1
- package/build/generators/Features.js.map +0 -1
- package/build/generators/Generator.d.ts.map +0 -1
- package/build/generators/Generator.js.map +0 -1
- package/build/generators/MLDSAData.d.ts.map +0 -1
- package/build/generators/MLDSAData.js.map +0 -1
- package/build/generators/builders/CalldataGenerator.d.ts.map +0 -1
- package/build/generators/builders/CalldataGenerator.js.map +0 -1
- package/build/generators/builders/CustomGenerator.d.ts.map +0 -1
- package/build/generators/builders/CustomGenerator.js.map +0 -1
- package/build/generators/builders/DeploymentGenerator.d.ts.map +0 -1
- package/build/generators/builders/DeploymentGenerator.js.map +0 -1
- package/build/generators/builders/HashCommitmentGenerator.d.ts.map +0 -1
- package/build/generators/builders/HashCommitmentGenerator.js.map +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.js.map +0 -1
- package/build/generators/builders/MultiSignGenerator.d.ts.map +0 -1
- package/build/generators/builders/MultiSignGenerator.js.map +0 -1
- package/build/generators/builders/P2WDAGenerator.d.ts.map +0 -1
- package/build/generators/builders/P2WDAGenerator.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/keypair/Address.d.ts.map +0 -1
- package/build/keypair/Address.js.map +0 -1
- package/build/keypair/AddressVerificator.d.ts.map +0 -1
- package/build/keypair/AddressVerificator.js.map +0 -1
- package/build/keypair/EcKeyPair.d.ts.map +0 -1
- package/build/keypair/EcKeyPair.js.map +0 -1
- package/build/keypair/MessageSigner.d.ts.map +0 -1
- package/build/keypair/MessageSigner.js.map +0 -1
- package/build/keypair/Secp256k1PointDeriver.d.ts.map +0 -1
- package/build/keypair/Secp256k1PointDeriver.js.map +0 -1
- package/build/keypair/Wallet.d.ts.map +0 -1
- package/build/keypair/Wallet.js.map +0 -1
- package/build/keypair/interfaces/IWallet.d.ts.map +0 -1
- package/build/keypair/interfaces/IWallet.js.map +0 -1
- package/build/metadata/ContractBaseMetadata.d.ts.map +0 -1
- package/build/metadata/ContractBaseMetadata.js.map +0 -1
- package/build/mnemonic/BIPStandard.d.ts.map +0 -1
- package/build/mnemonic/BIPStandard.js.map +0 -1
- package/build/mnemonic/Mnemonic.d.ts.map +0 -1
- package/build/mnemonic/Mnemonic.js.map +0 -1
- package/build/mnemonic/MnemonicStrength.d.ts.map +0 -1
- package/build/mnemonic/MnemonicStrength.js.map +0 -1
- package/build/network/ChainId.d.ts.map +0 -1
- package/build/network/ChainId.js.map +0 -1
- package/build/opnet.d.ts.map +0 -1
- package/build/opnet.js.map +0 -1
- package/build/p2wda/P2WDADetector.d.ts.map +0 -1
- package/build/p2wda/P2WDADetector.js.map +0 -1
- package/build/polyfill/disposable.d.ts.map +0 -1
- package/build/polyfill/disposable.js.map +0 -1
- package/build/signer/AddressRotation.d.ts.map +0 -1
- package/build/signer/AddressRotation.js.map +0 -1
- package/build/signer/IRotationSigner.d.ts.map +0 -1
- package/build/signer/IRotationSigner.js.map +0 -1
- package/build/signer/ParallelSignerAdapter.d.ts.map +0 -1
- package/build/signer/ParallelSignerAdapter.js.map +0 -1
- package/build/signer/SignerUtils.d.ts.map +0 -1
- package/build/signer/SignerUtils.js.map +0 -1
- package/build/signer/TweakedSigner.d.ts.map +0 -1
- package/build/signer/TweakedSigner.js.map +0 -1
- package/build/transaction/ContractAddress.d.ts.map +0 -1
- package/build/transaction/ContractAddress.js.map +0 -1
- package/build/transaction/TransactionFactory.d.ts.map +0 -1
- package/build/transaction/TransactionFactory.js.map +0 -1
- package/build/transaction/browser/BrowserSignerBase.d.ts.map +0 -1
- package/build/transaction/browser/BrowserSignerBase.js.map +0 -1
- package/build/transaction/browser/WalletNetworks.d.ts.map +0 -1
- package/build/transaction/browser/WalletNetworks.js.map +0 -1
- package/build/transaction/browser/Web3Provider.d.ts.map +0 -1
- package/build/transaction/browser/Web3Provider.js.map +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.js.map +0 -1
- package/build/transaction/browser/extensions/XverseSigner.d.ts.map +0 -1
- package/build/transaction/browser/extensions/XverseSigner.js.map +0 -1
- package/build/transaction/browser/types/OPWallet.d.ts.map +0 -1
- package/build/transaction/browser/types/OPWallet.js.map +0 -1
- package/build/transaction/browser/types/Unisat.d.ts.map +0 -1
- package/build/transaction/browser/types/Unisat.js.map +0 -1
- package/build/transaction/browser/types/Xverse.d.ts.map +0 -1
- package/build/transaction/browser/types/Xverse.js.map +0 -1
- package/build/transaction/builders/CancelTransaction.d.ts.map +0 -1
- package/build/transaction/builders/CancelTransaction.js.map +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.js.map +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +0 -1
- package/build/transaction/builders/CustomScriptTransaction.d.ts.map +0 -1
- package/build/transaction/builders/CustomScriptTransaction.js.map +0 -1
- package/build/transaction/builders/DeploymentTransaction.d.ts.map +0 -1
- package/build/transaction/builders/DeploymentTransaction.js.map +0 -1
- package/build/transaction/builders/FundingTransaction.d.ts.map +0 -1
- package/build/transaction/builders/FundingTransaction.js.map +0 -1
- package/build/transaction/builders/InteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/InteractionTransaction.js.map +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.js.map +0 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts.map +0 -1
- package/build/transaction/builders/MultiSignTransaction.js.map +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.js.map +0 -1
- package/build/transaction/builders/TransactionBuilder.d.ts.map +0 -1
- package/build/transaction/builders/TransactionBuilder.js.map +0 -1
- package/build/transaction/enums/TransactionType.d.ts.map +0 -1
- package/build/transaction/enums/TransactionType.js.map +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ITransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ITransactionResponses.d.ts.map +0 -1
- package/build/transaction/interfaces/ITransactionResponses.js.map +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.js.map +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +0 -1
- package/build/transaction/interfaces/Tap.d.ts.map +0 -1
- package/build/transaction/interfaces/Tap.js.map +0 -1
- package/build/transaction/mineable/IP2WSHAddress.d.ts.map +0 -1
- package/build/transaction/mineable/IP2WSHAddress.js.map +0 -1
- package/build/transaction/mineable/TimelockGenerator.d.ts.map +0 -1
- package/build/transaction/mineable/TimelockGenerator.js.map +0 -1
- package/build/transaction/offline/OfflineTransactionManager.d.ts.map +0 -1
- package/build/transaction/offline/OfflineTransactionManager.js.map +0 -1
- package/build/transaction/offline/TransactionReconstructor.d.ts.map +0 -1
- package/build/transaction/offline/TransactionReconstructor.js.map +0 -1
- package/build/transaction/offline/TransactionSerializer.d.ts.map +0 -1
- package/build/transaction/offline/TransactionSerializer.js.map +0 -1
- package/build/transaction/offline/TransactionStateCapture.d.ts.map +0 -1
- package/build/transaction/offline/TransactionStateCapture.js.map +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.js.map +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +0 -1
- package/build/transaction/psbt/PSBTTypes.d.ts.map +0 -1
- package/build/transaction/psbt/PSBTTypes.js.map +0 -1
- package/build/transaction/shared/P2MR_MS.d.ts.map +0 -1
- package/build/transaction/shared/P2MR_MS.js.map +0 -1
- package/build/transaction/shared/P2TR_MS.d.ts.map +0 -1
- package/build/transaction/shared/P2TR_MS.js.map +0 -1
- package/build/transaction/shared/TweakedTransaction.d.ts.map +0 -1
- package/build/transaction/shared/TweakedTransaction.js.map +0 -1
- package/build/transaction/utils/WitnessUtils.d.ts.map +0 -1
- package/build/transaction/utils/WitnessUtils.js.map +0 -1
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/utils/BitcoinUtils.d.ts.map +0 -1
- package/build/utils/BitcoinUtils.js.map +0 -1
- package/build/utils/BufferHelper.d.ts.map +0 -1
- package/build/utils/BufferHelper.js.map +0 -1
- package/build/utils/StringToBuffer.d.ts.map +0 -1
- package/build/utils/StringToBuffer.js.map +0 -1
- package/build/utils/lengths.d.ts.map +0 -1
- package/build/utils/lengths.js.map +0 -1
- package/build/utils/types.d.ts.map +0 -1
- package/build/utils/types.js.map +0 -1
- package/build/utxo/OPNetLimitedProvider.d.ts.map +0 -1
- package/build/utxo/OPNetLimitedProvider.js.map +0 -1
- package/build/utxo/interfaces/BroadcastResponse.d.ts.map +0 -1
- package/build/utxo/interfaces/BroadcastResponse.js.map +0 -1
- package/build/utxo/interfaces/IUTXO.d.ts.map +0 -1
- package/build/utxo/interfaces/IUTXO.js.map +0 -1
- package/build/verification/TapscriptVerificator.d.ts.map +0 -1
- package/build/verification/TapscriptVerificator.js.map +0 -1
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import {
|
|
2
|
+
equals,
|
|
3
|
+
fromHex,
|
|
4
|
+
isP2TR,
|
|
5
|
+
type Network,
|
|
6
|
+
opcodes,
|
|
7
|
+
payments,
|
|
8
|
+
type Psbt,
|
|
9
|
+
type Script,
|
|
10
|
+
script,
|
|
11
|
+
type TapScriptSig,
|
|
12
|
+
type XOnlyPublicKey,
|
|
13
|
+
} from '@btc-vision/bitcoin';
|
|
14
|
+
import { witnessStackToScriptWitness } from '../utils/WitnessUtils.js';
|
|
15
|
+
import type { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
16
|
+
|
|
17
|
+
export const NUMS_INTERNAL_KEY: Uint8Array = fromHex(
|
|
18
|
+
'50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0',
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const LEAF_VERSION_TAPSCRIPT = 0xc0;
|
|
22
|
+
|
|
23
|
+
export interface CSVMultisigConfig {
|
|
24
|
+
/** x,only (32 byte) pubkeys. Signature order is the reverse of this array. */
|
|
25
|
+
pubkeys: XOnlyPublicKey[];
|
|
26
|
+
|
|
27
|
+
/** k of n threshold, fixed at 2 for CSV2Multisig but kept configurable. */
|
|
28
|
+
threshold: number;
|
|
29
|
+
|
|
30
|
+
/** Block,based relative lock, 1..65535. */
|
|
31
|
+
csvBlocks: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CSVMultisigAddress {
|
|
35
|
+
address: string;
|
|
36
|
+
tapscript: Uint8Array;
|
|
37
|
+
scriptPubKey: Uint8Array;
|
|
38
|
+
controlBlock: Uint8Array;
|
|
39
|
+
internalPubkey: Uint8Array;
|
|
40
|
+
leafVersion: number;
|
|
41
|
+
config: CSVMultisigConfig;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class CSVMultisigProvider {
|
|
45
|
+
public static readonly NUMS_INTERNAL_KEY = NUMS_INTERNAL_KEY;
|
|
46
|
+
public static readonly LEAF_VERSION = LEAF_VERSION_TAPSCRIPT;
|
|
47
|
+
|
|
48
|
+
/** Build the CSV + k of n CHECKSIGADD tapscript. */
|
|
49
|
+
public static buildTapscript(cfg: CSVMultisigConfig): Script {
|
|
50
|
+
if (cfg.csvBlocks < 1 || cfg.csvBlocks > 0xffff) {
|
|
51
|
+
throw new Error('csvBlocks must be between 1 and 65535');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (cfg.pubkeys.length === 0) {
|
|
55
|
+
throw new Error('At least one pubkey required');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (cfg.threshold < 1 || cfg.threshold > cfg.pubkeys.length) {
|
|
59
|
+
throw new Error('Invalid threshold');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
for (const pk of cfg.pubkeys) {
|
|
63
|
+
if (pk.length !== 32) {
|
|
64
|
+
throw new Error('Tapscript pubkeys must be 32 bytes (x,only)');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const chunks: (number | Uint8Array)[] = [];
|
|
69
|
+
|
|
70
|
+
// Relative timelock gate
|
|
71
|
+
chunks.push(script.number.encode(cfg.csvBlocks));
|
|
72
|
+
chunks.push(opcodes.OP_CHECKSEQUENCEVERIFY);
|
|
73
|
+
chunks.push(opcodes.OP_DROP);
|
|
74
|
+
|
|
75
|
+
// k of n multisig
|
|
76
|
+
chunks.push(cfg.pubkeys[0] as XOnlyPublicKey, opcodes.OP_CHECKSIG);
|
|
77
|
+
for (let i = 1; i < cfg.pubkeys.length; i++) {
|
|
78
|
+
chunks.push(cfg.pubkeys[i] as XOnlyPublicKey, opcodes.OP_CHECKSIGADD);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (cfg.threshold >= 1 && cfg.threshold <= 16) {
|
|
82
|
+
chunks.push(opcodes.OP_1 + cfg.threshold - 1);
|
|
83
|
+
} else {
|
|
84
|
+
chunks.push(script.number.encode(cfg.threshold));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
chunks.push(opcodes.OP_NUMEQUAL);
|
|
88
|
+
|
|
89
|
+
return script.compile(chunks);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Convenience: 2 of N with fixed threshold. */
|
|
93
|
+
public static buildCSV2MultisigTapscript(
|
|
94
|
+
pubkeys: XOnlyPublicKey[],
|
|
95
|
+
csvBlocks: number,
|
|
96
|
+
): Uint8Array {
|
|
97
|
+
return this.buildTapscript({ pubkeys, threshold: 2, csvBlocks });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Single leaf tree, NUMS internal key, key path is unspendable. */
|
|
101
|
+
public static generateAddress(cfg: CSVMultisigConfig, network: Network): CSVMultisigAddress {
|
|
102
|
+
const tapscript = this.buildTapscript(cfg);
|
|
103
|
+
|
|
104
|
+
const p2tr = payments.p2tr({
|
|
105
|
+
internalPubkey: NUMS_INTERNAL_KEY as XOnlyPublicKey,
|
|
106
|
+
scriptTree: { output: tapscript },
|
|
107
|
+
redeem: {
|
|
108
|
+
output: tapscript,
|
|
109
|
+
redeemVersion: LEAF_VERSION_TAPSCRIPT,
|
|
110
|
+
},
|
|
111
|
+
network,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (!p2tr.address || !p2tr.output || !p2tr.witness || p2tr.witness.length < 2) {
|
|
115
|
+
throw new Error('Failed to generate CSV multisig P2TR address');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const control = p2tr.witness[p2tr.witness.length - 1];
|
|
119
|
+
if (!control) {
|
|
120
|
+
throw new Error('Failed to generate CSV multisig P2TR address');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
address: p2tr.address,
|
|
125
|
+
tapscript,
|
|
126
|
+
scriptPubKey: p2tr.output,
|
|
127
|
+
controlBlock: control,
|
|
128
|
+
internalPubkey: NUMS_INTERNAL_KEY,
|
|
129
|
+
leafVersion: LEAF_VERSION_TAPSCRIPT,
|
|
130
|
+
config: cfg,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Encode the nSequence value the spending input must use.
|
|
136
|
+
* BIP 68: disable bit (1 << 31) = 0, type,flag (1 << 22) = 0 for blocks,
|
|
137
|
+
* low 16 bits carry the block count.
|
|
138
|
+
*/
|
|
139
|
+
public static encodeSequence(csvBlocks: number): number {
|
|
140
|
+
if (csvBlocks < 1 || csvBlocks > 0xffff) {
|
|
141
|
+
throw new Error('csvBlocks out of range');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return csvBlocks & 0x0000ffff;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Build witness stack for a script path spend.
|
|
149
|
+
*
|
|
150
|
+
* Returns { witness, sequence }. The caller MUST set nSequence = sequence
|
|
151
|
+
* on the spending input, otherwise OP_CHECKSEQUENCEVERIFY will fail.
|
|
152
|
+
* Transaction nVersion must be >= 2 for CSV to be enforced at all.
|
|
153
|
+
*/
|
|
154
|
+
public static buildSpendWitness(
|
|
155
|
+
signatures: Uint8Array[],
|
|
156
|
+
addr: CSVMultisigAddress,
|
|
157
|
+
): { witness: Uint8Array[]; sequence: number } {
|
|
158
|
+
const { config, tapscript, controlBlock } = addr;
|
|
159
|
+
|
|
160
|
+
if (signatures.length !== config.pubkeys.length) {
|
|
161
|
+
throw new Error('signatures length must match pubkeys length');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
for (const sig of signatures) {
|
|
165
|
+
if (sig.length !== 0 && sig.length !== 64 && sig.length !== 65) {
|
|
166
|
+
throw new Error('Each sig must be empty, 64, or 65 bytes');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const provided = signatures.filter((s) => s.length > 0).length;
|
|
171
|
+
if (provided < config.threshold) {
|
|
172
|
+
throw new Error(`Need ${config.threshold} signatures, got ${provided}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const witness: Uint8Array[] = [];
|
|
176
|
+
|
|
177
|
+
// Reverse pubkey order: sig for pubkeys[0] must end up on top of stack.
|
|
178
|
+
for (let i = signatures.length - 1; i >= 0; i--) {
|
|
179
|
+
witness.push(signatures[i] as Uint8Array);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
witness.push(tapscript);
|
|
183
|
+
witness.push(controlBlock);
|
|
184
|
+
|
|
185
|
+
return { witness, sequence: this.encodeSequence(config.csvBlocks) };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public static isP2TRScriptPubKey(scriptPubKey: Uint8Array): boolean {
|
|
189
|
+
return isP2TR(scriptPubKey);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Derive the full CSV multisig address from just the tapscript.
|
|
194
|
+
*
|
|
195
|
+
* The tapscript alone fully determines the address because:
|
|
196
|
+
* - the internal key is the hard coded NUMS point,
|
|
197
|
+
* - the tap tree is a single leaf,
|
|
198
|
+
* - the leaf version is LEAF_VERSION_TAPSCRIPT (0xc0).
|
|
199
|
+
*
|
|
200
|
+
* Returns null when the tapscript does not match the CSV multisig shape.
|
|
201
|
+
*/
|
|
202
|
+
public static deriveAddressFromTapscript(
|
|
203
|
+
tapscript: Uint8Array,
|
|
204
|
+
network: Network,
|
|
205
|
+
): CSVMultisigAddress | null {
|
|
206
|
+
const config = this.parseTapscript(tapscript);
|
|
207
|
+
if (!config) return null;
|
|
208
|
+
|
|
209
|
+
return this.generateAddress(config, network);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Witness stack size needed for fee estimation.
|
|
214
|
+
*
|
|
215
|
+
* threshold 64-byte Schnorr sigs at the bottom (pushed first by the caller),
|
|
216
|
+
* plus (n - threshold) empty placeholders for unsigned slots,
|
|
217
|
+
* plus the tapscript, plus the control block.
|
|
218
|
+
*/
|
|
219
|
+
public static buildDummyWitness(addr: CSVMultisigAddress): Uint8Array[] {
|
|
220
|
+
const { config, tapscript, controlBlock } = addr;
|
|
221
|
+
const witness: Uint8Array[] = [];
|
|
222
|
+
|
|
223
|
+
// Position 0..n-1 maps to pubkey n-1..0 on the stack.
|
|
224
|
+
// For estimation we put real 64-byte sigs in the last `threshold` positions
|
|
225
|
+
// (matching the highest-indexed pubkeys), and empties elsewhere.
|
|
226
|
+
for (let i = 0; i < config.pubkeys.length; i++) {
|
|
227
|
+
const stackPos = config.pubkeys.length - 1 - i;
|
|
228
|
+
if (stackPos < config.threshold) {
|
|
229
|
+
witness.push(new Uint8Array(64));
|
|
230
|
+
} else {
|
|
231
|
+
witness.push(new Uint8Array(0));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
witness.push(tapscript);
|
|
236
|
+
witness.push(controlBlock);
|
|
237
|
+
return witness;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Build the final witness stack from collected PSBT tapScriptSig entries.
|
|
242
|
+
*
|
|
243
|
+
* Each entry is matched to its pubkey in the tapscript. Missing entries
|
|
244
|
+
* produce empty (zero-length) placeholders so the remaining signatures can
|
|
245
|
+
* still validate at positions above threshold.
|
|
246
|
+
*/
|
|
247
|
+
public static buildFinalWitnessFromTapScriptSigs(
|
|
248
|
+
tapScriptSigs: readonly TapScriptSig[],
|
|
249
|
+
addr: CSVMultisigAddress,
|
|
250
|
+
): Uint8Array[] {
|
|
251
|
+
const { config, tapscript, controlBlock } = addr;
|
|
252
|
+
|
|
253
|
+
const sigsByPubkey = new Map<string, Uint8Array>();
|
|
254
|
+
for (const entry of tapScriptSigs) {
|
|
255
|
+
if (!entry.pubkey || entry.pubkey.length !== 32) continue;
|
|
256
|
+
sigsByPubkey.set(toHexKey(entry.pubkey), entry.signature);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const ordered: Uint8Array[] = [];
|
|
260
|
+
let provided = 0;
|
|
261
|
+
for (const pk of config.pubkeys) {
|
|
262
|
+
const sig = sigsByPubkey.get(toHexKey(pk));
|
|
263
|
+
if (sig) {
|
|
264
|
+
if (sig.length !== 64 && sig.length !== 65) {
|
|
265
|
+
throw new Error(
|
|
266
|
+
`Invalid Schnorr signature length ${sig.length} for CSV multisig spend`,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
ordered.push(sig);
|
|
271
|
+
provided++;
|
|
272
|
+
} else {
|
|
273
|
+
ordered.push(new Uint8Array(0));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (provided < config.threshold) {
|
|
278
|
+
throw new Error(
|
|
279
|
+
`CSV multisig spend needs ${config.threshold} signatures, got ${provided}`,
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const witness: Uint8Array[] = [];
|
|
284
|
+
// Reverse pubkey order so that the signature for pubkeys[0] lands on top of the stack.
|
|
285
|
+
for (let i = ordered.length - 1; i >= 0; i--) {
|
|
286
|
+
witness.push(ordered[i] as Uint8Array);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
witness.push(tapscript);
|
|
290
|
+
witness.push(controlBlock);
|
|
291
|
+
return witness;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* True when this UTXO is a CSV multisig P2TR output that this provider can spend.
|
|
296
|
+
*
|
|
297
|
+
* Requires both the P2TR scriptPubKey and a witnessScript (the tapscript) on
|
|
298
|
+
* the UTXO, and checks the tapscript shape AND that the scriptPubKey matches
|
|
299
|
+
* the address derived from that tapscript (prevents spoofed witnessScripts).
|
|
300
|
+
*/
|
|
301
|
+
public static isSpendableUTXO(utxo: UTXO, network: Network): boolean {
|
|
302
|
+
if (!utxo.witnessScript) return false;
|
|
303
|
+
|
|
304
|
+
const scriptPub = fromHex(utxo.scriptPubKey.hex);
|
|
305
|
+
if (!isP2TR(scriptPub)) return false;
|
|
306
|
+
|
|
307
|
+
const tapscript =
|
|
308
|
+
utxo.witnessScript instanceof Uint8Array
|
|
309
|
+
? utxo.witnessScript
|
|
310
|
+
: fromHex(utxo.witnessScript);
|
|
311
|
+
|
|
312
|
+
const addr = this.deriveAddressFromTapscript(tapscript, network);
|
|
313
|
+
if (!addr) return false;
|
|
314
|
+
|
|
315
|
+
return equals(addr.scriptPubKey, scriptPub);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Parse a tapscript that matches the CSV + CHECKSIGADD multisig shape.
|
|
320
|
+
* Returns null if the script does not match.
|
|
321
|
+
*/
|
|
322
|
+
public static parseTapscript(tapscript: Uint8Array): CSVMultisigConfig | null {
|
|
323
|
+
const d = script.decompile(tapscript);
|
|
324
|
+
if (!d || d.length < 6) return null;
|
|
325
|
+
|
|
326
|
+
// <csvBlocks> CSV DROP
|
|
327
|
+
// Small values (1..16) are minimally encoded as OP_N opcodes by
|
|
328
|
+
// script.compile, so the chunk may be a number rather than a Uint8Array.
|
|
329
|
+
const csvChunk = d[0];
|
|
330
|
+
let csvBlocks: number;
|
|
331
|
+
if (csvChunk instanceof Uint8Array) {
|
|
332
|
+
try {
|
|
333
|
+
csvBlocks = script.number.decode(csvChunk as Buffer);
|
|
334
|
+
} catch {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
} else if (
|
|
338
|
+
typeof csvChunk === 'number' &&
|
|
339
|
+
csvChunk >= opcodes.OP_1 &&
|
|
340
|
+
csvChunk <= opcodes.OP_16
|
|
341
|
+
) {
|
|
342
|
+
csvBlocks = csvChunk - opcodes.OP_1 + 1;
|
|
343
|
+
} else {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (d[1] !== opcodes.OP_CHECKSEQUENCEVERIFY) return null;
|
|
348
|
+
if (d[2] !== opcodes.OP_DROP) return null;
|
|
349
|
+
|
|
350
|
+
// <pk1> CHECKSIG
|
|
351
|
+
let i = 3;
|
|
352
|
+
if (
|
|
353
|
+
!(d[i] instanceof Uint8Array) ||
|
|
354
|
+
(d[i] as Uint8Array).length !== 32 ||
|
|
355
|
+
d[i + 1] !== opcodes.OP_CHECKSIG
|
|
356
|
+
) {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const pubkeys: XOnlyPublicKey[] = [d[i] as XOnlyPublicKey];
|
|
361
|
+
i += 2;
|
|
362
|
+
|
|
363
|
+
// <pkN> CHECKSIGADD pairs
|
|
364
|
+
while (
|
|
365
|
+
i + 1 < d.length &&
|
|
366
|
+
d[i] instanceof Uint8Array &&
|
|
367
|
+
(d[i] as Uint8Array).length === 32 &&
|
|
368
|
+
d[i + 1] === opcodes.OP_CHECKSIGADD
|
|
369
|
+
) {
|
|
370
|
+
pubkeys.push(d[i] as XOnlyPublicKey);
|
|
371
|
+
i += 2;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// threshold + OP_NUMEQUAL at the end
|
|
375
|
+
if (i + 2 !== d.length) return null;
|
|
376
|
+
const threshChunk = d[i];
|
|
377
|
+
let threshold: number;
|
|
378
|
+
if (
|
|
379
|
+
typeof threshChunk === 'number' &&
|
|
380
|
+
threshChunk >= opcodes.OP_1 &&
|
|
381
|
+
threshChunk <= opcodes.OP_16
|
|
382
|
+
) {
|
|
383
|
+
threshold = threshChunk - opcodes.OP_1 + 1;
|
|
384
|
+
} else if (threshChunk instanceof Uint8Array) {
|
|
385
|
+
threshold = script.number.decode(threshChunk as Buffer);
|
|
386
|
+
} else {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (d[i + 1] !== opcodes.OP_NUMEQUAL) return null;
|
|
391
|
+
if (threshold < 1 || threshold > pubkeys.length) return null;
|
|
392
|
+
|
|
393
|
+
return { pubkeys, threshold, csvBlocks };
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Finalize a single PSBT input that was set up as a CSV multisig P2TR spend.
|
|
398
|
+
*
|
|
399
|
+
* Collects the tapScriptSig entries that cosigners have added to the PSBT
|
|
400
|
+
* input and writes the final witness. Designed for the collaborative case
|
|
401
|
+
* where signers accumulate signatures on a shared PSBT and then anyone
|
|
402
|
+
* finalizes once threshold is met.
|
|
403
|
+
*
|
|
404
|
+
* `addr` may be omitted when the input's first tapLeafScript carries the
|
|
405
|
+
* tapscript — it is then re-derived here.
|
|
406
|
+
*/
|
|
407
|
+
public static finalizePsbtInput(
|
|
408
|
+
psbt: Psbt,
|
|
409
|
+
inputIndex: number,
|
|
410
|
+
network: Network,
|
|
411
|
+
addr?: CSVMultisigAddress,
|
|
412
|
+
): void {
|
|
413
|
+
const input = psbt.data.inputs[inputIndex];
|
|
414
|
+
if (!input) {
|
|
415
|
+
throw new Error(`PSBT has no input at index ${inputIndex}`);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
let descriptor = addr;
|
|
419
|
+
if (!descriptor) {
|
|
420
|
+
const tls = input.tapLeafScript;
|
|
421
|
+
if (!tls || tls.length === 0 || !tls[0]) {
|
|
422
|
+
throw new Error(
|
|
423
|
+
`Input #${inputIndex} has no tapLeafScript — pass \`addr\` explicitly`,
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const derived = this.deriveAddressFromTapscript(tls[0].script, network);
|
|
428
|
+
if (!derived) {
|
|
429
|
+
throw new Error(`Input #${inputIndex} tapLeafScript is not a CSV multisig`);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
descriptor = derived;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const tapSigs = input.tapScriptSig ?? [];
|
|
436
|
+
const witness = this.buildFinalWitnessFromTapScriptSigs(tapSigs, descriptor);
|
|
437
|
+
|
|
438
|
+
psbt.finalizeInput(inputIndex, () => ({
|
|
439
|
+
finalScriptSig: undefined,
|
|
440
|
+
finalScriptWitness: witnessStackToScriptWitness(witness),
|
|
441
|
+
}));
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
public static isCSVMultisigUTXO(utxo: UTXO): boolean {
|
|
445
|
+
if (!utxo.witnessScript) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const tapscript =
|
|
450
|
+
utxo.witnessScript instanceof Uint8Array
|
|
451
|
+
? utxo.witnessScript
|
|
452
|
+
: fromHex(utxo.witnessScript);
|
|
453
|
+
|
|
454
|
+
return this.parseTapscript(tapscript) !== null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function toHexKey(u8: Uint8Array): string {
|
|
459
|
+
let s = '';
|
|
460
|
+
for (let i = 0; i < u8.length; i++) {
|
|
461
|
+
s += (u8[i] as number).toString(16).padStart(2, '0');
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return s;
|
|
465
|
+
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
address as bitAddress,
|
|
5
5
|
applySignaturesToPsbt,
|
|
6
6
|
crypto as bitCrypto,
|
|
7
|
+
equals,
|
|
7
8
|
fromHex,
|
|
8
9
|
getFinalScripts,
|
|
9
10
|
isP2A,
|
|
@@ -45,6 +46,10 @@ import { UnisatSigner } from '../browser/extensions/UnisatSigner.js';
|
|
|
45
46
|
import { canSignNonTaprootInput, isTaprootInput, pubkeyInScript, } from '../../signer/SignerUtils.js';
|
|
46
47
|
import { witnessStackToScriptWitness } from '../utils/WitnessUtils.js';
|
|
47
48
|
import { P2WDADetector } from '../../p2wda/P2WDADetector.js';
|
|
49
|
+
import {
|
|
50
|
+
type CSVMultisigAddress,
|
|
51
|
+
CSVMultisigProvider,
|
|
52
|
+
} from '../mineable/CSVMultisigProvider.js';
|
|
48
53
|
import type { QuantumBIP32Interface } from '@btc-vision/bip32';
|
|
49
54
|
import { MessageSigner } from '../../keypair/MessageSigner.js';
|
|
50
55
|
import { type RotationSigner, type SignerMap } from '../../signer/AddressRotation.js';
|
|
@@ -154,6 +159,13 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
154
159
|
protected csvInputIndices: Set<number> = new Set();
|
|
155
160
|
protected anchorInputIndices: Set<number> = new Set();
|
|
156
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Track P2TR CSV multisig inputs together with the address descriptor needed
|
|
164
|
+
* to finalize them (tapscript + derived control block + parsed config).
|
|
165
|
+
* @protected
|
|
166
|
+
*/
|
|
167
|
+
protected csvMultisigInputs: Map<number, CSVMultisigAddress> = new Map();
|
|
168
|
+
|
|
157
169
|
protected regenerated: boolean = false;
|
|
158
170
|
protected ignoreSignatureErrors: boolean = false;
|
|
159
171
|
protected noSignatures: boolean = false;
|
|
@@ -391,6 +403,7 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
391
403
|
delete this.tweakedSigner;
|
|
392
404
|
this.csvInputIndices.clear();
|
|
393
405
|
this.anchorInputIndices.clear();
|
|
406
|
+
this.csvMultisigInputs.clear();
|
|
394
407
|
this.inputSignerMap.clear();
|
|
395
408
|
this.tweakedSignerCache.clear();
|
|
396
409
|
delete this.parallelSigningConfig;
|
|
@@ -450,7 +463,8 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
450
463
|
|
|
451
464
|
for (const input of this.inputs) {
|
|
452
465
|
// This would disable CSV! You need to check if the input has CSV
|
|
453
|
-
|
|
466
|
+
const idx = this.inputs.indexOf(input);
|
|
467
|
+
if (this.csvInputIndices.has(idx) || this.csvMultisigInputs.has(idx)) {
|
|
454
468
|
continue;
|
|
455
469
|
}
|
|
456
470
|
|
|
@@ -1203,8 +1217,12 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
1203
1217
|
if (inputSign) input.sighashType = inputSign;
|
|
1204
1218
|
}
|
|
1205
1219
|
|
|
1206
|
-
//
|
|
1207
|
-
|
|
1220
|
+
// CSV multisig P2TR: script-path spend with NUMS internal key.
|
|
1221
|
+
// Must come before the default key-path setup below.
|
|
1222
|
+
if (this.processCSVMultisigP2TRInput(utxo, input, i, scriptPub)) {
|
|
1223
|
+
// input fully configured for script-path spend
|
|
1224
|
+
} else if (this.addressRotationEnabled) {
|
|
1225
|
+
// Taproot internal key - use per-input signer in address rotation mode
|
|
1208
1226
|
input.tapInternalKey = this.internalPubKeyToXOnlyForInput(i);
|
|
1209
1227
|
} else {
|
|
1210
1228
|
this.tweakSigner();
|
|
@@ -1254,8 +1272,10 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
1254
1272
|
}
|
|
1255
1273
|
|
|
1256
1274
|
if (i === 0) {
|
|
1257
|
-
// TapLeafScript if available
|
|
1258
|
-
|
|
1275
|
+
// TapLeafScript if available — but never clobber a CSV multisig input's
|
|
1276
|
+
// own tapscript; its spend is a script-path that belongs to the UTXO,
|
|
1277
|
+
// not to this transaction's contract leaf.
|
|
1278
|
+
if (this.tapLeafScript && !this.csvMultisigInputs.has(i)) {
|
|
1259
1279
|
input.tapLeafScript = [this.tapLeafScript];
|
|
1260
1280
|
}
|
|
1261
1281
|
|
|
@@ -1267,6 +1287,58 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
1267
1287
|
return input;
|
|
1268
1288
|
}
|
|
1269
1289
|
|
|
1290
|
+
/**
|
|
1291
|
+
* Detect + configure a P2TR CSV multisig input for script-path spending.
|
|
1292
|
+
*
|
|
1293
|
+
* UTXOs of this shape carry the tapscript in `witnessScript`. The control
|
|
1294
|
+
* block and internal pubkey are fully determined by the tapscript (single
|
|
1295
|
+
* leaf tree, NUMS internal key) so the caller only needs to provide the
|
|
1296
|
+
* tapscript.
|
|
1297
|
+
*
|
|
1298
|
+
* Returns true when the UTXO was recognized and the input was configured,
|
|
1299
|
+
* false otherwise (caller falls back to the default P2TR key-path setup).
|
|
1300
|
+
*/
|
|
1301
|
+
protected processCSVMultisigP2TRInput(
|
|
1302
|
+
utxo: UTXO,
|
|
1303
|
+
input: PsbtInputExtended,
|
|
1304
|
+
i: number,
|
|
1305
|
+
scriptPub: Uint8Array,
|
|
1306
|
+
): boolean {
|
|
1307
|
+
if (!utxo.witnessScript) return false;
|
|
1308
|
+
|
|
1309
|
+
const tapscript =
|
|
1310
|
+
utxo.witnessScript instanceof Uint8Array
|
|
1311
|
+
? utxo.witnessScript
|
|
1312
|
+
: fromHex(utxo.witnessScript);
|
|
1313
|
+
|
|
1314
|
+
const addr = CSVMultisigProvider.deriveAddressFromTapscript(tapscript, this.network);
|
|
1315
|
+
if (!addr) return false;
|
|
1316
|
+
|
|
1317
|
+
// Guard against spoofed witnessScripts on P2TR UTXOs from an unrelated
|
|
1318
|
+
// address: the tapscript must hash back to this exact scriptPubKey.
|
|
1319
|
+
if (!equals(addr.scriptPubKey, scriptPub)) {
|
|
1320
|
+
return false;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
(input as PsbtInputExtended & { tapLeafScript: TapLeafScript[] }).tapLeafScript = [
|
|
1324
|
+
{
|
|
1325
|
+
leafVersion: addr.leafVersion,
|
|
1326
|
+
script: addr.tapscript,
|
|
1327
|
+
controlBlock: addr.controlBlock,
|
|
1328
|
+
},
|
|
1329
|
+
];
|
|
1330
|
+
input.tapInternalKey = addr.internalPubkey as XOnlyPublicKey;
|
|
1331
|
+
|
|
1332
|
+
// Force a CSV-compatible nSequence so OP_CHECKSEQUENCEVERIFY passes.
|
|
1333
|
+
(input as { sequence: number }).sequence = this.setCSVSequence(
|
|
1334
|
+
addr.config.csvBlocks,
|
|
1335
|
+
this.sequence,
|
|
1336
|
+
);
|
|
1337
|
+
|
|
1338
|
+
this.csvMultisigInputs.set(i, addr);
|
|
1339
|
+
return true;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1270
1342
|
protected processP2WSHInput(utxo: UTXO, input: PsbtInputExtended, i: number): void {
|
|
1271
1343
|
// P2WSH requires a witnessScript
|
|
1272
1344
|
if (!utxo.witnessScript) {
|
|
@@ -1350,6 +1422,19 @@ export abstract class TweakedTransaction extends Logger implements Disposable {
|
|
|
1350
1422
|
};
|
|
1351
1423
|
}
|
|
1352
1424
|
|
|
1425
|
+
const csvMultisigAddr = this.csvMultisigInputs.get(inputIndex);
|
|
1426
|
+
if (csvMultisigAddr) {
|
|
1427
|
+
const tapSigs = input.tapScriptSig ?? [];
|
|
1428
|
+
const witnessStack = CSVMultisigProvider.buildFinalWitnessFromTapScriptSigs(
|
|
1429
|
+
tapSigs,
|
|
1430
|
+
csvMultisigAddr,
|
|
1431
|
+
);
|
|
1432
|
+
return {
|
|
1433
|
+
finalScriptSig: undefined,
|
|
1434
|
+
finalScriptWitness: witnessStackToScriptWitness(witnessStack),
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1353
1438
|
if (isP2WSH && isSegwit && input.witnessScript) {
|
|
1354
1439
|
if (!input.partialSig || input.partialSig.length === 0) {
|
|
1355
1440
|
throw new Error(`No signatures for P2WSH input #${inputIndex}`);
|