* Reduce number of property based tests on BIP32PathTest and add a Future to NetworkPayloadTest's property based tests so it hopefully runs faster on CI
* Run scalafmt
* Make a few more property based tests async
* Make forAllParallel, refactor some test cases to use it
* Make BlockMessageTest async
* Bump timeout
* Make ScriptOperationFactory subclasses use a val to cache operaetions rather than operations
* Make ScriptOperation's use a Vector rather than Seq. Seq is a trait that can sometimes be backed by a List which can have some O(n) behavior
* Remove BlockTest benchamarking test case
* Put popular opcodes at beginning of ScriptOperations.operations for an optimization
* Remove Try() allocation on ECPublicKey.isFullyValid()
* Fix how CompactSizeUInt was serialized to be more efficient, move isMultiSig() and isLocktimeSPK() to be inline so we don't evaluate it unless we absolutely need to
* Use Map inside of ScriptOperation.fromByte()
* Update map to look up script operation rather than iterating
* Remove the clause in Transction.fromHex() where we throw in the case of a witness transaction, do something smarter and look at bytes in the byte vector
* WIP add test case
* Add back try/catch as it's still necessary for cases of unsigned base transactions
* Add permalink to example test case
Added OutputReference and introduced public key computation on SPKs
Made InputInfo into an ADT
Made UTXOSpendingInfo use InputInfo
Replaced UTXOSpendingInfo with NewSpendingInfo and got non-test things compiling
Made aliases for (NewSpendingInfo/NewSpendingInfoFull/NewSpendingInfoSingle)[InputInfo]
Got rid of source code mention of UTXOSpendingInfo
sbt compile passes
tests compile
Fixed all coreTest tests
Renamed to UTXOInfo
Some cleanup
Moved redeem script and script witness accessors to companion object
Responded to code review
Added OutputReference and scaladocs
Moved p2pkhPreImageOpt downstream and generalized to hashPreImages
Fixed adding-spks.md
Fixed psbts.md and txbuilder.md
Renamed UTXOInfo
Apply renaming to docs
* Make Bech32Address.toString actually print the string representation not the object one
* Remove Bech32Address.toString all together and use the super class definition
* Add test case
* Run scalafmt
* Added crypto project and decoupled BitcoinSLogger from NetworkElement
Decoupled BitcoinSLogger from Factory
Moved NetworkElement into crypto project
Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project
Moved MaskedToString to crypto project
Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint
Moved the rest of crypto stuff to the crypto project
Moved crypto tests to crypto-test project
* Added documentation for crypto project
* Added Bouncy Castle fallback to all Secp calls in ECKey.scala
* Fixed bugs and made ExtKey support use of BouncyCastle
* An attempt to add bouncy castle testing to CI
* Responded to review
* De-coupled libsecp256k1 uses from Bouncy Castle uses
* Responded to review
* Renamed size to byteSize in NetworkElement to avoid ambiguity
* Introduced SeqWrapper and MapWrapper to allow for wrapper case classes to have direct access to underlying methods
* Responded to review
* PSBT Serialization/Deserialization (#917)
* PSBT Serialization and Deserialization
* Remove debug code
* Create PSBTParseResult, Add more psbt test cases, and various small nits
* PSBT version checking
* Remove PSBTHelper, give PSBTRecord and PSBTMap a fromBytes
* Fix compile issue, preserve ADT
* PSBT Combiner
* PSBT Updater
* Fix PSBT version number to be read as little endian
* Make function names more clear, add scaladoc, require not finalized
* Combiner scaladocs
* Test case from BIP
* Make compatible with older versions
* PSBT: Fix for EmptyWitness changes (#968)
* PSBTInputMap to UTXOSigningInfo
* Remove vars
* Add missing param
* Fix byteVectorOrdering for when x == y
* getUTXOSpendingInfo Tests
* Fix formatting errors
* Give conditional path default value
* formatting fix
* Fixed InputPSBTRecord.FinalizedScriptSig using asmBytes (#1004)
* Fixed PSBTTest after rebasing onto master
* PSBT Constructors and Extraction (#997)
* Added PSBT constructors
* Revived option to use signers in toUTXOSpendingInfo
* Added transaction extraction
* Responded to code review
* Added extraction test from BIP
* Added validation (option) to PSBT extraction
* Added property based test for PSBT.extractTransactionAndValidate
* Marked PSBT as new code for PropertyCheckConfiguration
* PSBT Finalizer (#1002)
* Added finalizing functionality to PSBTs
* Cleaned things up
* Added finalizer test, fails
* Check that PSBT is not already finalized when finalizing PSBT
* Added P2PKWithTimeout cases
* Formatting fix
* PSBT Generators (#1019)
* Introduced non-finalized constructor
* Added property based test comparing finalized and un-finalized construction, it currently fails due to EmptyScriptPubKey not being supported in various ways. Also fixed a ton of bugs!
* Fixed easy bugs relating to EmptyScriptPubKey, one is left
* Fixed the last bugs (multisig order and 0-of-n stuff) and now tests pass!
* Separated out direct finalized PSBT construction from non-finalized PSBT construction
* Translated construction work in tests into PSBT generators
* Added serialization symmetry test
* Made PSBT fee generation dependent on other generators to ensure low enough fees for signing
* Responded to code review
* Added scaladocs
* Fixed arbitraryPSBT to work with older scala versions
* Fixed PSBT compilation breakages from rebase
* Fixed test breakages from rebase
* Validate the PSBT unknown is not a known field
* Increase code coverage on PSBT tests
* Address review
* formatting
* Add error messages, rename function
* Psbt Signer (#1025)
* PSBT Signer
* Create addSignature function for PSBTs
* Use PartialSignature instead of Tuple
* Create extra util functions
* scaladoc and simplify case
* Formatting fix for psbt scaladocs
* Clean up code, add error messages, and scaladoc
* add type hints
* Change InputPSBTMap.fromUTXOSpendingInfo to use BitcoinSingleSigner
* optimize import
* Define separator byte for psbt map
* getRecords simplification
* remove braces, add error message
* PSBT stuff assigned to nkohen (#1035)
* Responded to psbt review assigned to me
* Moved separatorByte to a place where all can use it
* PSBT independent record calls (#1037)
* PSBT independent record calls
* move logic to super class
Co-authored-by: Nadav Kohen <nadavk25@gmail.com>
* Reworked PSBT finalization to return a Try[PSBT] rather than an Option[PSBT] (#1036)
* PSBT signer property based tests (#1038)
* PSBT property based tests
* Address review
* PSBT Combiner property based tests (#1039)
* PSBT Combiner property based tests
* Create pruneGlobal util function
* Switch to arbitrary gen
* Use BaseTransaction instead of Transaction
* Fix transaction witness to work from base transactions
* PSBTs response to Chris's review (#1046)
* PSBT chris's review
* Rename val, give master fingerprint a val
* Formatting fix
* Responded to code review from chris assigned to nkohen
* Split PSBT.scala into many files
* PSBT Docs (#1048)
* PSBT docs
* Fix compiler error, remove nesting
* PSBT output updater tests
* Validate psbt outputs
* Clean up code
* Remove P2WPKHWitnessV0 addition
* format
* PSBT Updater property based tests
* Move code to match block
* EmptyScriptWitness check
* Address nadav review
* Remove unnecessary code, make utxo adder better
* Move require and add error message
* Move require
* PSBT unit tests by Ben
* Change to EmptyScriptPubKey
* Added unit tests to increase code coverage
* responded to review
* Move PSBT unit test to separate file
* Make unknown generator only generate distinct records
* Use groupBy key instead of distinct
* use only first element
* Combine distinctness by key
Co-authored-by: Ben Carman <benthecarman@live.com>
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'
* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction
* Add FundTransactionTests
* Move things to 'FundTransactionHandling' trait
* Start segregating things by HDAccount in the wallet, this gives us the ability to query for balances based on account, fund a transaction based on an account, generate a new address based on an account etc. All old api calls are now based on the default account, i.e. getBalance() returns the balance for account 0, fundRawTransaction funds the transaction from account 0 etc.
* Fix compile issue with 2.11.x
* Bump address generation Thread.sleep() to 500ms
* Address ben code review
* Address code review
* Introduced UTXOSpendingInfoSingle
* Implemented constructors for UTXOSpendingInfoSingle
* Introduced BitcoinSignerSingle
* Implemented SingleSigner
* Added property-based test for SingleSigner, it fails
* Fixed SignerTest :)
* Responded to code review
* Added scaladocs
* Fixed p2sh(p2wsh) signing
* Responded to code review and separated UTXOSpendingInfoSingle from UTXOSpendingInfoFull
* Fixed outputGen after rebase
* Fixed txbuilder.md to show this branch's changes
* Create 'fundRawTransaction' and 'fundRawTransactionInternal'
* Move TransactionTestUtil to testkit, begin writing tests for fundrawtransaction
* Add FundTransactionTests
* Move things to 'FundTransactionHandling' trait
* Address code review
* Run scalafmt
* Create MaskedToString, implement it in ECPrivateKey, ExtPrivateKey, MnemonicCode
* Add MaskedToString to AesPassword, AesKey, and BIP39Seed
* Add final to MaskedToString.toString() so it can't be overriden
* Add more expressive txo states for the wallet
* Rename 'PendingReceived/PendingSpent' -> 'UnconfirmedReceived/UnconfirmedSent'
* Address code review
* Fix posInt implementation to work with older scala versions
* Rename to PendingConfirmationReceived/PendingConfirmationSpent
* Create ExtSign, use it on ExtPrivateKey
* Add documentation on how to Sign things with ExtSign
* Add ExtSign.sign for a bip32 path
* Make sign(bytes,path) not return a Future, add documentation
* Address nadav's code review
* Fix mdoc sign.md
* Fix CLTV bug where timestamps using seconds are not allowed in TxBuilder
* Added test for CLTV second timestamp and ran scalafmt
* Fixed another bug
* Fixed bug where calcLockTime was not looking past first CLTV tx