Skip to content

Instantly share code, notes, and snippets.

View t4sk's full-sized avatar
🏠
Working from home

t4sk

🏠
Working from home
View GitHub Profile
@t4sk
t4sk / dsha256.md
Last active January 8, 2017 23:54
How to compute double sha256

How compute double sha256

This example is from BIP 143 - Native P2WPKH

Compute double sha256

> export PREV_OUTS=fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a01000000
> echo -n $PREV_OUTS | xxd -r -p | openssl dgst -sha256 -binary | openssl dgst -sha256
96b827c8483d4e9b96712b6713a7b68d6e8003a781feba36c31143470b4efd37
@t4sk
t4sk / pubkey.md
Created January 3, 2017 22:22
How to get Public Key of a Bitcoin Address

How to get Public Key of a Bitcoin Address

Generate bitcoin address

> getnewaddress
mkAhnkryoSs3dLWeBhbhJsw5d1LMs3B3Lt

Get public key

> validateaddress mkAhnkryoSs3dLWeBhbhJsw5d1LMs3B3Lt

@t4sk
t4sk / segwit-regtest.md
Created December 29, 2016 21:51
How to activate segwit on regtest

How to activate segwit on regtest

Start bitcoind

> bitcoind -regtest -daemon

Generate block chain

> bitcoin-cli -regtest generate 432
@t4sk
t4sk / regtest.md
Last active December 31, 2017 19:31
How to get bitcoins for development using Regtest

How to get bitcoins for development using Regtest

Start bitcoind

> bitcoind -regtest -daemon

Generate block chain

> bitcoin-cli -regtest generate 101
@t4sk
t4sk / bitcoin-tx.md
Last active January 2, 2017 21:25
Bitcoin transaction using bitcoin-qt console

How to create transaction using bitcoin-qt console

  • Example of a transaction with single input and output

Start bitcoin-qt (on testnet)

bitcoin-qt -testnet

Open console

@t4sk
t4sk / simple_form_mdl_wrappers.rb
Last active November 8, 2016 02:42 — forked from anonymous/simple_form_mdl_wrappers.rb
Material Design Lite (v 1.2.1) wrappers for Simple Form
# Simple wrappers for Material Design Lite text fields to use with SimpleForm (Rails)
SimpleForm.setup do |config|
config.wrappers :mdl_field, tag: 'div', class: 'mdl-textfield mdl-js-textfield', error_class: 'is-invalid' do |b|
b.use :html5
b.use :input, class: 'mdl-textfield__input'
b.use :label, class: 'mdl-textfield__label'
b.use :error, wrap_with: { tag: :span, class: "mdl-textfield__error" }
end