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
9895 bytes, Sun Dec 25 21:28:59 2016 | |
+0.019570445 lightningd(8449):INFO: ID: 03068db6b33501464cf41daa155d19f3d73c4690b0a8a35a775b5079c92c70f67b | |
+0.020614164 0258f561c5268be0f9803a1d0d9aa446fe832b651e807790f7aeeddff2b4ce5d46:DEBUG: New peer 0x557274d38670 | |
+0.020621553 0258f561c5268be0f9803a1d0d9aa446fe832b651e807790f7aeeddff2b4ce5d46:DEBUG: db_load_peers:STATE_OPEN_WAIT_ANCHORDEPTH_AND_THEIRCOMPLETE | |
+0.021026871 0258f561c5268be0f9803a1d0d9aa446fe832b651e807790f7aeeddff2b4ce5d46:DEBUG: watching for anchor c25e73cab7f904f16b0a49480004150e4c7d4c3f24882772ac5276d128a4d1ff to hit depth -1 | |
+0.021150433 0258f561c5268be0f9803a1d0d9aa446fe832b651e807790f7aeeddff2b4ce5d46:DEBUG: load_peer_visible_state:next_revocation_hash=f3142291e5b2128f6bd65167c734bdef9eb3d6a09417ce0595a04a7c56e8f5cb | |
+0.021549852 0258f561c5268be0f9803a1d0d9aa446fe832b651e807790f7aeeddff2b4ce5d46:DEBUG: Creating commitment tx: rhash = 97e878819275d002bb18e1234dce79e2032b053e3db760f564eaacff539c8224 My finalkey = 034203fd5ea740cfc6e27579ab5b847f043be66 |
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
self signed signature in a bitcoin transaction | |
variables: | |
P - pubkey for op_checksig | |
d - discrete log for P | |
k - nonce used in signing | |
R - public point, discrete log is k | |
r, s - signature |
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
bip32 test vector 2: | |
seed : fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542 | |
m : xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U | |
m/0 : xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt | |
m/0/42 : xprv9wSp6B7UBdybENFjzPMtDqKoddXxLZSijm538rhsNgSsnpD7VjcCc9XdzsBcWfS75TmeG27WLVsCEfaL7LzaEoNcKU8xUyzMqAS1DHHvTw6 | |
m/0/42/2 : xprv9yidjfEMLNAmykgi1p3MVsP3huXJ17K55ywbpFSJYGUYJ5tTrz4aRJXMnUu4NJZVMTymi434adgFxfTwyr7YCQ3jQAaJiHNMd4uSR7bEXXE | |
--- |
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
rm -f /tmp/p*key.pem* /tmp/msg*; \ | |
echo "generating and encrypting private key..."; \ | |
openssl ecparam -name secp256k1 -genkey | \ | |
openssl ec -conv_form compressed -out /tmp/privkey.pem -param_enc named_curve; \ | |
openssl ec -in /tmp/privkey.pem -pubout -out /tmp/pubkey.pem; \ | |
echo "deriving public key..."; \ | |
openssl ec -pubin -in /tmp/pubkey.pem -noout -text; \ | |
echo "creating and hashing message..."; \ | |
echo -en "\x18Bitcoin Signed Message:\x0a\x06hello!" | tee /tmp/msg | \ |
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
#!/bin/bash | |
export LANG=C.UTF-8 | |
export LC_LANG=C.UTF-8 | |
bhash="${1:-$(bitcoin-cli getbestblockhash)}" | |
hex_cb=( $( bitcoin-cli getrawtransaction $( bitcoin-cli getblock "${bhash}" | grep -m1 " \"[0-9a-f]\{64\}\"" | tr -d '", ') 1 2>/dev/null | grep coinbase | grep -o "[0-9a-f]\{3,\}" | sed -e 's/\([0-f]\{2\}\)/\1 /g' ) ) | |
if [[ ${bhash} == '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f' ]]; then | |
hex_cb=( $( echo '04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73' | sed -e 's/\([0-f]\{2\}\)/\1 /g' ) ) |
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
--- EvalScript START | |
Script : 3045022100ce5dd767430d42a9df1ac88d1bfd04a3fe4cf0ca3241c0bb143e76677528b9f702206f51396eab2c5c808c00d3ce3156774fa9c5b47e7190e6193dc952ab6e89e10c01 | |
Stack : | |
PushOp : 48 | |
Stack : | |
'3045022100ce5dd767430d42a9df1ac88d1bfd04a3fe4cf0ca3241c0bb143e76677528b9f702206f51396eab2c5c808c00d3ce3156774fa9c5b47e7190e6193dc952ab6e89e10c01' |
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
39d38 | |
< from bitcoin import TESTNET | |
654,657c653 | |
< if TESTNET == True: | |
< return "m/44'/1'/%d'"% int(account_id) | |
< else: | |
< return "m/44'/0'/%d'"% int(account_id) | |
--- | |
> return "m/44'/0'/%d'"% int(account_id) |
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
block 000000000000034ba26cee29d86f20d6ead376aa1b868c14fd13bacac54959de | |
txid list: | |
cb147f01d54ef67477b8387f3f8a9a9758400825e5d6cb74a53fc97aa178b15d | |
431dc972cb02d6b9bc7eb4b24df5c8093eff3f5ee503fa841cea852b6a3367d1 | |
78607dc3d3e284d12b6eab724075da79fc2b6c76dcafdabcc71b459045334329 | |
a250a7fb9967970171b22f04a7a3cdb9827d1f4933aad5429e637d4d3eba501c | |
dacf0634c4a5bae5361242a1522c55f8c7c956725912041f05718c9352d5f6c7 | |
7dad1c55612f7fafe4659a07f538109a86f26a80aee17d8b7a2582d1430bec97 |
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
#!/usr/bin/bc | |
# bc has memory issues | |
# this program will cause bc 1.07.1, 1.06.95, to segfault | |
define void toucharr(num, *ret[]){ | |
ret[0] = num; | |
} |
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
<nums pubkey> = 02EFD6CF6CE988CF11384C70CCCC8B3FE5451F2FA415E6F75A5FB3D911ECF16514 | |
<dummy msg> = 666F726B696E67 # `echo -n "forking" | xxd -ps` | |
<msg header> = 426974636F696E205369676E6564204D6573736167653A0A # `echo "Bitcoin Signed Message:" | xxd -ps` | |
<user pubkey> = as the name suggests | |
The script builds on stack a typical "Bitcoin signed message" (as in sign\verifymessage), with the text "forking" and a signature (1,1), signed by the pubkey <nums pubkey>. | |
Depending on which path is used when redeeming the script, the transaction becomes replay protected in one of 3 ways : | |
path 0 : valid on BU only | |
path 1 : valid on ABC only |
OlderNewer