use bitcoin::blockdata::opcodes;
use bitcoin::network::constants::Network;
-use bitcoin_hashes::Hash as TraitImport;
-use bitcoin_hashes::hash160::Hash as Hash160;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::sha256d::Hash as Sha256d;
+use bitcoin::hashes::Hash as TraitImport;
+use bitcoin::hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::sha256d::Hash as Sha256d;
use lightning::chain::chaininterface;
use lightning::chain::transaction::OutPoint;
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use lightning::util::enforcing_trait_impls::EnforcingChannelKeys;
use lightning::ln::channelmonitor;
use bitcoin::network::constants::Network;
use bitcoin::util::hash::BitcoinHash;
-use bitcoin_hashes::Hash as TraitImport;
-use bitcoin_hashes::HashEngine as TraitImportEngine;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::hash160::Hash as Hash160;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::Hash as TraitImport;
+use bitcoin::hashes::HashEngine as TraitImportEngine;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use lightning::chain::chaininterface::{BroadcasterInterface,ConfirmationTarget,ChainListener,FeeEstimator,ChainWatchInterfaceUtil};
use lightning::chain::transaction::OutPoint;
fn get_destination_script(&self) -> Script {
let secp_ctx = Secp256k1::signing_only();
let channel_monitor_claim_key = SecretKey::from_slice(&hex::decode("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap();
- let our_channel_monitor_claim_key_hash = <Hash160 as bitcoin_hashes::Hash>::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize());
+ let our_channel_monitor_claim_key_hash = <Hash160 as bitcoin::hashes::Hash>::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize());
Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script()
}
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::blockdata::script::{Script, Builder};
use bitcoin::blockdata::block::Block;
use bitcoin::blockdata::transaction::Transaction;
[dependencies]
bitcoin = "0.21"
-bitcoin_hashes = "0.7"
lightning = { version = "0.0.11", path = "../lightning" }
secp256k1 = "0.15"
tokio = { version = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "sync", "tcp", "time" ] }
[features]
# Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks.
non_bitcoin_chain_hash_routing = []
-fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget", "bitcoin_hashes/fuzztarget"]
+fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget"]
# Unlog messages superior at targeted level.
max_level_off = []
max_level_error = []
[dependencies]
bitcoin = "0.21"
-bitcoin_hashes = "0.7"
secp256k1 = "0.15"
[dev-dependencies.bitcoin]
use bitcoin::blockdata::script::Script;
use bitcoin::blockdata::constants::genesis_block;
use bitcoin::util::hash::BitcoinHash;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::network::constants::Network;
use util::logger::Logger;
use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber};
use bitcoin::util::bip143;
-use bitcoin_hashes::{Hash, HashEngine};
-use bitcoin_hashes::sha256::HashEngine as Sha256State;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
-use bitcoin_hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::{Hash, HashEngine};
+use bitcoin::hashes::sha256::HashEngine as Sha256State;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::hash160::Hash as Hash160;
use secp256k1::key::{SecretKey, PublicKey};
use secp256k1::{Secp256k1, Signature, Signing};
//! Contains simple structs describing parts of transactions on the chain.
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
/// A reference to a transaction output.
#![allow(ellipsis_inclusive_range_patterns)]
extern crate bitcoin;
-extern crate bitcoin_hashes;
extern crate secp256k1;
#[cfg(test)] extern crate rand;
#[cfg(test)] extern crate hex;
use bitcoin::consensus::encode::{self, Decodable, Encodable};
use bitcoin::util::bip143;
-use bitcoin_hashes::{Hash, HashEngine};
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::ripemd160::Hash as Ripemd160;
-use bitcoin_hashes::hash160::Hash as Hash160;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::{Hash, HashEngine};
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::ripemd160::Hash as Ripemd160;
+use bitcoin::hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use ln::channelmanager::{PaymentHash, PaymentPreimage};
use ln::msgs::DecodeError;
use util::events::{Event, EventsProvider, MessageSendEvent, MessageSendEventsProvider};
use util::errors::APIError;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::Hash;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::Hash;
use ln::functional_test_utils::*;
use bitcoin::util::bip143;
use bitcoin::consensus::encode;
-use bitcoin_hashes::{Hash, HashEngine};
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::hash160::Hash as Hash160;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::{Hash, HashEngine};
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use secp256k1::key::{PublicKey,SecretKey};
use secp256k1::{Secp256k1,Signature};
use bitcoin::blockdata::constants::genesis_block;
use bitcoin::blockdata::opcodes;
use bitcoin::network::constants::Network;
- use bitcoin_hashes::hex::FromHex;
+ use bitcoin::hashes::hex::FromHex;
use hex;
use ln::channelmanager::{HTLCSource, PaymentPreimage, PaymentHash};
use ln::channel::{Channel,ChannelKeys,InboundHTLCOutput,OutboundHTLCOutput,InboundHTLCState,OutboundHTLCState,HTLCOutputInCommitment,TxCreationKeys};
use util::logger::Logger;
use secp256k1::{Secp256k1, Message, Signature, All};
use secp256k1::key::{SecretKey,PublicKey};
- use bitcoin_hashes::sha256::Hash as Sha256;
- use bitcoin_hashes::sha256d::Hash as Sha256dHash;
- use bitcoin_hashes::hash160::Hash as Hash160;
- use bitcoin_hashes::Hash;
+ use bitcoin::hashes::sha256::Hash as Sha256;
+ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+ use bitcoin::hashes::hash160::Hash as Hash160;
+ use bitcoin::hashes::Hash;
use std::sync::Arc;
use rand::{thread_rng,Rng};
use bitcoin::network::constants::Network;
use bitcoin::util::hash::BitcoinHash;
-use bitcoin_hashes::{Hash, HashEngine};
-use bitcoin_hashes::hmac::{Hmac, HmacEngine};
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
-use bitcoin_hashes::cmp::fixed_time_eq;
+use bitcoin::hashes::{Hash, HashEngine};
+use bitcoin::hashes::hmac::{Hmac, HmacEngine};
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::cmp::fixed_time_eq;
use secp256k1::key::{SecretKey,PublicKey};
use secp256k1::Secp256k1;
use bitcoin::consensus::encode;
use bitcoin::util::hash::BitcoinHash;
-use bitcoin_hashes::Hash;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::hash160::Hash as Hash160;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::Hash;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::hash160::Hash as Hash160;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use secp256k1::{Secp256k1,Signature};
use secp256k1::key::{SecretKey,PublicKey};
use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut, SigHashType};
use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
use bitcoin::util::bip143;
- use bitcoin_hashes::Hash;
- use bitcoin_hashes::sha256::Hash as Sha256;
- use bitcoin_hashes::sha256d::Hash as Sha256dHash;
- use bitcoin_hashes::hex::FromHex;
+ use bitcoin::hashes::Hash;
+ use bitcoin::hashes::sha256::Hash as Sha256;
+ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+ use bitcoin::hashes::hex::FromHex;
use hex;
use chain::transaction::OutPoint;
use ln::channelmanager::{PaymentPreimage, PaymentHash};
use bitcoin::blockdata::transaction::{Transaction, TxOut};
use bitcoin::network::constants::Network;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::sha256d::Hash as Sha256d;
-use bitcoin_hashes::Hash;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::sha256d::Hash as Sha256d;
+use bitcoin::hashes::Hash;
use secp256k1::Secp256k1;
use secp256k1::key::PublicKey;
use util::logger::Logger;
use bitcoin::util::hash::BitcoinHash;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::util::bip143;
use bitcoin::util::address::Address;
use bitcoin::util::bip32::{ChildNumber, ExtendedPubKey, ExtendedPrivKey};
use bitcoin::blockdata::constants::genesis_block;
use bitcoin::network::constants::Network;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::Hash;
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::Hash;
use secp256k1::{Secp256k1, Message};
use secp256k1::key::{PublicKey,SecretKey};
use secp256k1::key::PublicKey;
use secp256k1::Signature;
use secp256k1;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::blockdata::script::Script;
use ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
use ln::channelmanager::{PaymentPreimage, PaymentHash, PaymentSecret};
use util::ser::{Writeable, Readable};
- use bitcoin_hashes::sha256d::Hash as Sha256dHash;
- use bitcoin_hashes::hex::FromHex;
+ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+ use bitcoin::hashes::hex::FromHex;
use bitcoin::util::address::Address;
use bitcoin::network::constants::Network;
use bitcoin::blockdata::script::Builder;
use bitcoin::blockdata::script::Script;
use bitcoin::util::bip143;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use secp256k1::{Secp256k1, Signature};
use secp256k1;
use util::ser::{Readable, Writeable, LengthCalculatingWriter};
use util::logger::{Logger, LogHolder};
-use bitcoin_hashes::{Hash, HashEngine};
-use bitcoin_hashes::cmp::fixed_time_eq;
-use bitcoin_hashes::hmac::{Hmac, HmacEngine};
-use bitcoin_hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::{Hash, HashEngine};
+use bitcoin::hashes::cmp::fixed_time_eq;
+use bitcoin::hashes::hmac::{Hmac, HmacEngine};
+use bitcoin::hashes::sha256::Hash as Sha256;
use secp256k1::key::{SecretKey,PublicKey};
use secp256k1::Secp256k1;
use ln::msgs::LightningError;
use ln::msgs;
-use bitcoin_hashes::{Hash, HashEngine, Hmac, HmacEngine};
-use bitcoin_hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::{Hash, HashEngine, Hmac, HmacEngine};
+use bitcoin::hashes::sha256::Hash as Sha256;
use secp256k1::Secp256k1;
use secp256k1::key::{PublicKey,SecretKey};
use std::{cmp,error,hash,fmt};
use std::ops::Deref;
-use bitcoin_hashes::sha256::Hash as Sha256;
-use bitcoin_hashes::sha256::HashEngine as Sha256Engine;
-use bitcoin_hashes::{HashEngine, Hash};
+use bitcoin::hashes::sha256::Hash as Sha256;
+use bitcoin::hashes::sha256::HashEngine as Sha256Engine;
+use bitcoin::hashes::{HashEngine, Hash};
/// Provides references to trait impls which handle different types of messages.
pub struct MessageHandler<CM: Deref> where CM::Target: msgs::ChannelMessageHandler {
use secp256k1::Secp256k1;
use secp256k1;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
-use bitcoin_hashes::Hash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::Hash;
use bitcoin::blockdata::script::Builder;
use bitcoin::blockdata::opcodes;
use util::logger::Logger;
use util::ser::{Writeable, Readable};
- use bitcoin_hashes::sha256d::Hash as Sha256dHash;
- use bitcoin_hashes::Hash;
+ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+ use bitcoin::hashes::Hash;
use bitcoin::network::constants::Network;
use bitcoin::blockdata::constants::genesis_block;
use bitcoin::blockdata::script::Builder;
mod real_chachapoly {
use util::chacha20::ChaCha20;
use util::poly1305::Poly1305;
- use bitcoin_hashes::cmp::fixed_time_eq;
+ use bitcoin::hashes::cmp::fixed_time_eq;
use util::byte_utils;
use chain::transaction::OutPoint;
use chain::keysinterface::SpendableOutputDescriptor;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::blockdata::transaction::Transaction;
use secp256k1::key::PublicKey;
use bitcoin::blockdata::transaction::{OutPoint, Transaction, TxOut};
use bitcoin::consensus;
use bitcoin::consensus::Encodable;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use std::marker::Sized;
use ln::msgs::DecodeError;
use ln::channelmanager::{PaymentPreimage, PaymentHash, PaymentSecret};
impl Readable for Sha256dHash {
fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
- use bitcoin_hashes::Hash;
+ use bitcoin::hashes::Hash;
let buf: [u8; 32] = Readable::read(r)?;
Ok(Sha256dHash::from_slice(&buf[..]).unwrap())
use bitcoin::blockdata::script::{Builder, Script};
use bitcoin::blockdata::block::Block;
use bitcoin::blockdata::opcodes;
-use bitcoin_hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::network::constants::Network;
use secp256k1::{SecretKey, PublicKey};