Commit Graph

438 Commits

Author SHA1 Message Date
benthecarman
3d728837ee
Add ability to enter contract info in offer dialogue (#3160) 2021-05-27 06:54:46 -05:00
benthecarman
be8e965367
DLC Wallet pulldown (#3138)
* DLC Wallet pulldown

* Respond to review
2021-05-25 17:31:01 -05:00
Nadav Kohen
eafaff9ee8
Made DLCTxSigner's async signing methods actually multi-threaded (#3122) 2021-05-21 18:36:09 -06:00
Nadav Kohen
87f353b08f
DLC Adaptor Point Computation Memoization (#3110)
* A first attempt

* Made memoization conditional on CryptoContext

* Added scaladocs

* Responded to review and added a unit test
2021-05-21 17:40:28 -05:00
Nadav Kohen
ac3bae403b
Pulled down all remaining non-wallet non-gui code on adaptor-dlc (#3101) 2021-05-18 06:29:46 -05:00
Chris Stewart
7468cbec23
Optimize updateUtxoConfirmedStates() to fetch confirmations for blocks in parallel (#3094) 2021-05-16 17:10:58 -05:00
Chris Stewart
3205e4e275
Implement createCETsAndCETSigsAsync() to fix performance issue in test (#3089)
* 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
2021-05-14 17:59:56 -05:00
Nadav Kohen
58070f4120
Pulled down dlc and dlcTest projects into core and dlcTest (#3068)
* 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
2021-05-14 12:27:21 -05:00
benthecarman
2b8ac08cdc
Give oracle ability to sign messages with private key (#3070) 2021-05-12 10:09:34 -05:00
rorp
02c4505948
Initial Tor support (#3043)
* Initial Tor support

* cleanup
2021-05-07 06:43:39 -05:00
Nadav Kohen
6bc0943a62
Call decompression on public keys less (#2988)
* 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
2021-05-07 02:05:10 -05:00
Nadav Kohen
78f4dfb8c6
Pubkey Refactor (#2936)
* 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
2021-05-06 13:19:52 -05:00
Nadav Kohen
63a6f9309d
Introduced AsyncAdaptorSign and AdaptorSign traits (#3037) 2021-05-05 09:34:03 -05:00
Nadav Kohen
aacba1c077
Pulled down core diff from adaptor-dlc (#3038) 2021-05-05 09:26:09 -05:00
Chris Stewart
a55a97ba6f
Optimize shift operations in Number (#3025)
* Optimize shift operations in Number

* Fix imports
2021-05-04 13:35:45 -05:00
benthecarman
f86f90dc32
Add getbalances cli command (#3022)
* Add getbalances cli command

* Add docs

* Locked -> reserved
2021-05-04 12:19:15 -05:00
benthecarman
6fbaf9f9ce Add estimate fee cli command (#2983) 2021-04-28 16:43:20 -05:00
Chris Stewart
279b93f9e0 Rework P2SHScriptSignature.isStandardNonP2SH() (#2963)
* 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>
2021-04-26 12:46:50 -05:00
Chris Stewart
9ecea9f710 2021 04 24 bitcoin s scripts (#2961)
* 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
2021-04-25 14:03:22 -05:00
Chris Stewart
0aa32916ab Implement workaround for spendinginfodb by rescanning to find missing spendingTxId (#2918)
* implement workaround for rescanning to find missing spendingTxId

* Add links to PR

* Fix compile bug
2021-04-20 06:41:11 -05:00
Chris Stewart
238c083aad 2021 04 18 wallet received txo state (#2914)
* 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
2021-04-18 16:56:08 -05:00
Chris Stewart
a3954dbcae 2021 04 17 spendinfodb invariant (#2912)
* 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
2021-04-18 09:02:49 -05:00
benthecarman
8b8d5dcc0e Fix conversion from sats/vb to sats/kw (#2895)
* Fix conversion from sats/vbytes to sats/kw

* Add another test
2021-04-12 19:50:18 -05:00
Chris Stewart
85fb931cba Implement BIP32Path.fromHardenedString(). (#2886)
* 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
2021-04-09 13:19:11 -05:00
benthecarman
68a82deac3 Initial DLC Templates (#2847)
* Initial DLC Templates

* Respond to review

* Split up into ContractDescriptorTemplate

* Use match, add invariants
2021-04-07 10:28:44 -05:00
benthecarman
d0629486ab Wallet Rebroadcast Transactions thread (#2711)
* 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>
2021-04-07 08:13:43 -05:00
benthecarman
4055de7690 Inital LND rpc with some tests (#2836)
* Inital LND rpc with some tests

* Fix ZMQ test

* Correct datadirs

* Most tests

* Fix eclair tests

* Make tests less flaky

* Have CI download lnd

* Respond to some review

* Fix ZMQ tests

* Cached bitcoind for lnd tests

* Fix fixtures, bump timeout

* InstanceFactory & ConfigFactory

* Fix compile issue for 2.12.12

* Move factories to core.api.commons
2021-04-05 04:52:56 -05:00
benthecarman
3dbeac276e Add ability to delete Oracle signatures (#2851)
* Add ability to delete Oracle signatures

* Respond to review
2021-04-02 13:55:47 -05:00
benthecarman
fa80f36d2f Get all of Core working with JS (#2826)
* core-test-js-json

* Add SigPointComputer cross compile
Co-authored-by: Nadav Kohen <nadavk25@gmail.com>

* Fix java.time for scalajs

* InetAddress for scalajs

* Fix linking errors in coreTestJS

* Easy fixes

* InetAddress Tests

* Update micropickle, fix exact functions

* Get BigSizeUIntTest working with upickle

* Fix exact funcs

* Update Base58Test with upickle

* Update ScriptSignatureTest with upickle

* Update TransactionTest with upickle

* Update BlockFilterTest with upickle

* Update ScriptInterpreterTest with upickle

* Update MnemonicCodeTest with upickle

* Add InetAddress unit tests

* Fix compile errors

* Get core tests running, not passing

* Sign with js

* Fix PSBTUnitTest

* Fix PBKDF2 for JS

* Use bcrypto's secp256k1 instead of ecdsa

* Fix 2.12.12 compile

* Core tests passing :)

* Test corejs
2021-03-31 15:04:30 -05:00
benthecarman
8cd481650d Fix potential unordered nonces in announcement (#2831) 2021-03-28 11:44:47 -05:00
Nadav Kohen
e6899b20b1 Made ECPrivateKey signing synchronous and got src compiling (#2652)
Fixed tests

De-futured tx buidling, finalizing and signing

Responded to review
2021-03-23 17:05:58 -05:00
benthecarman
7aa3ccd974 Attempt to find type name when parsing incorrect tlv type (#2820) 2021-03-23 13:21:43 -05:00
rorp
911fca5825 Schnorr js (#2805)
* 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>
2021-03-22 12:56:40 -05:00
benthecarman
07514e2348 Remove logging from core (#2810)
* Remove logging from core

* Remove slf4j from testkit core

* Remove logback from coretest
2021-03-21 19:11:55 -05:00
benthecarman
b0f7d6f26b Implement bech32m (#2572)
* Implement bech32m

* Respond to review
2021-03-18 18:04:38 -05:00
benthecarman
12bff309c2 Add Broadcast TxoState (#2735)
* Add broadcast TxoState

* Update scaladoc
2021-03-18 14:16:53 -05:00
Chris Stewart
78448b277c Revert "Schnorr sigs for Scala.js (#2784)" (#2802)
This reverts commit 8e7bde0ed9.
2021-03-16 13:19:16 -05:00
rorp
8e7bde0ed9 Schnorr sigs for Scala.js (#2784) 2021-03-16 10:21:47 -07:00
benthecarman
9494eec1b8 Move blockhash to tx table from spending info table (#2744)
* 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
2021-03-16 10:05:29 -05:00
Chris Stewart
65cb0d1615 Move tests out of bitcoindRpcTest that belong in async-utils (#2796)
* Move tests out of bitcoindRpcTest that belong in async-utils

* Make AsyncUtilApi
2021-03-16 07:48:06 -05:00
benthecarman
4bf4f0a027 Add signed outcome to getevent rpc, fix other small api bugs (#2757)
* 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
2021-03-08 10:55:47 -06:00
benthecarman
8b6c0652a2 Completely remove range event descriptors (#2764) 2021-03-04 15:18:33 -06:00
Chris Stewart
e59057483f Resturcutre cryptoTest & coreTest to work with scalajs build (#2731)
* 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
2021-03-03 16:52:03 -06:00
Chris Stewart
5ba7b553b0 2021 02 27 dersignatureutil mv (#2730)
* 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
2021-02-28 07:09:22 -06:00
rorp
c90f318fd7 Refactor crypto module to be compatible with Scala.js part 1 (#2719)
* 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>
2021-02-27 05:58:20 -06:00
Chris Stewart
bf4afd63d1 Begin re-introducing parallelism in the wallet to make everything faster (#2705) 2021-02-24 07:10:46 -06:00
benthecarman
86566c575d Simplify oracle server RPC api (#2656) 2021-02-23 13:17:20 -06:00
Chris Stewart
f322a74ab0 2021 02 21 cheap redeemscript check (#2707)
* Add more cheap checks to see if a given script token is a redeemScript

* Make cheap witness version check before deserializing to a bytevector
2021-02-23 10:37:40 -06:00
Chris Stewart
63e44974f7 2021 02 20 number byte representation (#2703)
* Optimize unsigned numbers to use byte representation rather than hex representation

* Do the same thing with Int32/Int64

* Cleanup
2021-02-20 13:51:34 -06:00
benthecarman
b30fdf88ca Fix normalized string comparison (#2695)
* Fix normalized string comparison

* Add test
2021-02-19 12:09:55 -06:00