-
Notifications
You must be signed in to change notification settings - Fork 6
/
todos.txt
576 lines (430 loc) · 26.1 KB
/
todos.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
#####################################
### Issues / errors in processing ###
#####################################
### https://github.com/davit-gh/ecommerce ?
#####################################
I42: 16nov2016, svn:
====================
make a copy of wallet and priv keys from SuSE cold and from Mac Bitcoin client into new virtual machine, to see that copying of wallets works well ...
I43: 20dec2016, svn:
====================
tcls_create.sh:
### TX_IN: call STEP 3-7 ###
...
# if only prev_TX is given, we could fetch remaining items with 'get_trx_values' ?
--> assume we have -f and -t, then we can read values from network?
I45: 26dec2016, svn:
====================
tcls_sign.sh
add some testcases based on priv keys from file "Address_Generation_Test.txt" in the Bitcoin directory. The file contains priv and pub keys ...
I46: 04jan2017, svn:
====================
Can I build a transaction review of prev trx? The tree looks like this (left to right):
prev trx TRX2 TRX1 my wallet
=================================================
Input 1 \
Input 2 ----- UTXO --\
Input 3 / \
---- UTX0 ----> 1JBM...68m
/
Input 4 ----- UTXO --/
I47: 20mar2017, svn:
====================
beautify output of tcls_tx2txt.sh: similiar to the way, the tree output is done in the "dot profile" alias:
alias tree="find ./ -print | sed -e 's;[^/]*/; /;g;s;/ ; ;g;s;^ /$;.;;s; /;|-- ;g'"
I49: 27mar2017, svn:
====================
maybe an idea for the future:
A high level algorithm for processing payments on a website via RPC/cli
Say, I'll have a python script. Do I understand correctly, that I'll have to call these:
1) getnewaddress
2) getreceivedbyaddress
That is, I won't need the "gettransaction" and "listreceivedbyaddress" calls.
---> no, for a webpage with an address it is better to use HD wallets:
Hierarchical Deterministic Wallets (BIP0032/BIP0044)
q: how many public/private keypairs can a 24 word hierarchical deterministic wallet produce?
a: 2^31, the number of words in the mnemonic has nothing to do with the capacity, it just adjusts the entropy for the key derivation
I56: 23jun2017, svn, tcls_sign.sh:
=================================
when a tx has more than 100 utxo, the signing process creates an error roughly every 2nd attempt.
Looks like this happens for signatures, where a new S-Value must be calculated. The new S-value should be less then N/2. The system creates a new S value, but it's length is then 63 bytes, instead of 64 bytes.
Approach: create a raw tx, and sign it 10 times, and see the values for R and S?
I58: 20jul2017, svn:
====================
P2SH scripts - length limitations:
https://bitcoin.stackexchange.com/questions/38937/what-was-the-original-rationale-for-limiting-the-maximum-push-size
I61: tcls_testcases for OP_RETURN
=================================
https://blockchain.info/tx/52dd20f60d6e14e5a783e7668cf410efdea40cd9a92479b0f2423d0bc63575fa?format=hex
010000000497d674af7ee7ff260c97ea49b7e56af223b23b40c129d48dbc06f7699b8c0c10000000006a47304402200914ca252b405e15b6a8f851e7aa5f06c05c1fc45ec2ab689a5c51533ed9d24102203de2eaf764d9ab3e0be57fdfcd22b558ff4f97aa8360fc9fad66c6abb91e31fc01210346da7048693f5298ea25302b23fd055f398f7b75c8acf0ab14969626abfc5f65fdffffffe22c4ef49bc6ee2ba1796d830bf879aa097c1809d50bb85af9113ee0b77a1aae010000006b483045022100c2e495935d52d466e80f0e6e93a38e4894a4f5a460a6488067d335bd236bd454022035f6d6f563fa820861d5cbc121ad2c2a744579465bc40f23b9afb4ca0af63d820121032dfe039d446aad7bee4618b0901ca95ae2175341109c544c46e445cfbb4ccbebfdffffff13144a1b23e73d4ed199b088e32669ca6095ee5e69c8df79d467b57d63c480f4000000006a4730440220652a21b3b7a23c9e531cc402d931c0638acfcbcb9d37b4a337c1eeb17c497f6d022075e5c5d5889ac20904723dc577fe9e3bcff2318bf73756b50c202c36ae197edc0121020e79e918da434349d8d23833ee86602ac67876707c99d8e0d0b02d45ac743542fdfffffff4fec9407cac82d9af986086c58f8dba08ad31f830f4fa54b87f4df877748db6000000006a47304402206270cd4cbd03ab14b5e652ed166afefb2036060e6473072720e27a4e7ca1119e022001c1cd35e6abae76ddaee19a1a94c7536723c6756f0e7903270a60c5e5dda55c0121024dc7a33dd3e4bc7677cabc456fbdc12775cd935d8823ccea1df4cf9aa2420668fdffffff0300000000000000000a6a084655434b20544544c0c6aa00000000001976a9145e23945aba9037f323717057cb91e7d8c37793b688acebec0c00000000001976a91456e526ec441f466a7a3ef46dab98e9dcc05b89b088ac00000000
https://blockchain.info/tx/728e24b2e7dd137e574c433a8db08ac2aa0bf0588ad7716e4c5a7da45dbb5933?format=hex
010000000152297af618c1450d0f521d6b11e71a7879d0b387b9d6344bc92822ac6c58562b010000006a473044022049e517546b4c839f9d4d9db74d3e86400273bc95b484c50f5e896e4470752c50022034e58bceab2dbf45dd2b4dcca7c1bdd6e603beac59fe6e60bff12d35f4f0f7aa01210252bc988a7ae4d13339946ecad63bc492badb869e7e0307b864eed7941b8b5119fdffffff0200000000000000004c6a4a40434f5059524f424f4037333839643664313135313465633035636335663135656236353932383630383430343733346230343932636132656364396564343837326230343265666137d10d0a00000000001976a914aa6b881fa1c7f6dbc95d714bfd5100bf56bb940388ac00000000
https://blockchain.info/tx/d276abe15791941649c3ca8425d79167cc1cf801f83aa99753fe7f42740c0f23?format=hex
0100000001d0e67013c4c8512cb7e4cfbb64bcea38d854cab6db36b6af0113109ce489ee7201000000fdfd000048304502210096df80136e578ce721589d61cb2efcf5e4748c6a3a6ab7e34d0fc12e3e748e2c02201049e22331794a5d99856105b096e3adb60b053562ad40ef6fe28b8bb70ca8f40147304402203f49e5198e7b14aeb59c26dc42a4207ede9d0d4a291e2ae6f2eb1809fbdba21a022030e74e63e752296499e18f772e00d26c206972029f3b8c0b7d50298a1734241f014c69522103459d20315debcb8b4c47c5f0ff356c7764ea3b103487487a1ed2bbcac3f18bc221023b0fd344dbd13d25663adc5a31d269ceac90b6dfc3ac8af8d5b31aa10ba366fc21032233fc2b5916568cd5177e9b88feda049195418cbadb2c6741e8df8967ec84ab53aeffffffff030000000000000000106a0e69643a64616e6f6d6172722e69647c150000000000001976a9146ada8b2f3ce136abedd949e749ccf5574d867d5b88ac557d0c000000000017a9148e1719fb937c598ddd0760118b5455fc4f31891b8700000000
I63: tcls_create.sh - only partially done
===================
when in Africa, the curl call cannot go through. See:
https://bitcoin.stackexchange.com/questions/60296/getting-current-bitcoin-fees-from-command-line
include a switch that goes around usage of bitcoinfees.21.co and set a default value?
or look at johoenicke: https://dedi.jochen-hoenicke.de/queue/more/#24h
or use this as approximation for size, and multiply with a satoshi/byte:
compressed pubkey, tx size = a*148 + b*34 + 10 +/- 1
uncompressed pubkey, tx size = a*180 + b*34 + 10 +/- 1
also SegWit:
============
... how to figure out how much transaction size is allocated to witness data?
vbytes are calculated by first dividing just the size of the witness data by 4 and then adding that to the size of the non-witness data.
see also I66 and I73.
I64: tcls_create.sh
===================
possible extension/thoughts for cold storage:
Create multi-sig wallet offline
Goal: Never expose private keys to the internet, and have a dead man's switch
Goal: If any two people lose access to their devices or die simultaneously, access to the coins is not lost
Goal: If one person loses their key, is a victim of theft or goes rouge, the coins are not lost.
Setup a server that holds the private key I wrote down on paper.
Discard the paper I wrote the private key to.
Instruct the server to listen from pings with a certain signature and count the time since the last ping.
Run an application every time I start my computer that pings the server.
Instruct the server to sms me a warning if it has not been pinged for 1 month.
Instruct the server to sms me the private key if it has not been pinged for 2 month.
Instruct the server to sms the truster persons the private key if it has not been pinged for 3 month.
I65: 10min tx:
==============
based on an article here:
https://www.reddit.com/r/Bitcoin/comments/3yulwv/any_examples_of_the_10_minute_script_thats_a/
this tx can knock down nodes...
what about mine? It is in the file "tcls_10min_tx.txt"
I66: bitcoin fees:
==================
As for formulas, if you use standard addresses (not P2SH), the formula is:
fee = (n_inputs * 148 + n_outputs * 34 + 10) * price_per_byte
SegWit slightly changes this, where instead of paying per byte, you pay per unit of weight: 1 byte of non witness data = 4 weight, 1 byte of witness data = 1 weight.
see also I63 and I73.
I67b: signature for P2SH:
========================
is this realized correctly in tcls_sign.sh?
https://bitcoin.stackexchange.com/questions/60468/signature-scheme-for-p2sh
I68: signature for signing...
==============================
is this realized correctly in tcls_sign.sh?
https://bitcoin.stackexchange.com/questions/57848/how-to-tell-which-part-of-the-previous-tx-i-need-to-make-the-hash-to-sign-for-an/57866#57866
I70: Multisig & Segwit:
=======================
integrate contents of file "160905_Multisig_Segwit.txt" into tx_cl_suite
I71: Smart Contract:
====================
ermöglicht Bitcoin, eine Schwelle der täglichen Auszahlung festzulegen, und erst wenn diese überschritten wird, muss eine Transaktion von einer zweiten Partei signiert werden?
--> ALL|ANYONECANPAY
This construction can be used to make a “crowdfunding”-style transaction. Someone attempting to raise funds can construct a transaction with a single out‐ put. The single output pays the “goal” amount to the fundraiser. Such a transac‐ tion is obviously not valid, as it has no inputs. However, others can now amend it by adding an input of their own, as a donation. They sign their own input with ALL|ANYONECANPAY. Unless enough inputs are gathered to reach the value of the output, the transaction is invalid. Each donation is a “pledge,” which cannot be collected by the fundraiser until the entire goal amount is raised.
I73a: tcls_sign.sh
==================
this script sig should have 48 at the beginning?
4930450220494D2C9E461CEE7F8F31B294C479535C991CED8B8AA47C05D7A26A9A7B9E818E022100A5625FF149EAC1505160ACC5CEFAF3DD978C8A8370F1DEEBEFD3772AE1E00D7801
--> sig length is 142chars, 71 Bytes (without SIGHASH_ALL), hex 0x47
--> add SIGHASH_ALL, length is 72 Bytes, hex 0x48
Playing with OpenSSL, when changing this line:
echo "ScriptSig: "
echo 30480220494D2C9E461...
to
echo 30270220494D2C9E461...
the openssl utility would accept the signature anyways... at least on the Mac.
What are the implications?
I73b: tcls_create.sh
====================
when creating a multisig tx with redeem scripts, need to calculate tx fees better.
when redeemscript is given, decompose redeemscript (tcls_in_sig_script.sh), and
add 0x47, 0x48 or 0x49 (71,72 or 73 decimal) bytes. Take the average for each sig.
A multisig is normally n-of-m, so for each 'n' in each input (TX_IN) add 72 Bytes.
compressed pubkey, tx size = a*148 + b*34 + 10 +/- 1
uncompressed pubkey, tx size = a*180 + b*34 + 10 +/- 1
also SegWit:
============
... how to figure out how much transaction size is allocated to witness data?
vbytes are calculated by first dividing just the size of the witness data by 4 and then adding that to the size of the non-witness data.
see also I66.
I74: SegWit / Part II :-)
=========================
how to integrate SEGWIT details:
https://bitcoincore.org/en/segwit_wallet_dev/
I76: 28nov2017, svn, CLTV or CSV
=================================
A can sign anytime
B,C,D can sign in a 2of3 multisig
E,F can sign in a two of two multisig
OP_IF
pubA OP_CHECKSIG
OP_ELSE
OP_2 pubB pubC pubD OP_6 OP_CHECKMULTISIGVERIFY
OP_2 pubE pubF OP_2 OP_CHECKMULTISIG
OP_ENDIF
and now bring in CSV or CLTV ! How?
I77: 02dec2017, svn, sigscript
===============================
tcls_in_sig_script.sh: needs to work with testnet addresses!
when running with testnet addresses, worng addresses are displayed.
See testcase "tcls_testcases_create.sh -l 11" and webpage https://people.xiph.org/~greg/escrowexample.txt
testcase 11a is ok (create a tx), testcase 11b is technically ok, but tcls_tx2txt.sh calls
tcls_in_sig_script.sh, and this interprets addresses incorrectly.
I78: 03dec2017, svn:
====================
awk scripts to check for length and characters:
can the awk script be replaced? (tcls_verify_hexkey.awk, tcls_verify_bc_address.awk)
tcls_create.sh: see line ~190 in procedure chk_tx_ID:
--> if [ -z "${utxo_TX_ID##*[![:xdigit:]]*}" ] ; then ...
I79: 03dec2017, svn:
====================
tcls_create.sh: can a tx with many outputs be created?
there are no testcases to produce a tx with many outputs?
and then create a testcase in the TESTCASE 4 section, which rejects tx, if the sum of input values < sum of output values
I80: 03dec2017, svn:
====================
https://bitcoin.stackexchange.com/questions/66197/step-by-step-example-to-redeem-a-p2sh-output-required
can this be verified in create/sign?
I81: 31dec2017, svn:
====================
Segwit, see answer by MeshCollider in this stackexchange question:
https://bitcoin.stackexchange.com/questions/65404/calculate-segwit-address-from-public-address/65470?noredirect=1#comment77749_65470
I82, 11Jan2018, svn:
====================
smart contract: can this be done?
https://bitcointalk.org/index.php?topic=2723908.0
I83, 15Feb2018, svn - tcls_tx2txt.sh
====================================
decoding of scripts in thsi tx with many segwit bc1 addresses does not work - howto?
https://blockchain.info/de/tx/6e58d8c695e3e42c5a7807e2ed99ad7f7731658dfb0d62cdfef44dad8964b350
https://bitcointalk.org/index.php?topic=2664728.0
I84, 25Feb2018, svn - tcls_verify_sig.sh
=========================================
How can this program verify a tx of the blockchain?
--> it would need to de-assemble a tx, get its double hash, along with sig, pubkey.
For the signatures: without length parameter and without "Sighash_All"?
I85: 07mar2018, svn, tcls_in_sig_script.sh, line 346:
=====================================================
#####################################
### STATUS 0a (s0a_SIG_LEN) ###
### THIS CODE SEEMS TO BE REDUNDANT ###
### It is called from mainloop with ###
### opcode "3C" ? This is not sig ? ###
#####################################
s0a_SIG_LEN()
--> is it old code? not used anymore? Why would "3C" be signature?
I86: 08mar2018, svn, tcls_strict_sig_verify.sh:
===============================================
verify code to sig checking.
look here: http://bitcoin-development.narkive.com/OOU2XVSG/bitcoin-development-who-is-creating-non-der-signatures
* R and S are signed integers, encoded as a big-endian byte sequence.
They are stored in as few bytes as possible (i.e., no 0x00 padding in
front), except that a single 0x00 byte is needed and even required
when the byte following it has its highest bit set, to prevent it
from being interpreted as a negative number.
--> so, only if highest bit is 1, then zero pad?
I87: 14mar2018, svn, tcls_in_sig_script.sh
==========================================
https://bitcoin.stackexchange.com/questions/72471/getrawtransaction-asm-returns-with-all-should-it-be/72484#72484
correction of displayed signatures, as per Pieter's comment:
It's strange to prefix all those things with "OP_". They're not opcodes; just part of the DER serialization. And the sighash ALL flag is appended by Bitcoin to the ECDSA signature; it's not part of it, and certainly not DER encoded. – Pieter Wuille yesterday
yup, sure. Got that, no Op_Codes, maybe operators, or TT for type tags. In the ASN1 specs they talk a lot about byte values, maybe BV instead. – pebwindkraft yesterday
I88: 15Apr2018, svn, tcls_s2u.sh:
=================================
if the tx has many inputs, how will the scriptSigs/pubkeys be displayed?
Currently, when more than one input is involved, the program sets values to hex 0x00.
need a second loop to present the double hash with signature[n] and pubkey[n] ...
I89: 15May2018, svn, tcls_key2pem:
==================================
is this useful for implementation?
https://bitcoin.stackexchange.com/questions/59644/how-do-these-openssl-commands-create-a-bitcoin-private-key-from-a-ecdsa-keypair/59646#59646
look at all comments sections...
I90: 05Jun2018, svn, SegWit:
============================
https://blockchain.info/rawtx/497e90946be5ac4076497476c221d5165549e45040700d06f0b10091e2f144d5
this tx is not correctly displayed at the end with the witness data - the index counters always start at 0. Also the input script parts are not decoded ("220020...")
./tcls_tx2txt.sh -vv -t 497e90946be5ac4076497476c221d5165549e45040700d06f0b10091e2f144d5
I91: 05Jun2018, svn, SegWit:
============================
see, if the answer from Mike D can be integrated in the picture "keys.png":
https://bitcoin.stackexchange.com/questions/75910/how-to-generate-a-native-segwit-address-and-p2sh-segwit-address-from-a-standard
I92: 10Jul2018, svn, signature verification:
============================================
Verify a P2SH tx signature with OpenSSL at the command line?
In the case of a P2SH tx, I don't have a public key. I have a redeemscript.
Do I need to extract the pubkey, and use it?
In case of MultiSig: which pubkey?
I93: 10Jul2018, svn, tcls_p2sh_sc.sh:
=====================================
https://bitcointalk.org/index.php?topic=4641339.0
--> creterawtransaction und das "data" keyword!
I94: 01Nov2018, svn, tcls_out_pk_script.sh:
===========================================
This script on testnet provides wrong data, decoding shows:
TX_OUT[0] pk_script (uchar[])
01022103341B4D862E7E1C3D7FE7D0ADE7E97DFAC122760B1EF4FFB21B7A9A27DD525B6C2102EE1C79ACEE56F0E2CAFCC1069A6E1E1E9D059FF9A60B60904E97A455D5B27F672102839D639C109F090104EAB7C3EEF07D6BF25952A5A88C65BC5B185F0EA2A3FAF20103AE
21: OP_Data33
03341B4D862E7E1C:3D7FE7D0ADE7E97D
FAC122760B1EF4FF:B21B7A9A27DD525B
6C
21: unknown opcode
21: OP_Data33
02839D639C109F09:0104EAB7C3EEF07D
6BF25952A5A88C65:BC5B185F0EA2A3FA
F2
01: unknown opcode
03341B4D862E7E1C3D7FE7D0ADE7E97DFAC122760B1EF4FFB21B7A9A27DD525B6C02839D639C109F090104EAB7C3EEF07D6BF25952A5A88C65BC5B185F0EA2A3FAF2
where it should be something like this?
01: Push next byte as data onto stack
02
21: OP_Data33
03341B4D862E7E1C:3D7FE7D0ADE7E97D
FAC122760B1EF4FF:B21B7A9A27DD525B
6C
21: OP_Data33
02EE1C79ACEE56F0:E2CAFCC1069A6E1E
1E9D059FF9A60B60:904E97A455D5B27F
67
21: OP_Data33
02839D639C109F09:0104EAB7C3EEF07D
6BF25952A5A88C65:BC5B185F0EA2A3FA
F2
01: Push next byte as data onto stack
03
AE: OP_CHECKMULTISIG
same for this:
./tcls_out_pk_script.sh 0102210378D430274F8C5EC1321338151E9F27F4C676A008BDF8638D07C0B6BE9AB35C712102B568858A407A8721923B89DF9963D30013639AC690CCE5F555529B77B83CBFC721034DA006F958BEBA78EC54443DF4A3F52237253F7AE8CBDB17DCCF3FEAA57F31260103AE
Hint: ./tcls_in_sig_script.sh decodes correctly !
and this one as well:
53B275A914F45D94733D430261962932E0C847075195916A0487
53: OP_3
B2: unknown opcode
A9: OP_HASH160
14: OP_Data14 (= decimal 20)
F45D94733D430261:962932E0C8470751
95916A04
87: OP_EQUAL
This is a P2SH script:
-p2sh F45D94733D430261962932E0C847075195916A04
Hint: ./tcls_in_sig_script.sh decodes correctly !
#####################################
### Extensions / new Requirements ###
#####################################
E2: MultiSig
===============
For important values: make use of a 2of3 multisig with one in cold storage
generate 3 addresses (and 3 private keys) A, B & C... and
create 1 multisig address (D) using those 3 in a 2-of-3 configuration
the multisig address starts with a "3", all the others (A,B & C) should be "1".
send funds into the multisig address D (starts with a "3")...
make sure all the private keys for your A, B & C addresses are all backed up/stored independently of each other.
to take funds out of D, create a transaction using one of A,B or C.. and then co-sign the transaction using one of the other addresses.
file:///Data/BitCoin/Bitcoin_multisig_the_hard_way_P2SH.html
E3: Sending
===============
can a signed trx be sent to the net without tools?
--> https://bitcointalk.org/index.php?topic=1043518.0
curl -X POST -d tx=010000000158891e8f28100642464417f53845c3953a43e31b35d061bdbf6ca3a64fffabb8000000008c493046022100a9d501a6f59c45a24e65e5030903cfd80ba33910f24d6a505961d64fa5042b4f02210089fa7cc00ab2b5fc15499fa259a057e6d0911d4e849f1720cc6bc58e941fe7e20141041a2756dd506e45a1142c7f7f03ae9d3d9954f8543f4c3ca56f025df66f1afcba6086cec8d4135cbb5f5f1d731f25ba0884fc06945c9bbf69b9b543ca91866e79ffffffff01204e0000000000001976a914d04b020dab70a7dd7055db3bbc70d27c1b25a99c88ac00000000 https://blockchain.info/pushtx
also:
https://github.com/laanwj/bitcoin-submittx
E4: creating priv/pub keypairs
===============================
create a priv/pubkey pair using arcrandom on OpenBSD?
similiar to "bitcoin_tools.sh" ?
E5: Steganography
=================
http://incoherency.co.uk/blog/stories/steganographic-bitcoin-seeds.html
E6: BIP39
=========
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
#!/bin/sh
echo " "
echo "create a 128 bits (64 bytes) sample string: "
echo "random" | openssl dgst -sha256
echo "check the length, must be 64"
printf "87c1b129fbadd7b6e9abc0a9ef7695436d767aece042bec198a97e949fcbe14c" | wc -c
echo "convert into a hex file to prepare sha256"
printf $( echo "87c1b129fbadd7b6e9abc0a9ef7695436d767aece042bec198a97e949fcbe14c" | sed 's/[[:xdigit:]]\{2\}/\\x&/g') > tmp_file.hex
echo "verify hex file content"
hexdump -C tmp_file.hex
echo "do a sha256 on it, and take first Byte"
openssl dgst -sha256 <tmp_file.hex
echo "get first byte"
openssl dgst -sha256 <tmp_file.hex | cut -c 10,11
echo "concatenate to hex string, and check length=264 bits (33 bytes, 66 chars)"
printf "87C1B129FBADD7B6E9ABC0A9EF7695436D767AECE042BEC198A97E949FCBE14C0D" | wc -c
# convert hex to binary string
echo "obase=2;ibase=16;87C1B129FBADD7B6E9ABC0A9EF7695436D767AECE042BEC198A97E949FCBE14C0D" | bc
# this results in this string:
# 10000111110000011011000100101001111110111010110111010111101101101110
# 10011010101111000000101010011110111101110110100101010100001101101101
# 01110110011110101110110011100000010000101011111011000001100110001010
# 100101111110100101001001111111001011111000010100110000001101
# loop every 11th char throug the string, and lookup the word
offset=10
from=1
to=$offset
echo "bits dec + 1=line --> word"
echo " (+ 1 cause file starts with line number 1)"
echo "==== ============================================="
while [ $to -le 256 ]
do
to=$(( $from + $offset ))
word11bits=$( printf "100001111100000110110001001010011111101110101101110101111011011011101001101010111100000010101001111011110111011010010101010000110110110101110110011110101110110011100000010000101011111011000001100110001010100101111110100101001001111111001011111000010100110000001101" | cut -b $from-$to )
word_num=$( echo "ibase=2;$word11bits" | bc )
word_line=$(( word_num + 1 ))
word=$( sed -n ${word_line}p bip39_words.txt )
printf "%11s %4s + 1=%4s %11s \n" $word11bits $word_num $word_line $word
from=$(( $to + 1 ))
done
echo " "
echo "############################ and now backwards ############################"
echo " "
printf "bits dec <-- word \n"
# loop every 11th char throug the string, and lookup the word
# for word in march assault engine warrior talent swarm pluck job prepare knife pipe man student dice receive analyst salute art clean wood enemy tourist lunch like
for word in fold useful mirror diagram search fade gloom verify tonight april oyster lens pluck milk domain venue crawl charge face orchard render either route fat
do
line=$( grep -n ^$word$ bip39_words.txt | cut -d: -f1 )
# line=$(( $line - 1 ))
word_bits=$( echo "obase=2;$line" | bc )
printf "%11s %5s %11s \n" $word_bits $line $word
done
echo " "
echo "filling up the spaces with '0' reveals this:"
echo "1000011111000001101100010010100111111011101011011101011110110110111010011010101111000000"
echo "1010100111101111011101101001010101000011011011010111011001111010111011001110000001000010"
echo "1011111011000001100110001010100101111110100101001001111111001011111000010100110000001101"
echo " "
echo "converting line by line to hex:"
bitstr1=$( echo "obase=16;ibase=2;0101101010111110000000100011011010011110100011000010001010100011110110001110011110010110" | bc )
bitstr2=$( echo "obase=16;ibase=2;1110010010100001011000100111101001000000001010100110110100011001010100000100011110010100" | bc )
bitstr3=$( echo "obase=16;ibase=2;0011001011000100110101010100011011001110000110110110001010001110011011110010101010011100" | bc )
echo $bitstr1
echo $bitstr2
echo $bitstr3
echo " "
echo "concatenated to a single hex value:"
printf "%s%s%s\n" $bitstr1 $bitstr2 $bitstr3
echo " "
echo "original 32bytes/64chars string was:"
echo "87c1b129fbadd7b6e9abc0a9ef7695436d767aece042bec198a97e949fcbe14c"
echo " "
echo " "
E7: SEGWIT
==========
a:) be able to read and decode segwit tx
b:) make the "wallet" segwit compliant:
https://bitcoincore.org/en/segwit_wallet_dev/
E8: Lightning:
==============
Check out some of the testnet lightning wallets and applications:
1) HTLC.me web wallet ( https://htlc.me/ )
2) Eclair testnet android wallet ( Google Play Store )
3) Lightning Desktop App ( https://github.com/lightninglabs/lightning-app/releases )
4) yalls.org for spending testnet microtransactions ( https://yalls.org/ )
E9: base58 validations:
=======================
https://github.com/bitcoin/bitcoin/blob/master/src/test/data/base58_keys_valid.json
E10: Cold Storage:
==================
Large-cap cold storage would have to have some of the following.
- Address limit. Each address must have no more than X amount of bitcoins. This is basic risk management and limits the losses from a single stolen/lost address.
- Timelock. This makes it impossible for someone to steal your bitcoins even when you are tortured and tell them every detail, at least until the timelock expires.
- Multisig. Generate two separate keys, A and B. Each key has an associated seed. Store your bitcoins in a 2-of-2 multisig address and store the seed phrases in physically separate, secure locations. Note that you lose control of your coins if you lose *either* key, so you need to make sure that your backup situation is set up appropriately