--- Day changed Fri Jul 27 2018 20:18 < andytoshi> updating rust-bitcoin to the new rust-secp API was surprisingly not hard. the BIP32 api was most of the issue 20:18 < andytoshi> got rid of a few error returns in address.rs which is nice 20:18 < andytoshi> https://github.com/rust-bitcoin/rust-bitcoin/pull/113 20:19 < andytoshi> and i like that the function signatures now have `secp256k1::Signing` in them whenever they handle secret data, that's a helpful cue 23:52 < dongcarl> Is there any way to do a single SHA256 in rust-bitcoin? I see only SHA256d 23:53 < dongcarl> Trying to do P2WPKH 23:55 < andytoshi> can you use one of the existing methods on Script? 23:55 < andytoshi> the answer is no, because sha256 was never used in bitcoin until segwit randomly introduced it in a couple places 23:56 < andytoshi> relatedly, when we make serde optional, `rust-crypto` will be responsible for the majority of the deps on rust-bitcoin (which is an awesome accomplishment, we'll be down from 50+ dependencies last year to less than 10) 23:56 < dongcarl> Seems like I can just use crypto::sha2::Sha256? Can't use existing Script ones as I'm trying to check if a scriptPubKey corresponds to a PublicKey 23:56 < andytoshi> so maybe we sholud implement all the hash functions in our own crate 23:57 < andytoshi> I suspect there's a chain like Address::from_public_key().to_scriptpubkey().to_p2sh().to_v0_p2wsh() or something that'll do it.. 23:58 < dongcarl> Seems like crypto::sha2::Sha245 would be simpler? 23:58 < dongcarl> Since we're keeping this dependency? 23:59 < andytoshi> if you're working on rust-bitcoin you can use crypto::sha2::Sha256 23:59 < andytoshi> but rust-bitcoin does not expose sha256 anywhere 23:59 < dongcarl> Sha256* lol 23:59 < dongcarl> Right 23:59 < dongcarl> Sounds good 23:59 < andytoshi> but yeah ... i'd like to pull sha256, sha256d, ripemd160 into their own crate that simply implements these hash functions in the ways that bitcoin needs, and has no further deps