Commit Graph

214 Commits

Author SHA1 Message Date
Tamas Blummer 5e510366cf is_on_main_chain is a very useful function upstream, make it public 2018-03-03 18:15:05 +01:00
Andrew Poelstra 066c49305f update secp256k1 to latest version with minimized dependencies 2018-02-20 16:19:29 +00:00
Andrew Poelstra 23a2c6bc9a remove `jsonrpc` dependency by copying the macro we need into the source 2018-02-18 15:28:39 +00:00
Andrew Poelstra 047c0c149d remove `num` crate dependency 2018-02-18 15:21:13 +00:00
Andrew Poelstra 9562d8afac
Merge pull request #41 from tamasblummer/minimal_alert_message
minimal implementation of alert message
2018-02-18 15:00:55 +00:00
Andrew Poelstra 71bce7b067
Merge pull request #44 from tamasblummer/add_difficulty2
Add difficulty calculation
2018-02-18 14:59:36 +00:00
Andrew Poelstra 91a786d22c
Merge pull request #42 from tamasblummer/add_low_u64
add low_u64 to Uint256 and Uit128 types
2018-02-18 14:57:37 +00:00
Andrew Poelstra 3547d27430
Merge pull request #40 from tamasblummer/unit_debug_fix
fixing debug output for Uint256 and Uint128
2018-02-18 14:57:00 +00:00
Andrew Poelstra 7930d14124
Merge pull request #38 from apoelstra/bip143
util: add `bip143` module to create BIP143 signature hashes
2018-02-16 22:13:55 +00:00
Andrew Poelstra 9f092a6f31 remove all use of mem::uninitialized and mem::copy_nonoverlapping 2018-02-14 16:53:49 +00:00
Matt Corallo 9052f3b5a2 Fix argument to copy_nonoverlapping in internal_macros
This resolves a segfault due to unsafe code.
2018-02-13 19:08:10 -05:00
Tamas Blummer 3efe511cc6 add difficulty calculation 2018-02-11 19:58:26 +01:00
Tamas Blummer 19f96fe62c add low_u64 to Uint256 and Uit128 types 2018-02-11 14:19:58 +01:00
Tamas Blummer 9fbe941621 minimal implementation of alert message 2018-02-11 14:08:33 +01:00
Tamas Blummer e05f45beb0 fixing debug output for Uint256 and Uint128 2018-02-11 14:04:35 +01:00
Andrew Poelstra f233fcac61 util: add `bip143` module to create BIP143 signature hashes 2018-01-15 17:54:32 +00:00
Andrew Poelstra b3644b7b6d add constants for OP_CLTV and OP_CSV 2017-12-21 01:10:00 +00:00
Andrew Poelstra 406160a386 transaction: add txid() function that does the right thing for segwit/nonsegwit
With Segwit transactions `bitcoin_hash()` is no longer sufficient to get a txid.
2017-12-09 19:52:09 +00:00
Andrew Poelstra c691d0e382 util: add Sha256dEncoder to allow streaming data into a hash
This is needed to for a sane BIP143 implementation. Should be exactly equivalent to
serializing data into a vector then hashing that vector for all types.
2017-12-06 16:50:47 +00:00
Andrew Poelstra e5f109221e script: add `to_p2wsh()` and `is_p2swsh()` functions to allow easy segwit output computation 2017-12-06 15:39:37 +00:00
Andrew Poelstra c341e21dc6
remove unnecessary `mut` that nightly rustc has learned to detect 2017-10-06 19:56:50 +00:00
Andrew Poelstra 46439710d9
script: add `is_p2pkh()` function 2017-10-06 19:15:30 +00:00
Andrew Poelstra 8f7bd858fb
update byteorder to 1.1 from 0.3 2017-07-28 16:19:44 +00:00
Andrew Poelstra 2e7be81ea4 add unit test for overflow panic 2017-06-07 16:09:40 +00:00
Daniel Lockyer a74efe6f8c Sanity checks for vector length 2017-06-05 18:06:30 +01:00
Andrew Poelstra cdb452f79f Sanity-check vector length when deserializing 2017-04-17 00:54:38 +00:00
Andrew Poelstra 4b73c3223c Merge pull request #18 from rotwatsb/GetAddr
Add GetAddr message
2016-10-12 11:26:48 +00:00
Steve Bradley f7fed8339d Add GetAddr message 2016-10-10 11:14:12 -04:00
Andrew Poelstra 02718be82f Remove unused `num_cpus` dep 2016-10-10 13:09:40 +00:00
Andrew Poelstra e3c793f702 uint: bugfix in trailing_zeroes() 2016-08-26 16:20:26 +00:00
Andrew Poelstra af10b153be segwit: add transaction/block serialization support for BIP141/BIP144; bump to 0.8
Do not yet support new sighash type
2016-08-24 16:24:55 +00:00
Demur Rumed 5dda3e2602 Replace time with std::time 2016-07-17 04:02:57 +00:00
Andrew Poelstra 93f103bdb5 script: fix broken push_int in script::Builder 2016-07-14 15:15:34 +00:00
Andrew Poelstra 9d2826d5d1 bip32: error API cleanups 2016-06-24 19:45:42 +00:00
Andrew Poelstra f7d4ae8265 bip32: add accessor for the tweak used in public key derivation 2016-06-24 19:25:47 +00:00
Andrew Poelstra 14af175a11 Resurrect BIP32 support 2016-06-24 19:15:57 +00:00
Andrew Poelstra 698a23e32d script: fix Debug impl bugs in Script, PUSHDATA1 not displayed correctly 2016-06-24 00:20:49 +00:00
Andrew Poelstra 1e47019221 cargo-clippy cleanups 2016-06-21 14:35:27 +00:00
Andrew Poelstra 1dbd1c28dc Implement stdlib Error trait for util::Error type 2016-06-20 01:25:54 +00:00
Andrew Poelstra 50b3e90912 Rename Transaction::scripthash to Transaction::signature_hash
Yes, this is a major release because I misspelled the name of a function :)
2016-06-13 21:25:47 +00:00
Andrew Poelstra 38b2cacf35 Add support for computing transaction sighashes, which is needed for signing 2016-06-12 18:25:23 +00:00
Andrew Poelstra 220775015e [BREAKING CHANGE] [v0.5 -> v0.6] Move nasty script stuff into a feature-gated module 2016-06-12 00:36:46 +00:00
Andrew Poelstra 46681bbcac contracthash: expose key tweak in new function
Needed for applications where the tweak and the secret key material are on different
devices (and the one with the secret material does not want to know how to compute
the tweak itself).
2016-06-10 18:36:15 +00:00
Andrew Poelstra 6ccd157775 Add `into_vec` method to Script 2016-06-02 23:47:29 +00:00
Andrew Poelstra 35832e3da0 Remove some unused trait imports 2016-05-27 18:36:42 +00:00
Andrew Poelstra 30904b67a7 Derive Eq and friends for script::Instruction 2016-05-04 14:03:58 +00:00
Andrew Poelstra 96b4b050fd Serialize Sha256Hash without allocations 2016-05-03 20:16:30 +00:00
Andrew Poelstra f906c2fddd Add `first_push_as_number` function to contracthash templates
This is a bit of a hack to let users of the contracthash API to determine
how many sigs are required when signing a multisig contract.
2016-03-29 17:24:34 +00:00
Andrew Poelstra f18157e774 Minor code changes for new rustc/clippy. No effects. Update minor version number 2016-02-18 19:44:29 +00:00
Andrew Poelstra 5f308887c9 Fix test added for serde transaction roundtrip 2016-02-18 18:02:04 +00:00