This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elements-cli -rpcwallet=$$$ listunspent | jq '.[] | select(.asset == "54421555c89fbda44787e4b65866a98bdae65f030401b0a05fdc8988b6c4f162")' | |
{ | |
"txid": "e561c30c8d6c95441740321d6cf7a667ebd43e37d2b0d0be41eebab5a9319bdc", | |
"vout": 0, | |
"address": "ert1qfthk6r730pd85ecrkz9xqm2hx23fapheh27weh", | |
"scriptPubKey": "00144aef6d0fd1785a7a6703b08a606d5732a29e86f9", | |
"amount": 0.0001, | |
"asset": "54421555c89fbda44787e4b65866a98bdae65f030401b0a05fdc8988b6c4f162", | |
"amountblinder": "0000000000000000000000000000000000000000000000000000000000000000", | |
"assetblinder": "0000000000000000000000000000000000000000000000000000000000000000", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redis configuration file example. | |
# | |
# Note that in order to read the configuration file, Redis must be | |
# started with the file path as first argument: | |
# | |
# ./redis-server /path/to/redis.conf | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------- | |
# PostgreSQL configuration file | |
# ----------------------------- | |
# | |
# This file consists of lines of the form: | |
# | |
# name = value | |
# | |
# (The "=" is optional.) Whitespace may be used. Comments are introduced with | |
# "#" anywhere on a line. The complete list of parameter names and allowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostgreSQL Client Authentication Configuration File | |
# =================================================== | |
# | |
# Refer to the "Client Authentication" section in the PostgreSQL | |
# documentation for a complete description of this file. A short | |
# synopsis follows. | |
# | |
# This file controls: which hosts are allowed to connect, how clients | |
# are authenticated, which PostgreSQL user names they can use, which | |
# databases they can access. Records take one of these forms: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2009-2010 Satoshi Nakamoto | |
// Copyright (c) 2009-2017 The Bitcoin Core developers | |
// Distributed under the MIT software license, see the accompanying | |
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
#include <validation.h> | |
#include <arith_uint256.h> | |
#include <chain.h> | |
#include <chainparams.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2009-2010 Satoshi Nakamoto | |
// Copyright (c) 2009-2019 The Bitcoin Core developers | |
// Distributed under the MIT software license, see the accompanying | |
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
#include <miner.h> | |
#include <amount.h> | |
#include <chain.h> | |
#include <chainparams.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2010 Satoshi Nakamoto | |
// Copyright (c) 2009-2018 The Bitcoin Core developers | |
// Distributed under the MIT software license, see the accompanying | |
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
#include <chainparams.h> | |
#include <chainparamsseeds.h> | |
#include <consensus/merkle.h> | |
#include <tinyformat.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn redeem_htlc_with_secret() { | |
let _ = pretty_env_logger::try_init(); | |
let docker = Cli::default(); | |
let container = docker.run(BitcoinCore::default()); | |
let client = tc_bitcoincore_client::new(&container); | |
client.generate(432).unwrap().unwrap(); | |
let (txid, vout, input_amount, htlc, _, secret, keypair, _) = fund_htlc(&client); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn can_be_unlocked_with( | |
&self, | |
got_secret: Secret, | |
got_keypair: KeyPair, | |
) -> Result<(), UnlockingError> { | |
let got_pubkey_hash: PubkeyHash = got_keypair.public_key().into(); | |
let got_secret_hash = got_secret.hash(); | |
let expected_pubkey_hash = self.recipient_redeem_pubkey_hash; | |
let expected_secret_hash = &self.secret_hash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn create_htlc( | |
recipient_pubkey_hash: &PubkeyHash, | |
sender_pubkey_hash: &PubkeyHash, | |
secret_hash: &[u8], | |
redeem_block_height: u32, | |
) -> Script { | |
let script = Builder::new() | |
.push_opcode(OP_IF) | |
.push_opcode(OP_SHA256) | |
.push_slice(secret_hash) |
NewerOlder