Falta:
- Tornar a saida legivel (por enquanto é um debug/dump das estruturas internas)
- Adaptar para usar a api da blockchain.info (ou outra API publica de bitcoin).
- colocar os parametros na linha de comando (bloco incial, final e endereços, que hoje estão em um arquivo).
Pô! Maravilha Girino!
Codificação pronta. Falta documentar e talvez facilitar o uso.
A saida do programa fica assim:
Selecting the lottery winner for the following parameters:
Initial Block: 415833
Final Block: 441509
Loterry Addr: 1BXeqhTsQVnk3VsFRcX5feozKJzPYjoktm
Ticket Price: 0.001
For more information on how the winner is selected,
see the docs at https://github.com/girino/BTCTalkPTSorteioAnoNovo
Tickets bought:
0:
Ticket: 0869e7d8a36dda620e32a65a72697674863c8f7022d781984a60518a007496bf
Txid: d557959d7a56473d82789de3f9663991f5c21eb436e12eed264789ed4561b3ac
Address: 3FDptGUierg3mxhzTgb4WdmidLjnU7ZxmB
1:
Ticket: 0869e7d8a36dda620e32a65a72697674863c8f7022d781984a60518a007496bf
Txid: d557959d7a56473d82789de3f9663991f5c21eb436e12eed264789ed4561b3ac
Address: 3FDptGUierg3mxhzTgb4WdmidLjnU7ZxmB
2:
Ticket: 155538c4603fea0633814bdb926999456eefad4a36ce6dd82db024775dec58e6
Txid: e2007bbe6681b60f0e5ed64b0228fb3ce0fa72cf03d60eb5ffeb46213ee941ad
Address: 3DoRP1FZQKmHardrxqpubSvvsHAPVPxJVy
3:
Ticket: 155538c4603fea0633814bdb926999456eefad4a36ce6dd82db024775dec58e6
Txid: e2007bbe6681b60f0e5ed64b0228fb3ce0fa72cf03d60eb5ffeb46213ee941ad
Address: 3DoRP1FZQKmHardrxqpubSvvsHAPVPxJVy
4:
Ticket: 155538c4603fea0633814bdb926999456eefad4a36ce6dd82db024775dec58e6
Txid: e2007bbe6681b60f0e5ed64b0228fb3ce0fa72cf03d60eb5ffeb46213ee941ad
Address: 3DoRP1FZQKmHardrxqpubSvvsHAPVPxJVy
5:
Ticket: 155538c4603fea0633814bdb926999456eefad4a36ce6dd82db024775dec58e6
Txid: e2007bbe6681b60f0e5ed64b0228fb3ce0fa72cf03d60eb5ffeb46213ee941ad
Address: 3DoRP1FZQKmHardrxqpubSvvsHAPVPxJVy
6:
Ticket: 21f42f897b36c36740d0986fee3089844ae29512b4d86576a97f18caff83b1f9
Txid: a71a0400ce699a7fc61aa17e301094d1f3703cae41723950857d3abc6d11d8c3
Address: 3GBfGKi97aDyuuoGTtjaGBYdEcTFqNaZTu
7:
Ticket: 21f42f897b36c36740d0986fee3089844ae29512b4d86576a97f18caff83b1f9
Txid: a71a0400ce699a7fc61aa17e301094d1f3703cae41723950857d3abc6d11d8c3
Address: 3GBfGKi97aDyuuoGTtjaGBYdEcTFqNaZTu
8:
Ticket: 2a10a45e164c4fd8eecee7a27ee9ae7236dd1c0e7df5923da4cb769f0927c99a
Txid: c14c34a11cbb859247c71d44361c490063fbe6056e07b8a22d7b740d15f65c76
Address: 3P2tP9ZY4f7vSBmd3yDFwFVBcKZgZmcv2J
9:
Ticket: 47b4de440c3eec5d8329c8c45cf5ce568f718b83c9b8a3bd2f19d70870cc5266
Txid: 03f43770d7c625edbca9d31297e5da6b553a530964fa4f4939c164ac33dc3421
Address: 3JpNhd3wp1nrVwsvNuSg7wghaEPfmLEMJ9
10:
Ticket: 4db61e24acaee55409041b5d90392463ea3d08f05f676778f433e8817bd833f1
Txid: 98b39a8a4509a9bf299eb46c822753552672a484b9e8e50c369ea5482e51a1fd
Address: 3H6r4e2fsJBiSCUdPQciTAJL6TFASewxQg
11:
Ticket: 53c23d5591327303dcb495c222dce8246abdb579140725072433d11e1413510c
Txid: f81b6c82d3732cf1eeb997b5da0e51110e5945eeb6e833b73111122682559614
Address: 35sqvWXTyfZ7C7whfrpBKZP8ckwxSroEPw
12:
Ticket: 5ba8bc7f6252e9ecf1c11d587dbaec6c653404ecd1a0ff9a7f87d2808dcb4f8d
Txid: a378e405e2c3302be29cceb969de62afe3ea3223df14e54c7dc652c418dd5d61
Address: 3As4TTb4XEjVJhaQVuPuS5iY7yfMgiwrq6
13:
Ticket: 68c0fde2c8999924c560f81aac42f80d720f1c36ca42606ce76c939b385ea48d
Txid: 60e89adb1b5166d0912ea01a455fc8fa21806bc3b6eda092171e3f50512d505c
Address: 3MEBVqL4VWttWX8nB8rEaXL6JaWEc9A5ku
14:
Ticket: 88da2f54045c3081fa5a765b75baaa11bbc69c2a58157e9b2be7d27dfc93226d
Txid: 0ace148155066a3a97b8d2347fa73eefdf81f2dc7d048ced4e4d26eeb411f1ac
Address: 3H6r4e2fsJBiSCUdPQciTAJL6TFASewxQg
15:
Ticket: cfadaaddbfe108865824fb8f43e7cc7720669f399ec18e1cc12de5f9abae705d
Txid: 101257dd0f4b8b83389510297baf7e8ab6e4ea2aa84b4b000675b1fd63224b0f
Address: 3H6r4e2fsJBiSCUdPQciTAJL6TFASewxQg
16:
Ticket: ed41e3e67d549c4cba0bd6d3f2a377f01815ba5070da839a07737f432b2f6303
Txid: f29d0e8f821a394bbceea29b838543529277a7893d9cd72393309fe21d627368
Address: 3FCPWBKaYFJ83Vj7fLvLEbBwULw4LWPwN2
17:
Ticket: f860b2b9133b86d0f4b58be42147ce24461dd239b7e32aba8881202a0585ea16
Txid: 9fde42bf34cbab8f85c425dfea3358beb3ee52f7de2c7b47a14a2f2f4e117ab8
Address: 38jVUh4Tue8QX2K3HzMzY7rqna9FSdJzYj
18:
Ticket: f860b2b9133b86d0f4b58be42147ce24461dd239b7e32aba8881202a0585ea16
Txid: 9fde42bf34cbab8f85c425dfea3358beb3ee52f7de2c7b47a14a2f2f4e117ab8
Address: 38jVUh4Tue8QX2K3HzMzY7rqna9FSdJzYj
19:
Ticket: fefc53e98003846e1bb11f02e25d0b318c9eca4c0fcd74a7beef537bda9948d0
Txid: 506af5b26bfec55c1e87903798d37e3709a0dba4feec03093718e70ea442a149
Address: 3FhoFCBPktQiXeKwoEw1DwaaCWYr4ZF2ZQ
Pseudorandom Hash:
eaa953ca3903f2c75620c82d7a2908155892850791b98437a1688dcda6015d81
Winner Ticket Number:
13
Winner:
Ticket: 68c0fde2c8999924c560f81aac42f80d720f1c36ca42606ce76c939b385ea48d
Txid: 60e89adb1b5166d0912ea01a455fc8fa21806bc3b6eda092171e3f50512d505c
Address: 3MEBVqL4VWttWX8nB8rEaXL6JaWEc9A5ku