Commit Graph

33 Commits

Author SHA1 Message Date
Chris Stewart
328e1653a9
Drop support for scalac 2.12.x (#4704)
* Drop support for scalac 2.12.x

* Turn logging level OFF

* Remove more 2.12.x files
2022-09-03 10:16:22 -05:00
Nadav Kohen
9c9a0a618f
Update secp256k1-zkp (#3856)
* Added mac m1 binaries

* Added windows binaries

* Added linux binaries

* Updated secp256k1-zkp subdirectory

* Linux ARM binaries

* OSX 64 binaries

Co-authored-by: rorp <rorp@users.noreply.github.com>
2021-12-03 09:49:07 -06:00
rorp
560edf66d8
update osx64 secp256k1 binaries (#3531) 2021-08-12 07:08:11 -05:00
Chris Stewart
60dbd0252d
Update secp256k1 precompiled binaries to use safegcd code on linux64 (#3528) 2021-08-12 06:44:10 -05:00
Chris Stewart
e3ab76fe6b
update arm64 secp256k1 binaries (#3527) 2021-08-12 06:43:58 -05:00
Chris Stewart
8374ddf601
Removes dead symlinks for secp256k1 on osx_arm64 (#3279) 2021-06-16 11:03:22 -05:00
benthecarman
8b8066d1f3
Fix windows secp bindings (#3075) 2021-05-12 16:42:56 -05:00
Chris Stewart
1339abe410
2021 05 02 m1 secp256k1 natives (#3014)
* Add protoc exception for apples new chip arch. This requires protoc to be built manually as they do not natively ship m1 support yet

* Add osx_arm64 secp256k1 native binaries
2021-05-03 07:41:41 -05:00
Chris Stewart
0f8903e67e Upgrade to scalac 2.12.13 (#2509)
* Bump to 2.12.13

* Bump secp256k1jni.sbt
2021-04-29 09:15:36 -05:00
Nadav Kohen
7fd9aca304 Add Schnorr and Adaptor Secp Bindings and Update Adaptor (#2885)
* Replaced secp256k1 with secp256k1-zkp as submodule pointing to my java-bindings branch

* Built new binaries for schnorr signing and adaptor signing and integrated into LibSecp256k1CryptoRuntime

* Added public key compression function with tests, removed old adaptor signature point serializers

* Implemented ECDSA adaptor signatures in scala according to the most recent spec

* Added static test vectors for adaptor signing from spec

* Moved bouncy castle adaptor signing tests to .jvm

* Added scaladocs and responded to nits

* Added scaladocs with legends to spec naming

* Responded to Ben's review

* Fixed scala 2.12 compile issue

* Fixed BouncyCastle secKeyVerify

* Updated add-to-jni build instructions

* Updated secp256k1-zkp to target bitcoin-s-master

* Add windows binary (#14)

* Added Mac OS binaries

Co-authored-by: benthecarman <benthecarman@live.com>
2021-04-21 09:42:43 -05:00
Ben Carman
67e7426260 Windows Secp Update & fix for parsing Windows paths (#2398)
* Windows Secp Update

* Add docs about errors

* Fix paths in config

* Bump timeout
2020-12-21 16:34:53 -06:00
Chris Stewart
308e3c730d Remove autoScalaLibrary := false, this was not being used correctly and now is hindering builds on intellij (#2397) 2020-12-18 18:52:37 -06:00
Chris Stewart
79a85c04f8 Bump scalac setting in secp256k1jni.sbt to scala 2.12.12 (#2317) 2020-12-04 06:43:05 -06:00
rorp
444bd680a9 OSX native libsecp256k1 (#2014)
* OSX native libsecp256k1

* Add core and crypto tests to mac matrix

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-09-14 17:45:55 -05:00
Ben Carman
b6306a4caa Use safeRewind for signWithEntropy (#1774) 2020-08-10 10:17:41 -05:00
Nadav Kohen
666d53d94a Add low R signing (#1342)
* 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
2020-07-29 15:03:18 -05:00
Chris Stewart
cc25387b11 Create safeRewind() helper method in secp256k1jni (#1546) 2020-06-12 06:07:57 -05:00
Nadav Kohen
4f2c8f73f1 CryptoContext Refactor (#1469)
* Moved logic to disable use of secp256k1 library into crypto project

* Fixed secp doc
2020-05-26 13:05:21 -05:00
Nadav Kohen
c46a96b6e7 Update Secp256k1 (#1310)
* Rebased secp onto bitcoin-core's master (see https://github.com/bitcoin-s/secp256k1/pull/3) and built linux binaries

* Wrote a doc on adding to jni

* Built for website

* Added build instructions for other OSs

* Added table of contents using doctoc

* Edited .gitmodules

* Added windows binaries

* Updated secp branch

* Added osx binaries

* Added make check-java to doc

* Fixed typo
2020-04-14 15:42:58 -05:00
Chris Stewart
de46e74f1a Actually add all files for 0.3.0 on the website so they show up (#1256) 2020-03-19 07:32:02 -05:00
Nadav Kohen
e0b234843d Bouncy Castle Fallback (#1232)
* 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
2020-03-17 13:20:06 -05:00
Torkel Rogstad
f6ed565c14 Refactor sbt and make Eclair tests download bitcoind (#727) 2019-08-30 15:11:52 -05:00
Chris Stewart
98e6e0ea67 2019 07 01 windows secp256k1 bin (#559)
* Add windows 64 bit binary

* Add more instructions to README about building windows binary

* a windows CI environment

* Add logic to detect windows os, windows binary has a different file name

* Add a signature for the windows 64 bit binary
2019-07-02 05:42:49 -05:00
Chris Stewart
a3dd824e57 Node (#490)
* WIP: 2018 12 22 node project (#280)

* Add files from old spv node project

src compiling

test files compiling

ran scalafmt

Fix serializer tests

Get non networking test cases to work

WIP: Debug peermessagehandler

Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db

WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler

Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages

* Wip: Node refactor

* Create node test project, move all node tests into that project and move all generators for the node project into testkit

* Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver

* Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver

* update readme about status of node project (#359)

* Add flyway plugin to manage database schemas (#361)

* Add flyway plugin to manage database schemas

* Switch database driver to sqlite3 to be more portable, rework configs for sqlite3

* Set up sqlite database directories and files if they are not already created

* Add torkel's review

* Add chain, wallet, db-commons projects (#367)

* Add chain, wallet, db-commons projects

* Rework db creation logic if they db does not exist

* Add config logging to try to debug travis ci

* Pass explicit class loader for db config

* Remove duplicate call to dbConfig

* Make DbConfig.dbConfig a lazy val

* Remove noisy log

* Add scaladoc to DbConfig

* Switch dbConfig readme paragraphs

* Fix compile issues introduced during rebase onto master with rpc changes (#394)

* WIP: 2019 03 12 tip validation (#378)

* Implement blockchain handling data structures

Add TipValidation happy path

Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW

Add overflow check, fix endianness bug for checking proof of work

Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests

fix a few nits

Fix compile error, clean up unused import

Remove redundant files from node project

* Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project

* Add full POW change check in TipValidation, address code review nits

* Configure logging in chainTest, turn logging OFF in other test projects

* Address code review pt2

* Add coverage minimum for chain project (#398)

* Add coverage minimum for chain project

* Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests

* Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly

* Address code review, fix a flaky test in ClientTest.scala

* Test Fixtures (#403)

* Working test fixtures

* Removed ChainTestFixture trait in main code

* Composing Fixtures (#413)

* Downloaded over 9000 mainnet BlockHeaders into a json file

* Added new fixture with populated blockHeaderDAO

* Split writing to db into batches

* Rebased

* Simplified fixtures with makeFixture abstraction

* Added util functions for composing builders

* Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress

* Address code review

* wip

* A compiling withBitcoindZmqChainHandler fixture

* Tests passing!

* Made blockHeaderDAO private

* Got 9000 new block headers from 562375 to 571375

* Added offset to populated blockHeaderDAO fixture

* Added scaladocs to fixture things

* Initial wallet: import UTXO and spend it (#391)

* Updates ExtKeyVersion with fromChainParams method

* Add equals to Address

* Update BIP44 classes

* Add ScriptType

* Initial work on wallet support

* Add foreign keys pragma for SQLite

* Add UTXO models and DAO

* Add addres P2WPKH generation and WIP for addUTXO

* Add logging config for wallet

* Add change address generation, proper-ish addUtxo and sendToAddress

* Address code review on #391

* Add empty AES passphrase invariant

* Add poor mans test fixtures

* Add listUtxos, listAddresses and getBalance to wallet API

* Use fixtures from chain project

* Fix CI test failures

* Fix broken up package path

* Updates bloop config for new projects (#424)

* Multi fixture file (#419)

* Created FixtureTag and ChainFixture

Used ChainFixture in BitcoinPowTest

Added implicit conversions for nice syntactic sugar

* Added documentation for multi-fixture

* Made defaultTag a val

* add a logback-test.xml to the wallet project (#433)

* Introduce AppConfig that combines ChainParams and DbConfig (#432)

* 2019 04 23 app config per project db config per project (#434)

* Add DB conf file resolution that works across projects

* Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network

* Add ammonite to db-commons, remove noisy logs

* remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing

* Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object

* remove cast in Wallet.scala

* Add EnhancedEither class for 2.11 compat (#437)

Add implicit conversion from Either to
2.11-compatible Either-wrapper. Also
remove trailing comma in WalletTestUtil
that breaks 2.11 build.

* Fix CI tests hanging (#438)

* Execute wallet tests sequentially to avoid SQLite deadlocks

* Refactor logback config to reduce duplication

* Use in-memory SQLite DB for unit tests

* Debug prints for DatabaseConfig.forConfig

* Fork JVMs in test to ensure proper in-memory DBs

* Pass in Akka config to Eclair tests, avoid cluttering Akka log output

* Don't fork JVM on node tests'

* Move things out of ChainUnitTest (#448)

* Move things out of ChainUnitTest

* Remove printlns

* 2019 04 29 client test (#449)

* Bump timeout on connect to node test

* Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized

* Wrote tests for POW difficulty change calculation and header processing (#429)

Fixed BitcoinPowTest

Rebased onto AppConfig code

Rewrote ChainHandler integration test

Made chain handler test synchronous

Fixed a couple test bugs

Implmented a more efficient getAncestorByHeight

Fixed ChainHandler integration test by using the correct starting conditions

Responded to code review

Responded to more code review

Deleted redundant Pow test

Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance

* WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450)

* Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc

* Add check for having the best block hash in our chain state already

* Fix prev block hash to be empty hash if genesis block header

* BlockchainBuilder (#439)

* First commit for implementing a BlockchainBuilder

* use Builder rather than ReusableBuilder to be compatible with scala 2.11.x

* Decouple Blockchain & BlockHeaderDAO

* Rebase onto node, incorporate changes in #429

* Add more comments

* Reverse order of headers in builder

* rebase onot node branch, refactor apis

* DB: Add utility method for listing tables in a DB (#447)

* Node rebase (#458)

* Implement BIP32 path diffing

* Rebase node onto newest HD changes in master

* Fix 2.11 compile errors

* 2019 05 01 wallet ammonite scripts pt2 (#452)

* wip -- not finding testkit in doc worksheet

Wip -- classdef not found for create-wallet.sc

zmq bug

Clean up some logs

nest zmq start in bitcoindF

update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout

Rebase onto node branch with new configs

Successfully running ammonite script create-wallet.sc

2019 05 01 wallet ammonite scripts pt2 (#25)

* Refactor Ammonite dep

* Add basic error handling in AmmoniteBridge

* Add very basic README for doc project

Fix compile issues after rebasing onto master

Add code to sync our wallet code with bitcoind after creating a tx

* refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger()

* Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc

Co-Authored-By: Christewart <stewart.chris1234@gmail.com>

* 2019 05 05 sync chain (#460)

* Add code to sync our wallet code with bitcoind after creating a tx

Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest

* fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly

* rename script from persist-chain.sc -> sync-chain.sc

* fix 2.11.x compile issues

* Refactor chain, node, wallet config (#463)

* Refactor chain, node, wallet config

Get rid of NetworkDb, DbConfig
Add proper structure to conf system,
moving everything under the bitcoin-s
root key.

* Remove Scalacheck from node project

* Add doc on configuration

* Add override feature to AppConfig

* Address code review in #463

* Throw if default data dir is used in tests, add Scaladoc to AppConfig

* Add explanations for withOverrides, link to configuration.md from AppConfig

* Fix compile error

* Moves chain fixtures to testkit project (#475)

reset node files

* Store encrypted mnemonic to disk (#462)

* Add WalletStorage object

* Add encrypted mnemonic storage, locked wallet

Add lock and unlock operations to wallet.
Separate between locked and unlock wallet.

* Handle non-existant seed file

* Respond to code review from Chris

* Use val instead of import

* Add doc on how mnemonics are encrypted/stored

* 2019 05 15 spv sync headers (#479)

* Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit

* Implement test case to sync a header via spv into bitcoin-s

* Fix compiler errors

* Make node project Main runnable (#26)

* Add logging configuration to node project

* Make default config workable in non-test environments

* Add more logging of config in BH DAO and AppConfig

* Make Peer id optional

* Make node Main.scala runnable

* Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes

* Address code review from torkel

* Reintroduce withOverrides (#29)

* Turn off chain validation logs

* Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf

* Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF

* remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 09:53:00 -05:00
Torkel Rogstad
bdf589cdc7 updates osx binaries (#308)
* updates osx binaries

* Add doc on binary signing
2019-01-28 09:55:56 -06:00
Chris Stewart
ab95053af8 version 0.0.3 (#290)
* version 0.0.3

* Fix cross compile issues so we can now compile and publish a dependency for the scala 2.11 series

scalafmt

* bump versions on readme, try to fix scoverage crossversion issue

* Downgrade scoverage to try and get it to work with ci

* Tinker with scoverage versions

* Add suggestion from scoverage people to exclude secp256k1jni from build coverage
2019-01-10 09:07:18 -06:00
Chris Stewart
268e235b4d Add secp256k1jni readme, start working main project readme, move old readme to core/README.md (#276)
Add documentation for TxBuilder

Try to fix links on core/README.md

add readme badges for bintray

Nits and formatting of README (#23)

ran scalafmt, fixed format in secp readme
2019-01-08 09:29:06 -06:00
Chris Stewart
c12bc0dd59 Add osx to the operating system matrix (#273)
remove openjdk from ci matrix

Specify what osx image to use: https://docs.travis-ci.com/user/reference/osx#jdk-and-os-x

Try specify xcode9.3 in the os matrix

remove oraclejdk8 requirement

chmod on bitcoin binaries (#21)

* chmod on bitcoin binaries

* platform dependent binary fetchin

* platform dependent binary fetchin attempt 2

* bash is stupid

* bash is stupid take 2

* bash is stupid take 3

Remove DataTypeConverter dependency which was moved in the jdk

2018 12 17 add osx ci take2 (#22)

* bash is stupid take 4

* bash is stupid take 5

* bash is stupid take 6

bump timeout

reduce amount of blocks generated for pruned chain client

bump time out of encrypted wallet

fix comment

bump wallet encryption timeout... again
2018-12-18 19:29:59 -06:00
Dan-Smith-Suredbits
326d950ac3 Add 64 bit osx libsecp256k1 binaries (#272) 2018-12-17 16:11:42 -06:00
Chris Stewart
ad3f935e4e WIP: Add ability to publish to bintray, take on the org.scijava native-lib… (#268)
* Add ability to publish to bintray, take on the org.scijava native-lib-loader dependenency so we can bundle secp256k1 natively in a jar file and publish. This dependency will allow us to link the correct secp256k1 version dependending on the os and arch in the future

* Add sbt-pgp plugin to sign binaries, modify project names to all have the 'bitcoin-s-' prefix.

* Adding linux 32 bit secp256k1 natives to secp256k1jni project

* Add mising linux_64 binaries

* remove unused symlinks
2018-12-14 13:09:53 -06:00
Chris Stewart
44bccce602 Add hard coded secp256k1 files for linux x86_64 bit arch (#263)
* Add hard coded secp256k1 files for linux x86_64 bit arch

* Add binary files that ignored in .gitignore
2018-12-11 15:38:17 -05:00
Nadav Kohen
4b8cebf3a4 Added scalafmt and ran it (#264) 2018-12-09 14:43:31 -05:00
Daniel James
0309675528 Refactor multi-module build
- separate Java source copied from libsecp256k1 into separate module
- split main module into core core-gen core-test
  - generators can be published separated to core code for use in
    3rd-party tests
- code coverage needs to be aggregated
2018-05-02 16:18:01 -04:00