* WIP createcontractinfo
* Fix ordering issue
* Use existing contract descriptor serializer, begin fixing test case
* Get DLCRoutesSpec createcontrafctinfo passing again
* Finish implementing createcontractinfo
* Add doc
* Fix native image build by adding hard coded static private key for OracleAnnouncementV0TLV.dummy
* Update ConsoleCli endpoints, update docs
* Rename methods in DLCOracleApi from signAnnouncement -> createAttestation
* Fix dates on deprecation
* WIP, createattestation rpc not working for some reason
* Fix misspelling
* Rename endpoint from createattestation -> signenum
* Fix docs
* Fix use of deprecated method after rebase
* Implement delete attestations
* Add DLCOracleApi.deleteAnnouncements()
* Make sure we don't have attestations before deleting announcements
* Add endpoint in OracleRoutes for delete announcement
* Add ConsoleCli implementation
* deleteattestations -> deleteattestation
* Document endpoints and add warnings
* Wire up ConsoleCli with deleteannouncement/deleteattestation
* Fix use of deprecated methods
* Deprecate things with the Event suffix in DLCOracleApi
* Rename classes used in OracleRoutes
* Rename endpoints
* Update docs
* listevents -> listannouncements
* Implement MasterXPubDAO
* Fix nits
* Add postgres migrations
* Make sure tables are getting cleaned on postgres
* Get dlcOracleTest test cases passing with validation of the master xpub in the database on startup
* Fix test case
* Fix more tests
* Move things around so keymanager does not need to depend on dbCommons
* Get all walletTest passing
* Add unit test for wallet startup
* Fix rebase
* Get all sqlite tests passing
* Get postgres test cases passing locally
* Remove early call to walletAppConfig.start() in node project
* Make KeyManagerAppConfig.externalEntropy private
* Fix MasterXpubDAO.existsOneXpub()
* Fix bug in migrating database for oralce project
* Sort DLC table by last updated
* Add LastUpdatedDb
* Make visible
* Fix compile
* Add time, fix sorting
* Switch to local time
* fix compile
* Fix test
* Fix postgres migration
* Specify zoneId
* relay flag in version message made configurable
* modified test classes as well
* Update configuration.md
* reverted few files and cleaned up format
* fixed mistake
* Add FutureUtilTest for both FutureUtil.batchAndParallelExecute and FutureUtil.batchAndSyncExecute
* Make Vector same size as available processors as CI machines don't have as many processors as I have locally
* Try to fix test case
* Add processors to the log
* Replace java scheduler with a scalajs scheduler called monix
* Make asyncUtilsTest compatible with Scalajs, add them to the CI matrix
* Add more missing runs of asyncUtilsTestJS/test
* Make it so table doesn't reorder on single update
* Default ordering by status
* Sort table on every update
* Secondary sort by evenId
* Sort by dlcId too
* Switch to contract Id
* Update instead of delete and replace
* move to function, use for updateDLCs
* Add unit test we can handle spending funds and receiving funds in the same transaction inside the wallet
* Use fundRawTranaction() to make sure the utxo is reserved
* WIP
* Add profit and loss and rate of return for entire wallet
* Fix rebase
* Address part 1 of code review from Ben
* Add unit test for wallet accounting
* Try to add block generate to address in fixture setup to get around the case where block headers & filter headers are synced but compact filters are not
* Push to github to force re-run of CI 2
* Add ChainApi.getBestFilter(), use it in sync to determine if filter headers & filters are in sync
* Push to github to force re-run of CI 3
* Simplify getBestFilter, add unit test
* Add more comments, clean up some code
* Rework findDLC(), break things out into separate objects to make things more testable and correct
* Address ben's code review
* Add caching of oracle outcomes we know are valid and broadcast
* Implement createCETsAndCETSigsAsync(), use this inside of TestDLCClient.setupDLCAccept()
* Switch to lazy val to cache sig point computation
* Add FutureUtil.batchAndParallelExecute() that does not take batchSize parameter, just compute it inside as a sane deafult
* Fix 2.12.x compiler error
* Pulled down dlc and dlcTest projects into core and dlcTest
Added dlcTest to CI runs and fixed compilation issues
* Fixed docs
* loosened fee rate bound assertions to only sanity test
* Removed type parameter from PublicKey
* Deduplicated call to public key decompression in isFullyValid
* Fixed FieldElement
* Added CurveCoordinate to replace FieldElement in places where it was being misused
* Added edge case tests
* Removed ExecutionContext from ECKey
* Refactored ECPublicKey to remove compression state and introduced ECPublicKeyBytes to handle cases where serialization of input is important
* Fixed the rest of bitcoin-s so that it passes all tests
* Made all ECKeys into case classes
* Successfully added isFullyValid invariant to ECPublicKey!
* Fixed docs
* Added scaladocs and fixed a RpcPsbtResult bug
* Reject private keys of length < 32 and fix WIF parsing bug
* Take ben's suggestion for parsing the entire tx hex
* Add assertion that the secondSPK is NOT a P2SHScriptPubKey, revert the classification of P2SHScriptPubKey in P2SHScriptSignature.isStandardNonP2SH()
* Revert conditionalSPK match logic
* Fixed ConditionalScriptPubKeyTest.scala (#32)
Co-authored-by: Nadav Kohen <nadavk25@gmail.com>
* Add new app/scripts project which is meant to store useful bitcoin-s scripts
* Add ScanBitcoind with an example of counting segwit txs between a range
* Fix bug of creating a new actor system everytime BitcoindRpcClient.apply(instance) is called
* Add BitcoindRpcClient.fromVersionNoSystem()
* Take ben's suggestions
* Fix compile
* Rework P2SHScriptSignature.isStandardNonP2SH() to account for nesting p2sh script inside of it
* fix compile on java8
* Enable app packaging in scripts project
* Add invariant to spendingInfoDb to that requires if the spendinginfodb is in a TxoState.spentStates, the SpendingInfoDb.spendingTxIdOpt is defined
* Remove unused SpendingInfoDAO.updateTxoState()
* Tighten up TxoState -> ReceivedState types we are using in the wallet. The ensures we are talking specific class of states (receiving a txo) rather than accounting for the case of spending and receiving since there is different information required for the spending states
* Add TxoState.ImmatureCoinbase to ReceivedStates
* Add invariant to spendingInfoDb to that requires if the spendinginfodb is in a TxoState.spentStates, the SpendingInfoDb.spendingTxIdOpt is defined
* Remove unused SpendingInfoDAO.updateTxoState()
* Remove comment
* Make TxoState and explicit parameter for test methods. Most test methods depend on a sample utxo state, so make the caller of the method specify what state they want the txo to be in
* Fix github actions config
* Fix RoutesSpec test
* Implement BIP32Path.fromHardenedString(). This will throw exceptions a non hardened path in the string exists
* Do what ben says rather than re-implementing BIP32Path.fromString
* Wallet Rebroadcast Logic
* Use wallet scheduler for address queue rather than it's own thread
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Bump default
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Schnorr sigs for Scala.js
* fix build
* put BIP340 test vectors in a shared space
* remove teskit dependency, fix point edge cases
* fix build
* add unit tests for point addition
* scaladoc
* cleanup
* respond to the comments
* Fix usage of BitcoinSLogger
Co-authored-by: christewart <stewart.chris1234@gmail.com>
* Move blockhash to tx table from spending info table
* Add test, fix spending tx id col name
* Scaladocs, add test
* Add more unit test
* Make id not comparable in process tx test
* Fix tests
* attempt to fix
* Add mempool comment to scaladoc
* Deparallelize process inputs & outputs
* Add signed outcome to get event rpc, fix other small api bugs
* Create separate type for decomp DLCAttestationType
* Add DLCOutcomeType to Oracle Event
* Calculate dlcOutcome, add invariant
* Fix test
* Get cryptoTest,coreTest projects working with scala-js
Get build working, now moving onto compile
Move jvm specific cryptoTest's into the .jvm sub project
Rework build definition names to be more concise
Fix missing cryptoTest refactor
Move logback-test.xml into jvm specific resource folder so it doesn't get ignored
Make coreTest a crossProject
Rework ci matrix to work with new project structure
Try to fix CI matrix
CI fix part 2
* Apply commonSettings to all cross projects
* Address part of roman's code review, make coreJS, make cryptoTest.dependOn(crypto)
* WIP to share with scala-js community
* Fix scalac compiler settings to be additive in CommonSettings.settings
* Remove BCryptoTest
* Move CryptoParams to shared crypto project, make BouncyCastleCryptoParams for bouncy castle specific things
* Rework build structure to work better with scalajs
* Add unit test to make sure CryptoParams & BouncyCastleCryptoParams are consistent
* Refactor crypto module to be compatible with Scala.js
* more changes
* some more changes
* abstract out Schnorr stuff
* abstract out adapter stuff
* cleanup
* some more cleanup
* fix build
* Removed references to ECPoint outside of .jvm scope
* remove references to ECPoint from the shared code
* cleanup
* remove cirlular dependencies
* more cleanup
* cleanup
* move SipHash to CryptoContext
* scaladoc
* scalafmt
Co-authored-by: nkohen <nadavk25@gmail.com>
* Add walletinfo rpc
* Move rootXpub to key manager obj
* Make configuration keys for getinfo the same as the ones in our configuration files
* Cleanup
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Implement oracleAttestmentV0TLV, save outcome to db
* Update with tlv changes
* Update tlv to not have 2 list sizes
* small change
* Update OracleEvent.verifyAttestations
* Use correct pub key
* Verify correct outcomes
* Rename NodeUnitTest.confg -> NodeUnitTest.getFreshConfig()
* Rename CachedBitcoinSAppConfig.config -> CachedBitcoinSAppConfig.cachedConfig
* Make CachedChainAppConfig extend CachedBitcoinSAppConfig
* Make ChainApi.processHeaders() return a failed future in the case we have no valid headers
* Run scalafmt
* Fix test case to check if promise is completed yet
* WIP: Get something working that isn't network specific
Start putting things back in place
Add comment
Revert logback file
Remove BitcoinSLogger object
* Fix unused import
* Get rid of annoying diff
* Fix spacing nit
* WIP
* Get neutrino node with wallet 'receive information about received payments' working again
* Fix compile
* Remove initial sync logic from test case
* Remove sync logic in NeutrinoNodeWithWallet test cases
* Improve logging and rename a few things
* WIP2
* WIP3
* Get NeutrinoNodeWithWallet tests working
* Implement WalletSync, which allows you to sync a wallet from a arbitrary data source
* Get all tests passing again
* Use spv.appConfig in DataMessageHandlerTest rather than caching the config
* Modify cleanup to hopefully get CI passing
* Fix postgres tests by cleaning the table during the destroy phase of the test fixture. This is needed because the same postgres database is shared between tests in the same test suite
* Revert logback-test.xml
* Get sqlite/postgres tests passing pt 2
* syncHeight -> syncDescriptorOpt()
* Add case for genesis block hash in WalletSync
* Fix SpvNodeWithWallet test case to actually test spv functionality
* Remove nodeCallbacks parameters, callbacks should be registered on nodeAppConfig
* Moved dlc data structures from commons to core
* Renamed DLC payout curve classes
* Split OutcomeValuePoint up into an ADT
* Added utility for computing Schnorr multiple-signature points
* Replaced tuples in RoundingIntervals with types
* Replaced tuples in DLCPayoutCurve with Indexed
* Fixed a compile bug
* Pulled down work from adaptor-dlc onto master
* Reverted some accidental deletions
* Removed unused import
* Added scaladocs
* Responded to Ben's review
* Added some scaladocs and invariants
* Responded to chris' review
* Responded to more review
* Added some comments
* Get Scala 2.13.4 compiling
* Fix broken test case, in general use if() else() statements for Vectors rather than pattern match as I am unsure of how to correctly pattern match on Vector0,Vector1,...,Vector6()
* Bump CI to 2.13.4
* OVerride CurrencyUnit.equals() so that it works on Scala 2.13.4, not sure why there was a regression here between Scala versions 2.13.4/2.13.3
* Add explicit unit tests making sure bitcoin/satoshi currency units are equivalent
* Introduce ChainHandlerCached which behaves like the old ChainHandler. Now Chainhandler.getBestBlockHeader() will read headers from the database
* Remove ChainHandler.blockchains field, now it's only available in ChainHandlerCached
* De-futurify ChainHandler.fromDatabase()
* Adjust logging
* Patch test case
* Use BlockHeaderDAO.chainTips when getting best header rather thean BlockHeaderDAO.getBlockchains(). Implement a helper method ChainHandler.toChainHandlerCached()
* Fix chain.md,wallet.md
* Make ChainHandler.getBestBlockHeader() consider time of header if chainwork is the same. Make test cases less strict on what header is the best header when both chainwork and time are the same on the eader
* Only execute callbacks on headers that are going to be created in the database, not all headers passed into ChainHandler.processHeadersWithChains()
* Turn up log level again
* Small optimizations, check if we have seen a header before before processing it in ChainHandler.processHeadersWithChains(). Fix FilterSyncMarker.toString(). Use ChainHandlerCached in Node
* Remove ChainHandlerCached in appServer, re-add it in Node.scala
* Update Oracle to use new TLVs
* Rename things to use new names, scaladoc, small clean ups
* Add descomposition tests, docs, sign numbers outside of range
* Update Oracle TLVs
* Change string size to be BigSizeUInt
* Move nonces to oracle event tlv
* Introduced EventDescriptor tests and NumericEventDescriptor methods to query possible outcome data
* Added contains function
* Added tests for containsToPrecision
* Remove EventDescriptor.outcomes and other related fields
* remove unused formatNum method
* Address code review from Ben
* Move oracle pub key to announcement
Co-authored-by: nkohen <nadavk25@gmail.com>
Co-authored-by: christewart <stewart.chris1234@gmail.com>
* Make aesPassword option for wallet config
* Add to docs
* Make AesPassword optional
* Small touchups
* Fix for oracle server
* Fix docs
* Increase code coverage
* Cleanup a bunch of imports in test
* Use @nowarn annotation for testing things that are deprecated
* Fix base58 test
* Cleanup crypto-test
* Use scala collection compat dependency to get access to the @nowarn annotation on scala 2.12.x
* Rework more scala 2.13.x compile failures in chain-test and key-manager-test
* Optimize imports for entire project
* Fix nits
* Fixed P2SH(Segwit) bug and allowed redeem scripts when calling addFinalizedScriptWitnessToInput
* Add test
Co-authored-by: Ben Carman <benthecarman@live.com>
* 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
* Introduce 'FilterSyncMarker' to ChainApi, make it clearier what exactly the (Int,DoubleSha256Digest) tuple is returned from ChainApi.nextBlockHeaderRange()
* Fix doc
* Add scaladoc to FilterSyncMarker
* Rebase onto master, fix conflicts to use FilterSyncMarker
* Pull over test cases, WIP
* Rework ChainHandler.nextBlockHeaderRange() to use hashes rather than heights to very integrity of header chain, add test case
* Modify test case to make sure we are generating the 'heaviest chain work' header as first in the tuple that is used in reorg test cases
* Refactor to helper method called 'findNextHeader()' to make things simpler
* Add scaladoc to ChainHandler.findNextHeader()
* WIP
* Fix bugs in ChainApi.nextBlockHeaderRange(), now return (startHeight,stopHash) rather than (stopHeight,stopHash)
* Get chain handler tests passing, remove genesis filter header/fitler from default chain project fixture, make it a specialized one to have genesis filter header/filter in the database. Use that specialized fixture in ChainHandlerTest for now
* FilterSync work without having the genesis filter and filter header inserted into the database
* fix bug in DataMessageHandler where we were using sendNextGetCompactFilterHeadersCommand rather than using peerMsgSender.sendGetCompactFilterHeadersMessage
* Refactor ChainHandler.findNextHeader() to centralize where chains are fetched
* Address ben's code review
* 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
* Output logger configuration on startup now
* Remove core-test/logback-test.xml and core/common-logback.xml, consolidate and move them into testkit/src/main/resources/logback.xml
* Add comment for logging configuration
* Added signing with entropy to the JNI and implemented low R signing
* Added check for determinism of low R signing
* Cleaned up test
* Implemented signing with entropy in Bouncy Castle
* Added docs for signing with entropy
* Fixed things after rebase
* De-parallelized signLowR and added scaladoc warnings to signWithEntropy
* 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
* Implement best block hash correctly
* Handle no common history
* Fix getBlockProof to be BigInt instead of UInt32
* Fix warnings
* Make get best filter use chainwork
* Remove unused function, test isMissingChainWork
* Fix comparisons for chain work in sql
* Fix migrations from rebase
* Fix CI error
* Fix postgresql