* Fixed PSBT.verifyFinalizedInput to allow NonWitnessUTXO to be set with a WitnessUTXO
* Added unit test
* Fixed bug where verifyFinalizedInput was also broken for P2SH(Segwit)
* Implement StringFactory on the companion object for BtcHumanReadablePart
* Make Bech32.checkHrpvalidity() take in a string rather than a Bech32HumanReadablePart as a parameter, now we check validity _just_ according to the bech32 standard, not specific applications light lightning / bitcoin
* Add missing override
* Overload Bech32.checkHrpValidity() to pass in a 'StringFactory' in cases where you know what HRP you expect
* Do nadav's suggestion on Bech32.splitToHrpAndData() -- allow a factory to be passed in parameterized with the type you expect
* Create FeeUnitFactory and functions to calculate tx fee rates
* Remove useless override, use factory
* doc
* Scaladocs + use vals
* Fix scaleFactor being set as default value
* Apply string factory to a bunch of easy things
* Refactor HDPath, ExtKey, and LnTagPrefix to use StringFactory
* Implemen StringFactory on LnHumanReadablePart, ScriptType, ServiceIdentifier
* Implement StringFactory on AesCrypt, NodeUri, AddressTag, PSBT, TxoState
* Fix failing tests, fix website compile
* Apply StringFactory to all ScriptOperations, ChannelState, Script Parsing
* Update scalafmt-core to 2.6.0
* Upgrade scalafmt, fix all formatting errors
* Scalafmt on 2.12
* fix test
* More fixes
Co-authored-by: Ben Carman <benthecarman@live.com>
* Pulled down crypto things from dlc branch including: Schnorr data structures, Schnorr Bouncy Castle implementation, FieldElement, and tests for these things
* Call fromValidHex in CryptoUtil
* Made the standard non-interactive tx finalizer simple using composition of its (reusable) pieces
* Responded to code review and made minor improvements
* Fixed docs
* Add more optimizations, MultSignatureScriptPubKey.isMultiSignatureScriptPubKey() fails fast if it's not a valid multisig spk, also use more caching inside of Number's (UInt64, UInt32, etc)
* Fix shortChannelidTest
* Cache popular UInt64 numbers that are used in ScriptPubKey's. This reduces allocations which reduces memory usage
* Refactored Transaction
Created RawTxBuilder
Created RawTxFinalizer as layer on top of RawTxBuilder
Introduced RawTxSigner and replaced TxBuilder!
Deleted TxBuilder!
* fixed things after rebase
* Made RawTxBuilder compatible with older versions of scala
* Began responding to review
* Made Finalizer take a Builder rather than the other way around
* Added composition for finalizers
* Ran scalafmt
* Updated txbuilder example documentation
* Moved tests from old TxBuilderTest files to relevant new test files
* Added scaladocs
* 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