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
use std::str::FromStr; | |
use bitcoin::Address; | |
use bitcoin::secp256k1::{Secp256k1, Message, SecretKey}; | |
use bitcoin::blockdata::script::{Builder, Script}; | |
use bitcoin::{Transaction, TxIn, OutPoint, hashes::hex::FromHex, SigHashType}; | |
use bitcoin::hashes::Hash; | |
use bitcoin::consensus::{encode::{serialize_hex}}; | |
fn main() { | |
let prev_tx_id = "56e9d34f8bff598068df6d3e4c712308500f706b49610f2b245d48a1cc5551e4"; |
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
### Keybase proof | |
I hereby claim: | |
* I am kannapoix on github. | |
* I am kanna (https://keybase.io/kanna) on keybase. | |
* I have a public key ASCG0mGzPEJ-PAQpNFgsu3DuxPslNe6tWaRJVW9YH6AH9go | |
To claim this, I am signing this object: |
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
# bip47 Pyament Code @ https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki#version-1 | |
# bitcoionrb @ https://github.com/chaintope/bitcoinrb | |
require 'bitcoin' | |
require 'ecdsa' | |
group = ECDSA::Group::Secp256k1 | |
include Bitcoin | |
include Bitcoin::Util | |
Bitcoin.chain_params = :mainnet |
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
# bip47 Pyament Code @ https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki#version-1 | |
# bitcoionrb @ https://github.com/chaintope/bitcoinrb | |
require 'bitcoin' | |
include Bitcoin | |
bip32_master = Bitcoin::ExtKey.generate_master('64dca76abc9c6f0cf3d212d248c380c4622c8f93b2c425ec6a5567fd5db57e10d3e6f94a2f6af4ac2edb8998072aad92098db73558c323777abf5bd1082d970a') | |
depth3 = bip32_master.derive(47, harden=true).derive(0, harden=true).derive(0, harden=true) |
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
require 'pry' | |
require 'pp' | |
require 'bitcoin' | |
include Bitcoin::Builder | |
include Bitcoin::Util | |
Bitcoin::network = :regtest | |
# Prepare elements | |
# Previous transaction |
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
require 'pry' | |
require 'pp' | |
require 'bitcoin' | |
include Bitcoin::Builder | |
include Bitcoin::Util | |
Bitcoin::network = :regtest | |
# Prepare elements | |
# Previous transaction |
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
#[macro_use] | |
extern crate serde_derive; | |
mod parse; | |
use parse::*; | |
fn main() { | |
// let mut transactions = vec![]; | |
let block_height = vec![118, 119,120]; |
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
#[derive(Debug)] | |
struct Parent { | |
child: Child, | |
} | |
#[derive(Debug)] | |
struct Child { | |
name: String, | |
} | |
fn main() { |
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
require 'bitcoin' | |
require 'pry' | |
require 'pp' | |
include Bitcoin::Util | |
include Bitcoin::Builder | |
Bitcoin::network = :regtest | |
prev_tx = 'b295fd37caf41d9d7b954cc533bee353d0fa6d33bd365087b1f77e3efe4637e6' | |
out_index = 1 |
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
# [WIP] sample of p2sh using bitcoin-ruby | |
# https://github.com/lian/bitcoin-ruby | |
require 'bitcoin' | |
include Bitcoin::Builder | |
include Bitcoin::Util | |
Bitcoin.network = :regtest | |
# Prepare elements |
NewerOlder