@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,102 @@
|
|
|
1
|
+
import { type Network, type Psbt, type Script, type TapScriptSig, type XOnlyPublicKey } from '@btc-vision/bitcoin';
|
|
2
|
+
import type { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
3
|
+
export declare const NUMS_INTERNAL_KEY: Uint8Array;
|
|
4
|
+
export declare const LEAF_VERSION_TAPSCRIPT = 192;
|
|
5
|
+
export interface CSVMultisigConfig {
|
|
6
|
+
/** x,only (32 byte) pubkeys. Signature order is the reverse of this array. */
|
|
7
|
+
pubkeys: XOnlyPublicKey[];
|
|
8
|
+
/** k of n threshold, fixed at 2 for CSV2Multisig but kept configurable. */
|
|
9
|
+
threshold: number;
|
|
10
|
+
/** Block,based relative lock, 1..65535. */
|
|
11
|
+
csvBlocks: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CSVMultisigAddress {
|
|
14
|
+
address: string;
|
|
15
|
+
tapscript: Uint8Array;
|
|
16
|
+
scriptPubKey: Uint8Array;
|
|
17
|
+
controlBlock: Uint8Array;
|
|
18
|
+
internalPubkey: Uint8Array;
|
|
19
|
+
leafVersion: number;
|
|
20
|
+
config: CSVMultisigConfig;
|
|
21
|
+
}
|
|
22
|
+
export declare class CSVMultisigProvider {
|
|
23
|
+
static readonly NUMS_INTERNAL_KEY: Uint8Array<ArrayBufferLike>;
|
|
24
|
+
static readonly LEAF_VERSION = 192;
|
|
25
|
+
/** Build the CSV + k of n CHECKSIGADD tapscript. */
|
|
26
|
+
static buildTapscript(cfg: CSVMultisigConfig): Script;
|
|
27
|
+
/** Convenience: 2 of N with fixed threshold. */
|
|
28
|
+
static buildCSV2MultisigTapscript(pubkeys: XOnlyPublicKey[], csvBlocks: number): Uint8Array;
|
|
29
|
+
/** Single leaf tree, NUMS internal key, key path is unspendable. */
|
|
30
|
+
static generateAddress(cfg: CSVMultisigConfig, network: Network): CSVMultisigAddress;
|
|
31
|
+
/**
|
|
32
|
+
* Encode the nSequence value the spending input must use.
|
|
33
|
+
* BIP 68: disable bit (1 << 31) = 0, type,flag (1 << 22) = 0 for blocks,
|
|
34
|
+
* low 16 bits carry the block count.
|
|
35
|
+
*/
|
|
36
|
+
static encodeSequence(csvBlocks: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Build witness stack for a script path spend.
|
|
39
|
+
*
|
|
40
|
+
* Returns { witness, sequence }. The caller MUST set nSequence = sequence
|
|
41
|
+
* on the spending input, otherwise OP_CHECKSEQUENCEVERIFY will fail.
|
|
42
|
+
* Transaction nVersion must be >= 2 for CSV to be enforced at all.
|
|
43
|
+
*/
|
|
44
|
+
static buildSpendWitness(signatures: Uint8Array[], addr: CSVMultisigAddress): {
|
|
45
|
+
witness: Uint8Array[];
|
|
46
|
+
sequence: number;
|
|
47
|
+
};
|
|
48
|
+
static isP2TRScriptPubKey(scriptPubKey: Uint8Array): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Derive the full CSV multisig address from just the tapscript.
|
|
51
|
+
*
|
|
52
|
+
* The tapscript alone fully determines the address because:
|
|
53
|
+
* - the internal key is the hard coded NUMS point,
|
|
54
|
+
* - the tap tree is a single leaf,
|
|
55
|
+
* - the leaf version is LEAF_VERSION_TAPSCRIPT (0xc0).
|
|
56
|
+
*
|
|
57
|
+
* Returns null when the tapscript does not match the CSV multisig shape.
|
|
58
|
+
*/
|
|
59
|
+
static deriveAddressFromTapscript(tapscript: Uint8Array, network: Network): CSVMultisigAddress | null;
|
|
60
|
+
/**
|
|
61
|
+
* Witness stack size needed for fee estimation.
|
|
62
|
+
*
|
|
63
|
+
* threshold 64-byte Schnorr sigs at the bottom (pushed first by the caller),
|
|
64
|
+
* plus (n - threshold) empty placeholders for unsigned slots,
|
|
65
|
+
* plus the tapscript, plus the control block.
|
|
66
|
+
*/
|
|
67
|
+
static buildDummyWitness(addr: CSVMultisigAddress): Uint8Array[];
|
|
68
|
+
/**
|
|
69
|
+
* Build the final witness stack from collected PSBT tapScriptSig entries.
|
|
70
|
+
*
|
|
71
|
+
* Each entry is matched to its pubkey in the tapscript. Missing entries
|
|
72
|
+
* produce empty (zero-length) placeholders so the remaining signatures can
|
|
73
|
+
* still validate at positions above threshold.
|
|
74
|
+
*/
|
|
75
|
+
static buildFinalWitnessFromTapScriptSigs(tapScriptSigs: readonly TapScriptSig[], addr: CSVMultisigAddress): Uint8Array[];
|
|
76
|
+
/**
|
|
77
|
+
* True when this UTXO is a CSV multisig P2TR output that this provider can spend.
|
|
78
|
+
*
|
|
79
|
+
* Requires both the P2TR scriptPubKey and a witnessScript (the tapscript) on
|
|
80
|
+
* the UTXO, and checks the tapscript shape AND that the scriptPubKey matches
|
|
81
|
+
* the address derived from that tapscript (prevents spoofed witnessScripts).
|
|
82
|
+
*/
|
|
83
|
+
static isSpendableUTXO(utxo: UTXO, network: Network): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Parse a tapscript that matches the CSV + CHECKSIGADD multisig shape.
|
|
86
|
+
* Returns null if the script does not match.
|
|
87
|
+
*/
|
|
88
|
+
static parseTapscript(tapscript: Uint8Array): CSVMultisigConfig | null;
|
|
89
|
+
/**
|
|
90
|
+
* Finalize a single PSBT input that was set up as a CSV multisig P2TR spend.
|
|
91
|
+
*
|
|
92
|
+
* Collects the tapScriptSig entries that cosigners have added to the PSBT
|
|
93
|
+
* input and writes the final witness. Designed for the collaborative case
|
|
94
|
+
* where signers accumulate signatures on a shared PSBT and then anyone
|
|
95
|
+
* finalizes once threshold is met.
|
|
96
|
+
*
|
|
97
|
+
* `addr` may be omitted when the input's first tapLeafScript carries the
|
|
98
|
+
* tapscript — it is then re-derived here.
|
|
99
|
+
*/
|
|
100
|
+
static finalizePsbtInput(psbt: Psbt, inputIndex: number, network: Network, addr?: CSVMultisigAddress): void;
|
|
101
|
+
static isCSVMultisigUTXO(utxo: UTXO): boolean;
|
|
102
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { equals, fromHex, isP2TR, opcodes, payments, script, } from '@btc-vision/bitcoin';
|
|
2
|
+
import { witnessStackToScriptWitness } from '../utils/WitnessUtils.js';
|
|
3
|
+
export const NUMS_INTERNAL_KEY = fromHex('50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0');
|
|
4
|
+
export const LEAF_VERSION_TAPSCRIPT = 0xc0;
|
|
5
|
+
export class CSVMultisigProvider {
|
|
6
|
+
static NUMS_INTERNAL_KEY = NUMS_INTERNAL_KEY;
|
|
7
|
+
static LEAF_VERSION = LEAF_VERSION_TAPSCRIPT;
|
|
8
|
+
/** Build the CSV + k of n CHECKSIGADD tapscript. */
|
|
9
|
+
static buildTapscript(cfg) {
|
|
10
|
+
if (cfg.csvBlocks < 1 || cfg.csvBlocks > 0xffff) {
|
|
11
|
+
throw new Error('csvBlocks must be between 1 and 65535');
|
|
12
|
+
}
|
|
13
|
+
if (cfg.pubkeys.length === 0) {
|
|
14
|
+
throw new Error('At least one pubkey required');
|
|
15
|
+
}
|
|
16
|
+
if (cfg.threshold < 1 || cfg.threshold > cfg.pubkeys.length) {
|
|
17
|
+
throw new Error('Invalid threshold');
|
|
18
|
+
}
|
|
19
|
+
for (const pk of cfg.pubkeys) {
|
|
20
|
+
if (pk.length !== 32) {
|
|
21
|
+
throw new Error('Tapscript pubkeys must be 32 bytes (x,only)');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const chunks = [];
|
|
25
|
+
// Relative timelock gate
|
|
26
|
+
chunks.push(script.number.encode(cfg.csvBlocks));
|
|
27
|
+
chunks.push(opcodes.OP_CHECKSEQUENCEVERIFY);
|
|
28
|
+
chunks.push(opcodes.OP_DROP);
|
|
29
|
+
// k of n multisig
|
|
30
|
+
chunks.push(cfg.pubkeys[0], opcodes.OP_CHECKSIG);
|
|
31
|
+
for (let i = 1; i < cfg.pubkeys.length; i++) {
|
|
32
|
+
chunks.push(cfg.pubkeys[i], opcodes.OP_CHECKSIGADD);
|
|
33
|
+
}
|
|
34
|
+
if (cfg.threshold >= 1 && cfg.threshold <= 16) {
|
|
35
|
+
chunks.push(opcodes.OP_1 + cfg.threshold - 1);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
chunks.push(script.number.encode(cfg.threshold));
|
|
39
|
+
}
|
|
40
|
+
chunks.push(opcodes.OP_NUMEQUAL);
|
|
41
|
+
return script.compile(chunks);
|
|
42
|
+
}
|
|
43
|
+
/** Convenience: 2 of N with fixed threshold. */
|
|
44
|
+
static buildCSV2MultisigTapscript(pubkeys, csvBlocks) {
|
|
45
|
+
return this.buildTapscript({ pubkeys, threshold: 2, csvBlocks });
|
|
46
|
+
}
|
|
47
|
+
/** Single leaf tree, NUMS internal key, key path is unspendable. */
|
|
48
|
+
static generateAddress(cfg, network) {
|
|
49
|
+
const tapscript = this.buildTapscript(cfg);
|
|
50
|
+
const p2tr = payments.p2tr({
|
|
51
|
+
internalPubkey: NUMS_INTERNAL_KEY,
|
|
52
|
+
scriptTree: { output: tapscript },
|
|
53
|
+
redeem: {
|
|
54
|
+
output: tapscript,
|
|
55
|
+
redeemVersion: LEAF_VERSION_TAPSCRIPT,
|
|
56
|
+
},
|
|
57
|
+
network,
|
|
58
|
+
});
|
|
59
|
+
if (!p2tr.address || !p2tr.output || !p2tr.witness || p2tr.witness.length < 2) {
|
|
60
|
+
throw new Error('Failed to generate CSV multisig P2TR address');
|
|
61
|
+
}
|
|
62
|
+
const control = p2tr.witness[p2tr.witness.length - 1];
|
|
63
|
+
if (!control) {
|
|
64
|
+
throw new Error('Failed to generate CSV multisig P2TR address');
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
address: p2tr.address,
|
|
68
|
+
tapscript,
|
|
69
|
+
scriptPubKey: p2tr.output,
|
|
70
|
+
controlBlock: control,
|
|
71
|
+
internalPubkey: NUMS_INTERNAL_KEY,
|
|
72
|
+
leafVersion: LEAF_VERSION_TAPSCRIPT,
|
|
73
|
+
config: cfg,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Encode the nSequence value the spending input must use.
|
|
78
|
+
* BIP 68: disable bit (1 << 31) = 0, type,flag (1 << 22) = 0 for blocks,
|
|
79
|
+
* low 16 bits carry the block count.
|
|
80
|
+
*/
|
|
81
|
+
static encodeSequence(csvBlocks) {
|
|
82
|
+
if (csvBlocks < 1 || csvBlocks > 0xffff) {
|
|
83
|
+
throw new Error('csvBlocks out of range');
|
|
84
|
+
}
|
|
85
|
+
return csvBlocks & 0x0000ffff;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Build witness stack for a script path spend.
|
|
89
|
+
*
|
|
90
|
+
* Returns { witness, sequence }. The caller MUST set nSequence = sequence
|
|
91
|
+
* on the spending input, otherwise OP_CHECKSEQUENCEVERIFY will fail.
|
|
92
|
+
* Transaction nVersion must be >= 2 for CSV to be enforced at all.
|
|
93
|
+
*/
|
|
94
|
+
static buildSpendWitness(signatures, addr) {
|
|
95
|
+
const { config, tapscript, controlBlock } = addr;
|
|
96
|
+
if (signatures.length !== config.pubkeys.length) {
|
|
97
|
+
throw new Error('signatures length must match pubkeys length');
|
|
98
|
+
}
|
|
99
|
+
for (const sig of signatures) {
|
|
100
|
+
if (sig.length !== 0 && sig.length !== 64 && sig.length !== 65) {
|
|
101
|
+
throw new Error('Each sig must be empty, 64, or 65 bytes');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const provided = signatures.filter((s) => s.length > 0).length;
|
|
105
|
+
if (provided < config.threshold) {
|
|
106
|
+
throw new Error(`Need ${config.threshold} signatures, got ${provided}`);
|
|
107
|
+
}
|
|
108
|
+
const witness = [];
|
|
109
|
+
// Reverse pubkey order: sig for pubkeys[0] must end up on top of stack.
|
|
110
|
+
for (let i = signatures.length - 1; i >= 0; i--) {
|
|
111
|
+
witness.push(signatures[i]);
|
|
112
|
+
}
|
|
113
|
+
witness.push(tapscript);
|
|
114
|
+
witness.push(controlBlock);
|
|
115
|
+
return { witness, sequence: this.encodeSequence(config.csvBlocks) };
|
|
116
|
+
}
|
|
117
|
+
static isP2TRScriptPubKey(scriptPubKey) {
|
|
118
|
+
return isP2TR(scriptPubKey);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Derive the full CSV multisig address from just the tapscript.
|
|
122
|
+
*
|
|
123
|
+
* The tapscript alone fully determines the address because:
|
|
124
|
+
* - the internal key is the hard coded NUMS point,
|
|
125
|
+
* - the tap tree is a single leaf,
|
|
126
|
+
* - the leaf version is LEAF_VERSION_TAPSCRIPT (0xc0).
|
|
127
|
+
*
|
|
128
|
+
* Returns null when the tapscript does not match the CSV multisig shape.
|
|
129
|
+
*/
|
|
130
|
+
static deriveAddressFromTapscript(tapscript, network) {
|
|
131
|
+
const config = this.parseTapscript(tapscript);
|
|
132
|
+
if (!config)
|
|
133
|
+
return null;
|
|
134
|
+
return this.generateAddress(config, network);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Witness stack size needed for fee estimation.
|
|
138
|
+
*
|
|
139
|
+
* threshold 64-byte Schnorr sigs at the bottom (pushed first by the caller),
|
|
140
|
+
* plus (n - threshold) empty placeholders for unsigned slots,
|
|
141
|
+
* plus the tapscript, plus the control block.
|
|
142
|
+
*/
|
|
143
|
+
static buildDummyWitness(addr) {
|
|
144
|
+
const { config, tapscript, controlBlock } = addr;
|
|
145
|
+
const witness = [];
|
|
146
|
+
// Position 0..n-1 maps to pubkey n-1..0 on the stack.
|
|
147
|
+
// For estimation we put real 64-byte sigs in the last `threshold` positions
|
|
148
|
+
// (matching the highest-indexed pubkeys), and empties elsewhere.
|
|
149
|
+
for (let i = 0; i < config.pubkeys.length; i++) {
|
|
150
|
+
const stackPos = config.pubkeys.length - 1 - i;
|
|
151
|
+
if (stackPos < config.threshold) {
|
|
152
|
+
witness.push(new Uint8Array(64));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
witness.push(new Uint8Array(0));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
witness.push(tapscript);
|
|
159
|
+
witness.push(controlBlock);
|
|
160
|
+
return witness;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Build the final witness stack from collected PSBT tapScriptSig entries.
|
|
164
|
+
*
|
|
165
|
+
* Each entry is matched to its pubkey in the tapscript. Missing entries
|
|
166
|
+
* produce empty (zero-length) placeholders so the remaining signatures can
|
|
167
|
+
* still validate at positions above threshold.
|
|
168
|
+
*/
|
|
169
|
+
static buildFinalWitnessFromTapScriptSigs(tapScriptSigs, addr) {
|
|
170
|
+
const { config, tapscript, controlBlock } = addr;
|
|
171
|
+
const sigsByPubkey = new Map();
|
|
172
|
+
for (const entry of tapScriptSigs) {
|
|
173
|
+
if (!entry.pubkey || entry.pubkey.length !== 32)
|
|
174
|
+
continue;
|
|
175
|
+
sigsByPubkey.set(toHexKey(entry.pubkey), entry.signature);
|
|
176
|
+
}
|
|
177
|
+
const ordered = [];
|
|
178
|
+
let provided = 0;
|
|
179
|
+
for (const pk of config.pubkeys) {
|
|
180
|
+
const sig = sigsByPubkey.get(toHexKey(pk));
|
|
181
|
+
if (sig) {
|
|
182
|
+
if (sig.length !== 64 && sig.length !== 65) {
|
|
183
|
+
throw new Error(`Invalid Schnorr signature length ${sig.length} for CSV multisig spend`);
|
|
184
|
+
}
|
|
185
|
+
ordered.push(sig);
|
|
186
|
+
provided++;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
ordered.push(new Uint8Array(0));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (provided < config.threshold) {
|
|
193
|
+
throw new Error(`CSV multisig spend needs ${config.threshold} signatures, got ${provided}`);
|
|
194
|
+
}
|
|
195
|
+
const witness = [];
|
|
196
|
+
// Reverse pubkey order so that the signature for pubkeys[0] lands on top of the stack.
|
|
197
|
+
for (let i = ordered.length - 1; i >= 0; i--) {
|
|
198
|
+
witness.push(ordered[i]);
|
|
199
|
+
}
|
|
200
|
+
witness.push(tapscript);
|
|
201
|
+
witness.push(controlBlock);
|
|
202
|
+
return witness;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* True when this UTXO is a CSV multisig P2TR output that this provider can spend.
|
|
206
|
+
*
|
|
207
|
+
* Requires both the P2TR scriptPubKey and a witnessScript (the tapscript) on
|
|
208
|
+
* the UTXO, and checks the tapscript shape AND that the scriptPubKey matches
|
|
209
|
+
* the address derived from that tapscript (prevents spoofed witnessScripts).
|
|
210
|
+
*/
|
|
211
|
+
static isSpendableUTXO(utxo, network) {
|
|
212
|
+
if (!utxo.witnessScript)
|
|
213
|
+
return false;
|
|
214
|
+
const scriptPub = fromHex(utxo.scriptPubKey.hex);
|
|
215
|
+
if (!isP2TR(scriptPub))
|
|
216
|
+
return false;
|
|
217
|
+
const tapscript = utxo.witnessScript instanceof Uint8Array
|
|
218
|
+
? utxo.witnessScript
|
|
219
|
+
: fromHex(utxo.witnessScript);
|
|
220
|
+
const addr = this.deriveAddressFromTapscript(tapscript, network);
|
|
221
|
+
if (!addr)
|
|
222
|
+
return false;
|
|
223
|
+
return equals(addr.scriptPubKey, scriptPub);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Parse a tapscript that matches the CSV + CHECKSIGADD multisig shape.
|
|
227
|
+
* Returns null if the script does not match.
|
|
228
|
+
*/
|
|
229
|
+
static parseTapscript(tapscript) {
|
|
230
|
+
const d = script.decompile(tapscript);
|
|
231
|
+
if (!d || d.length < 6)
|
|
232
|
+
return null;
|
|
233
|
+
// <csvBlocks> CSV DROP
|
|
234
|
+
// Small values (1..16) are minimally encoded as OP_N opcodes by
|
|
235
|
+
// script.compile, so the chunk may be a number rather than a Uint8Array.
|
|
236
|
+
const csvChunk = d[0];
|
|
237
|
+
let csvBlocks;
|
|
238
|
+
if (csvChunk instanceof Uint8Array) {
|
|
239
|
+
try {
|
|
240
|
+
csvBlocks = script.number.decode(csvChunk);
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else if (typeof csvChunk === 'number' &&
|
|
247
|
+
csvChunk >= opcodes.OP_1 &&
|
|
248
|
+
csvChunk <= opcodes.OP_16) {
|
|
249
|
+
csvBlocks = csvChunk - opcodes.OP_1 + 1;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
if (d[1] !== opcodes.OP_CHECKSEQUENCEVERIFY)
|
|
255
|
+
return null;
|
|
256
|
+
if (d[2] !== opcodes.OP_DROP)
|
|
257
|
+
return null;
|
|
258
|
+
// <pk1> CHECKSIG
|
|
259
|
+
let i = 3;
|
|
260
|
+
if (!(d[i] instanceof Uint8Array) ||
|
|
261
|
+
d[i].length !== 32 ||
|
|
262
|
+
d[i + 1] !== opcodes.OP_CHECKSIG) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
const pubkeys = [d[i]];
|
|
266
|
+
i += 2;
|
|
267
|
+
// <pkN> CHECKSIGADD pairs
|
|
268
|
+
while (i + 1 < d.length &&
|
|
269
|
+
d[i] instanceof Uint8Array &&
|
|
270
|
+
d[i].length === 32 &&
|
|
271
|
+
d[i + 1] === opcodes.OP_CHECKSIGADD) {
|
|
272
|
+
pubkeys.push(d[i]);
|
|
273
|
+
i += 2;
|
|
274
|
+
}
|
|
275
|
+
// threshold + OP_NUMEQUAL at the end
|
|
276
|
+
if (i + 2 !== d.length)
|
|
277
|
+
return null;
|
|
278
|
+
const threshChunk = d[i];
|
|
279
|
+
let threshold;
|
|
280
|
+
if (typeof threshChunk === 'number' &&
|
|
281
|
+
threshChunk >= opcodes.OP_1 &&
|
|
282
|
+
threshChunk <= opcodes.OP_16) {
|
|
283
|
+
threshold = threshChunk - opcodes.OP_1 + 1;
|
|
284
|
+
}
|
|
285
|
+
else if (threshChunk instanceof Uint8Array) {
|
|
286
|
+
threshold = script.number.decode(threshChunk);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
if (d[i + 1] !== opcodes.OP_NUMEQUAL)
|
|
292
|
+
return null;
|
|
293
|
+
if (threshold < 1 || threshold > pubkeys.length)
|
|
294
|
+
return null;
|
|
295
|
+
return { pubkeys, threshold, csvBlocks };
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Finalize a single PSBT input that was set up as a CSV multisig P2TR spend.
|
|
299
|
+
*
|
|
300
|
+
* Collects the tapScriptSig entries that cosigners have added to the PSBT
|
|
301
|
+
* input and writes the final witness. Designed for the collaborative case
|
|
302
|
+
* where signers accumulate signatures on a shared PSBT and then anyone
|
|
303
|
+
* finalizes once threshold is met.
|
|
304
|
+
*
|
|
305
|
+
* `addr` may be omitted when the input's first tapLeafScript carries the
|
|
306
|
+
* tapscript — it is then re-derived here.
|
|
307
|
+
*/
|
|
308
|
+
static finalizePsbtInput(psbt, inputIndex, network, addr) {
|
|
309
|
+
const input = psbt.data.inputs[inputIndex];
|
|
310
|
+
if (!input) {
|
|
311
|
+
throw new Error(`PSBT has no input at index ${inputIndex}`);
|
|
312
|
+
}
|
|
313
|
+
let descriptor = addr;
|
|
314
|
+
if (!descriptor) {
|
|
315
|
+
const tls = input.tapLeafScript;
|
|
316
|
+
if (!tls || tls.length === 0 || !tls[0]) {
|
|
317
|
+
throw new Error(`Input #${inputIndex} has no tapLeafScript — pass \`addr\` explicitly`);
|
|
318
|
+
}
|
|
319
|
+
const derived = this.deriveAddressFromTapscript(tls[0].script, network);
|
|
320
|
+
if (!derived) {
|
|
321
|
+
throw new Error(`Input #${inputIndex} tapLeafScript is not a CSV multisig`);
|
|
322
|
+
}
|
|
323
|
+
descriptor = derived;
|
|
324
|
+
}
|
|
325
|
+
const tapSigs = input.tapScriptSig ?? [];
|
|
326
|
+
const witness = this.buildFinalWitnessFromTapScriptSigs(tapSigs, descriptor);
|
|
327
|
+
psbt.finalizeInput(inputIndex, () => ({
|
|
328
|
+
finalScriptSig: undefined,
|
|
329
|
+
finalScriptWitness: witnessStackToScriptWitness(witness),
|
|
330
|
+
}));
|
|
331
|
+
}
|
|
332
|
+
static isCSVMultisigUTXO(utxo) {
|
|
333
|
+
if (!utxo.witnessScript) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
const tapscript = utxo.witnessScript instanceof Uint8Array
|
|
337
|
+
? utxo.witnessScript
|
|
338
|
+
: fromHex(utxo.witnessScript);
|
|
339
|
+
return this.parseTapscript(tapscript) !== null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function toHexKey(u8) {
|
|
343
|
+
let s = '';
|
|
344
|
+
for (let i = 0; i < u8.length; i++) {
|
|
345
|
+
s += u8[i].toString(16).padStart(2, '0');
|
|
346
|
+
}
|
|
347
|
+
return s;
|
|
348
|
+
}
|
|
@@ -135,4 +135,3 @@ export declare function isCustomScriptSpecificData(data: TypeSpecificData): data
|
|
|
135
135
|
* Type guard for CancelSpecificData
|
|
136
136
|
*/
|
|
137
137
|
export declare function isCancelSpecificData(data: TypeSpecificData): data is CancelSpecificData;
|
|
138
|
-
//# sourceMappingURL=ITypeSpecificData.d.ts.map
|
|
@@ -5,6 +5,7 @@ import { type UniversalSigner } from '@btc-vision/ecpair';
|
|
|
5
5
|
import type { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
6
6
|
import type { TapLeafScript } from '../interfaces/Tap.js';
|
|
7
7
|
import { UnisatSigner } from '../browser/extensions/UnisatSigner.js';
|
|
8
|
+
import { type CSVMultisigAddress } from '../mineable/CSVMultisigProvider.js';
|
|
8
9
|
import type { QuantumBIP32Interface } from '@btc-vision/bip32';
|
|
9
10
|
import { type RotationSigner, type SignerMap } from '../../signer/AddressRotation.js';
|
|
10
11
|
import type { ITweakedTransactionData, SupportedTransactionVersion } from '../interfaces/ITweakedTransactionData.js';
|
|
@@ -93,6 +94,12 @@ export declare abstract class TweakedTransaction extends Logger implements Dispo
|
|
|
93
94
|
*/
|
|
94
95
|
protected csvInputIndices: Set<number>;
|
|
95
96
|
protected anchorInputIndices: Set<number>;
|
|
97
|
+
/**
|
|
98
|
+
* Track P2TR CSV multisig inputs together with the address descriptor needed
|
|
99
|
+
* to finalize them (tapscript + derived control block + parsed config).
|
|
100
|
+
* @protected
|
|
101
|
+
*/
|
|
102
|
+
protected csvMultisigInputs: Map<number, CSVMultisigAddress>;
|
|
96
103
|
protected regenerated: boolean;
|
|
97
104
|
protected ignoreSignatureErrors: boolean;
|
|
98
105
|
protected noSignatures: boolean;
|
|
@@ -331,6 +338,18 @@ export declare abstract class TweakedTransaction extends Logger implements Dispo
|
|
|
331
338
|
* @returns {PsbtInputExtended} The PSBT input extended
|
|
332
339
|
*/
|
|
333
340
|
protected generatePsbtInputExtended(utxo: UTXO, i: number, _extra?: boolean): PsbtInputExtended;
|
|
341
|
+
/**
|
|
342
|
+
* Detect + configure a P2TR CSV multisig input for script-path spending.
|
|
343
|
+
*
|
|
344
|
+
* UTXOs of this shape carry the tapscript in `witnessScript`. The control
|
|
345
|
+
* block and internal pubkey are fully determined by the tapscript (single
|
|
346
|
+
* leaf tree, NUMS internal key) so the caller only needs to provide the
|
|
347
|
+
* tapscript.
|
|
348
|
+
*
|
|
349
|
+
* Returns true when the UTXO was recognized and the input was configured,
|
|
350
|
+
* false otherwise (caller falls back to the default P2TR key-path setup).
|
|
351
|
+
*/
|
|
352
|
+
protected processCSVMultisigP2TRInput(utxo: UTXO, input: PsbtInputExtended, i: number, scriptPub: Uint8Array): boolean;
|
|
334
353
|
protected processP2WSHInput(utxo: UTXO, input: PsbtInputExtended, i: number): void;
|
|
335
354
|
protected secondsToCSVTimeUnits(seconds: number): number;
|
|
336
355
|
protected createTimeBasedCSV(seconds: number): number;
|
|
@@ -357,4 +376,3 @@ export declare abstract class TweakedTransaction extends Logger implements Dispo
|
|
|
357
376
|
private signTaprootInput;
|
|
358
377
|
private signNonTaprootInput;
|
|
359
378
|
}
|
|
360
|
-
//# sourceMappingURL=TweakedTransaction.d.ts.map
|