Bitcoin Forum
May 24, 2024, 05:51:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 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 ... 206 »
1641  Bitcoin / Development & Technical Discussion / Re: using Shannon's information to measure block weights on: June 29, 2011, 10:28:06 AM
I don't suppose you ever read Richard Dawkins' article The Information Challenge, in which he honors Shannon and provides a great layman's explanation of information as an economic commodity and the relevance of redundancy.

I don't understand this conclusion:
Quote
Shannon’s unit of information is the bit, short for “binary digit”. One bit is defined as the amount of information needed to halve the receiver’s prior uncertainty...
Why is bit defined to remove only 50% of receiver's prior uncertainty? A bit should remove 100% of receiver's prior uncertainty! It is either '1' or '0'. There is no 1/2 binary digit?!

In Shannon's meaning, one bit is an amount, it is not '1' or '0'.  It is one bit.  It halves the uncertainty because if you add one bit, you divide the probability by 2, by definition.
 
Quote
“It rained in Oxford every day this week”  or “It rained in the Sahara desert every day this week” - both remove 100% of receiver's prior uncertainty. What do I miss?

No, because the amount of information is not the same for both sentences, as rain in Sahara is much more of an unlikely event as rain in Oxford.
1642  Bitcoin / Development & Technical Discussion / Re: A full shell script implementation of bitcoin ? on: June 28, 2011, 11:44:04 AM
You should use the wildly available "netcat" ("nc") to connect to the IRC server !

Thanks for the tip about netcat, I didn't know about it.  So many things to
know and only one life ;(
1643  Bitcoin / Development & Technical Discussion / Re: using Shannon's information to measure block weights on: June 28, 2011, 11:22:21 AM
Well done ol' chap. I hope somebody will take note of this. It sounds like an elegant alternative. I don't suppose you ever read Richard Dawkins' article The Information Challenge, in which he honors Shannon and provides a great layman's explanation of information as an economic commodity and the relevance of redundancy. I particularly like the parallels it draws (in my mind at least), with energy and entropy. He comes tantalizingly close to venturing into this realm, but unfortunately forestalls it. Anyhow, I wish you well with this promising refinement and intuitively, I honestly do think you have a good development refinement to offer. Please, keep us informed.

Thanks for this reference.  I am a huge fan of Richard Dawkins and I will read the link you provided.  Your description of the subject makes it extremely relevant to this thread, as I realised that the cryptographic timestamp server I have implemented could be used as a currency.  I'll describe how later.  Anyway this would turn information, or time, into a currency.

Crazy stuff, really.

PS.  I'll put the code here as well, just in case:

$ xz < timestamp |xxd -p
fd377a585a000004e6d6b4460200210116000000742fe5a3e04f3f1c3b5d
00118842463df4186aa667af7a9fe191a5205b670958d0ded39d4a4e825c
dfc1110b577a6d0b1e64741032ccd8aa98ace6d7eb38181b1318f591e6ea
5a1ab8468666c061e0478c4749a12e2c4db3ccabc3ae041f58fb29a5b4fd
d74e5c2b81fca3676770810246e0bd2b2689cbfaef6451234ead354d983f
7ec9db6e65ceb2800a180c3674878c2400cf228bef78d69b8fa5bde53035
34e5756196704025897f202322783025df6b9e072f402fafa4450a19a000
b9acefc04c8747b155c14c8be1a1064f05dfb2d038ac1dd0260a8510079f
19334c3b2c2706f815d0fb4efb212b805450052bf0b620ed1a8fc0dd573b
e50edce9d8ac91c6de527dedc7c36b9f86e21178557c92b2dab4825802f3
c02faa9005df9bb723e26af9f37d4fa158556407071719254d49d552ded1
7b145ccbac33064dff680ac7d6b796e5d0c6aee86b8af81343c95695f2fc
bf5c62329e9dd46921c8688f8efc02a284355d10e63db8094902b934a2db
aa7cce51053101a18c097db99ab39bcf23369a56d1ba8c667e38998515d6
8aca6965923965acee90c72c36b4124fc386bc5c625f564abd850795b838
a690d2e159d580ed0b28cefef42f473f64f55c6156399cd2d7b3eb1bebc1
0105a16de999c2bfe8a7dbb12d690b634130028099fb6c446f6f40dcef3f
4c39006377d5e90a3037fc3dad2bdce5c8e611e5f73d5b56466fc67dbf87
e7fa6ac77785750b6089759803013734105714eeb6a5928fa50bbe77c9fb
69a426d947472d2d4a48efddb6fbf261dfd78c6f2fcdcc2aea3c125f3296
57b05295b2917be2446618d581337509069f332a35255132935b6ff04624
72f718564ee776edd758c791a63bf576ca4001de15e8eda5966bfe5e8c33
9c7ddb7d3e4cb184bcddd66e4520f15c8c8b6d8eb5505c83822aab2593a9
7578f4426a99fa67fadcbe54a0b571eccd6e5888cad97ba749ee6713f4d5
69f4bac4cbc09b2ef68148019e57be2931c052e8c83a4fa69818a4fc59fa
8346a0f33aaa22d20cb8cd2ec0ea400607a705a8ae9565a07f87d06a6d72
d0f21365b9450108394e6569a6772321d8fb3adb18891aaf2facb6fd573c
befc1533931da5ee11563eadf5df3622237e59d67ad2693933492a195195
ed7748fbe4f7dad6ef67b7e637d27348acd09480ff3470383a9ca2582dc8
afd412f6e260c9588f366a7c09acdf322533a75680c6bc37a90a66aa2947
b671191c84b42024bfb2c1dbf323daa46776150394c771c8086733db4e6a
ddeee2eb07a415641b51261cade9670577b71cf7511aea2d314ae9b94c5b
49100c2d636a24ec0e2ed936d258407da45bf4ed563274f366e39dd8adc0
6ad4c68a6f59d5e45fe81d95b94830beaf11785edc663eef77a3e623c44f
6a3e798bcbf090a08752b5e015e622f799002e9915009321c69cd7d10983
e1e4f086d2700235067fbd62ba0aacaeefc65959460ae434dd56b61127b5
09982edd10ac7ce3cefdced1e8bc0776ea996f1dd0fa6a628ccf41dfc32c
0793a6bee1d1a7493e18265b527acfd4a7c4770f3fbb5d98bd26b0610da4
8a4da085309784ef7fadea1ed736df0e79ed28da5019ffda92c49a43227d
df509af8f2487541b40f20f0329cc98a89a679d1de4a93466f7ed4a7ba03
37258524d2b8f787b143266812b226322c35669db56a280f358b15e980da
78e811bd70b9dc50870ad2c53ea7bd98ccd246d2d663f70262a1c8349fbc
ff36afdcf2121eadc8fa9184aa73de3588461d27d4c94cf510486c577ded
e143b3dcdd41c0ab3923a8b41a878f99cf3c0c1706da126f29db44988888
071034d755b596caf3f4e907aee74cb6de818f48b63be457c2518c821913
5eb47ed5c3732da94a8b74971ddf7927dc962c181a293d2611f516d36c14
9fb41c677df2da3055d0e135464a1c91f1adfde8042cba3db4b50048f42c
c7b6e36d5fd3610ba1bb4941b0fdfc546df6ce3727cb2327723c66872795
1475ec7c5a507b3dd24c04ac410f95b6c9bc0929f36d9ddd63f4240f0a8a
9869e33c03d8c15e07552b2331ebcf45f95d1844eea6ba0905e0bc5cad85
b65624f5e8415a94b5a3afbabc67bdd5d50a5daae50d5df789c148352904
13812db9596bec7e7adba703bcdaaa8f8f46cdef880f9142ff728ba65121
cb5e8f50d39a9dda2604f8a7f2b968e5b9e9854f82b752a9b2fcf4bf2087
5e2d5369fe8f19cb75aaa2b7d726b1a56057c428899a231841ad938908de
da79b6966282ce9d1fbad64f65ef2396eda5bc0f26917632b974719a4f59
9701d4864ead06b611e9520d2603b26fb2da3781e2bd910597ae690fb469
9f836284a95958ea7381102359bc4e3a43cd4a075783345c83389579f8df
2b374a3b79748a35cedbfb07d3bd1fc6463e271f11b89b2cd1d3f322ce54
f8d325962f1a26aadac0ea3810b9e59c267ba8355e94aa1efb8a9bd0f4d9
09c96bf350b55e9228fbd48a45ff6a17c613fc77c238abaafca3d7d09baf
5966bb7ace3578ff9d45f14c071e8be0269e2f62faf459520897ea389633
4e17387bae1d84f62a49e98c4896d1bb090db81036e4c55e01cd5f6cff8e
4f0fe201278695868e6f0cc3481fa1508349954dcf913f0be22f154f7147
d5a367cace0f63a4b3718fd7f770cec8625110c2e49603103838075fe0df
d491e32f75d0068384d2abd21424cce7d07d8ccd368b68bd001394cd6f5c
894dd7450d358a65a74bb56664c81a1b4df8897aef8179800bb2d741beb7
55c5d164568fa057f921af1d3f9b49a9aa8e659cf2c7fc110ceebdb85d75
226ddf0a0735037a59ff35ef77214950cdbefafb770b04be3a26f8cf6d2a
bb485a16f0c777c8967f6a3f8e6f42f77bc3545182fb285ba66548d6fc79
f1f49af490b97ebc183c30219b82ebfbbf0876e53b71155db178f2891b32
38147263435c00b4d2b776ef764e7f7154ab15269fb97fdb0e50f2b7a64c
1b90e2d5794f4d6dbcf90df8df5cad6bc36f47ec7b981d148a42faf1e1a0
bf952a62102ad8e4c7885b28bea5beb83c17039bf6356b7fd5cd381f622c
614ac4686e28391e9d07cc85df5e469963539a4a2f7de5352c33cdcaf9e2
06da02694e1acf8358bb530d237612a5c16bd9c46f7cbb7489c351db019d
947aef3c72eb8d60941668a4207a8f70a21e464f411b8f794a6a01e1280d
9cae83e85a2fc70abe9fab70fd9d686c81c3b1faf5693344ee7ca128342a
b18c9498734cced62514918163d85aee35b7b5ec93d7a075742150200d4a
47583b08c771682575a2d987846d6f0df4fa64345b2e01c95b58697939ed
9b3aefcefd343abe568eae2b4af826b40e7bed097028d9e0b8963121244e
b297de941409d1efd7e9cae2b547dc30c52fd7327698f8e0cfe7396c7461
4269d4a5c147ea22fff4a8b904112df7ff90f97e76aa0e66d4b3bba9dacd
be394e8f34405862b4a5416d8f8ddaab626bc405e12d96f89ac77413932e
378f710382613ac39956a4044c2c0b3c9693825d01a5e7e6fac225c8ebff
97e9106d78f735906c026e92907e8d2999b28c5d1a44db853c975238bd2a
29c1f889d2920a1b74279d54260c918c335037282088d1f2f461c2b52470
7a82f32e202ec38040dce45e4effeda07c6970147470046b21e1cbadb4fd
26e41ae4b324880d8ca5f238d33bc9bb9f04fc49dcc6f70eb3fbaa2f54bc
7ac4f5eaa3d24b461c33a339c4f2a4d2abb27fec2a991cc06168aa710044
c153ee090bee3ddf79ad15966d294db3230ebe8e94f631cd2396233c5dfd
af80a9b8a73a30f015acca6ec143397142b1f685092dcff083f37435797c
2092cc70d0dee9c6b5e4a82a9540a1c0f30dbc26a8e177c2cc1d8cdf8898
469a50ce6dcd3258f71b6467827ef58cd1169647e989fbd637d9cc83c0e6
9f22b39922067cda32a4d814e96b7cd65fc91129358e2137c5a9929a6a72
0391c31c9873f62bb3e7253412dab79717a925b0938b8702d160a099ef5e
ae5a9e9d33212233f92c160f59890bf893adf940b9f9713ea1bb82e6ed89
7e27ff36ae4ce4c515b72fa4d62a3fbd947da933edc2d1546c10ccffdf7b
ab3ea366dbcc1906c9677cc6ceee38e7f7f1c52c42ffe2b86da30ca295a2
d787f09203f185e00bcff5decc6872f795e478cd86f12165005921f6424b
797a678a6f0257c84933932108155bcf4c7fa2b6fe34709ce74499e0d632
e71db62b8236d840642f0e864b332a1cbb901661cf55aa8fe6c0b21850a7
0d7790b46f5117529355146bd4e6214c5be45fa02c932e804e2a647bcbc1
3ca3c0946acb0720d006f41c69690f2fdecec8a467f8844bf07853495e3e
2206fc633c74be3bacfd02558f7aa974deb6593acab1a92302fabff1d853
92bca15e18e8a0829b2d85159a0b3e25dcdf818d2f1202202453f48ea1f0
265a593fb9f2020fedbedb2f6de151ca70aaba942ea935208a8d1a508da5
ab7e024e45f5c752c0a603da0d0c6c37f218eed13803bc952e051de6f47f
b21ef70d1ad55e185ab197eaa579bf5ab8f7f2874414da3ed4fedf3438e0
f1c8af49d22d7fa781d9455b2d575e48c4f2c4f8d8fea1f8fbf941bbdcce
00f48041f84cad91bdcca8385ff375ab4b503ac5266327bccccca7066f61
23852517953920df6466e12b2bc39af2ef1f307615df5e8dd089583ec631
2e1484be7d4777662f542b63124600f33ff25ec9d8d8b62ae4e435ca7335
3b03928983ea082494402435aeb86a9243ef258e0b517c4af5612a8abf29
04d840ed08888d6e4fe49fcd034c06fb24b8db17dfbf3f2b24b53bde8189
738318ee1ce48a1669138ed95cc000b701d92b676b62a7c3f1115cb103a9
996292569388621982a96a607d7de04f006fa2ae761e5685c2008955a6af
85cb443b55c1856bbac3bdd6d9b0509902af9ceae4c9d8c5d93bf12420af
cf72e2d5654a48aa90ec032c8c08832dd212949931cafaae66114c62d281
3fd1b1ac5660bbd7bb8c310dda9e10f3597f4b469800b4da7c9e70646285
6558dafddb5083b953578985b34489ca5e1928df8626f249af80ccaa5281
b6eceb7c1fd13aed16698852a31db6ff064f4c7d882d1457e05868b3e880
432d1d1637c2a6325dedcd6a2edba41b66d4786568f5bea20d306ddcd469
20a22271594dbfa3262c547c15fd63455bcfa16f4049cb39aed63d03f31c
efc0afe16c994228896bf7c1eff84f0baba0d122a2b70436172d7198a9fc
dd9dd14769191652da452242ef4d3a30483986d8a9cfdd94577b5656e0b6
6acb5e8b9103815940b3276e816c2a327f2f6b82204a1a18b935eaf7bd33
c01ea381a0a83fb1f71c808a07d993728938e219866611c5ade5d3d63c3c
98f55c0fd995626fc9f4ee980f014065c2f10334cb0879dce0c2da8ddf8f
6c84df4bcd62c8d8db21dd770ea32fa9743bc71852c7443040e932471f9d
1f0772fc9eb2e942e95b423b55cb0b6f09ec292916073cb6aa8869b1573a
fe4da08722fefe536f1c5259ae576cbff0ee0690553c2be9cecfac1ae447
204b6e1f8298ab251ee19af24aa3827a84920d7f50099663c8e376de4825
c3c0ff291cdb34235cb8fd6c39f8c0169c37ae53167b8dad53edc3ce3947
c3aab9ee8b2e2797e9c3b45ffb93e42a04c70b8be0f35073c5e9e1966e0b
6560cf2f327af80958837d434d06a1956bcb1ae1bfec6cc9598dc2dbb610
d47a1658c01ca0c0365599429a2129f32af01a3f57924ff9771fafaa0fcf
3278f0f6afb9cab8bb8fd4f0b6cd7a6ce7b80f3d2329bde53c11513db73a
92e83188c1bb56beca59f515e4adeb446cb9181a2239cd83f5a8258c21f4
c1a54ca2eb40b6cca2ca93f4933323eeb5fd8f723da219b0894a734c261c
8cfe9586d7fa70da71da2a173bde3f9250066ac4318ae6ad4ca2f3c144db
657cf75bf766b162ae54522f0b2fa42813472cd1141868333197406a6c05
6ef25d490405b46578c20471100f2c290c1990845f7c71f264c575b97c63
7b424f42e2fdd984439d097a26c2ea14143ba5acdb908c92077f2c489bb7
4b1782fce1341388f09c37eed61251069553a13194f864c3cb1a6ae876d5
822a0e128f7211ff9965790eea47b0349ea2f2ab11ab712fdf5ebb6f688b
6207e18cba921442e7be6ee534ebda7b9d0d8b8bd68152598c46e9931e23
9ee09fcf4a8e7edf47a4077867e00383ca8bc509397598116c073516642c
28e71e27ae2483f60d186d11cdaffb1adf6d3eb0d035dd190c04082a4c72
168a962dcb09cabac9e080122445b7baf8eb158e3508b9afa4bc3a530afe
82a5be2bb1e81b75cef5c227b72740bae4b4ed30836bf1156e1d0dffefbb
ac66a8dcdb244b356e268aa35cc6671d2dc7d6e3d3db297d458564a1f2fb
b293b9871a8bfccd65e5efa78f8cc171f4e2f96b7197bb9b5f3c8b828d29
396a9f4d3d307c2edf9338ff00f88ad68325d11741b952aabe65f05064f7
c2dd4f1ed1d817c3042c3dd7670cdb652ba45da6e17513a5b56e7d825c36
eb69fb29db23a02892e33f2444885e2393e14fd922f49c149f9db44bdaf0
1bb4d0b8ea37df5b2328b3302af8c684b209debc76021b3ea4cf40d1dbff
4c3adcc87a3a66b2cd6fb975c774f94aa853d8f7b1198dd24762554e5e9e
0470105159c68045fe82b3c8fc0518618e0749bd4b8612debec680f1fd24
6758ac2a8e957067cf9318ce67c94b4d76ac20027793a93162ebf146d8eb
bf7c0788354b70c383a60dcef55841a7ad3cb7a6163656267f64bdd2f6a5
2bfbfd872f0d73ccdc7174fad17c7cc7546a9585c9c8da273fd3ac5ed3b2
81bfcf5f14e6e296991b7d5c74e513fa975e7f99ad31eb7fa0415697ccb5
8da93b5b6a2b5e1a82a7c547e092be6c53b543c75e40b406536d9f3764cd
65244c75135ab3aa74fc5bb81c2f9293bae6ba91694cebea4431d254d10b
971ffba1bd9cc937b396134041ed28becf4d28c261a411f494cb8f9a6eed
e49c701fd88fb86aa3a6fff272e30f5ca60c193e5bc67eb9182de8b33f9c
4be8be929ba1a5e931f68d34188013ed9e6ca1d8ccf73bd5e16d220f1bb4
0364b7ca0a319611ba744c2775509f7d47c0c2f668cb9c591b440a678cb8
37db63b09ed426e0173936c282bff77555a19c9e46df3fa8f5c5a59baf65
f62f762fc269b9f94b3f09e50d5f2ab6d80356cfe17e85aae5ea7e6d0239
80bcf1f7be4f042bf4807b38fc7eb66be9a08dd728f32b0ee50ca8deee15
c927203d3eca2503b478926b48dcd2eba594263d9f730d15f9c18f5526bb
7e50e867aacb5b7a78c0ca75b0f746917d6663b435dcffad3bdb224f6d91
e3595eadc9f3d203414d3d0367e869d2321149813b0b69062ec5c936903f
b280770df06b3991708c477a5a74fe0f4d3566751ddc47c3b953d49d66e3
734662a822946007049df8168161aae3038216060dc7f16caefedde08a38
6d3d415fe9d91c67d576982d5acbb95604039e34a829783ecc49ac165579
d5b54db7b2367e0dd2ef565b3e083d0d5e8a015037eb0d1f905f16cfbc52
400c05dd1569d5ac0ee0d8459a64400ca0fcaea8f863c5ceb01756361824
4069cb98cf0f0a205ab40e9c8281a7f61fa7f28d13b188b462a0d33bbdf8
1259bce98e244d657e040cbdb878852eb81f4ce844c32ddefa4045031f66
2eff367621d1c43e26a26f7e9f371e51504ab4f6075b3684b1c9fdff1626
2a455c2ecff94f15131f26261752197959f8649efda7cd38d705c9af64e8
1de650296aee803a55d59926bec513cd02f8d69496b520e55c7ae3415764
d9cd42960deeffff7be53763f033f3198797580f195dba6075e8e36e3b1c
ec5c86efb88393d7b57aeefa738f584305b97f7aa5222621116c9fc29131
c034412aa590ba5edbb54da0faeac0d5304f54877e42b7c13a5eabaf3a15
51c3313dc658b1d570a1bc20ce3ab5ed7c13e6e2e9f5df83d0435cf437ad
45926821a31768515c1a5903a1e1d4377cf7be063b09a9294a68826dabe8
b168711290a4a8916a6f127b122578e90aeb202a049a7f90b7ad02bbafe9
d8944d2415001c1df70c8050cd0ab8095079975d44faf4487a847367cff7
0741fe9eb1755ac2fde288e6444cb2daed42ebb8f6bc704704da9540cf86
b246e3e3984ac827175448d437ff1d1a0d8c4aa92c4430eb0d8a48f89655
5f600d0fe60794787636b94a5098ca1fc285771832fce40a9df70d151822
9114281c7f3e55623b34bc568210505d7df9e884ab15592977064d65c403
4b2b61ac3da52d8476bd8baa17c618c4b92ddf4e748a2b07d41f47378f80
270e5b2974cd569771c92e9c79e7d2ba0cd13f95a7641d6018a29e90acfd
074e3a9c06ef2eafe36371420a14e10634f0f71be652f145bfbf84af7f30
82a3b6101631d3b6059011fc7790a0b37446f210e8ac8e71f428a3c1b33f
aafee0ebcc01c204260a2d64dafa627f10888ad2da9f554f01f181a407ce
fad0764dd9862731ad407c2d23b051dfa723f9ddd2f6ae42b2f9f9d75dc2
fd45a625d9dd40913563c6440d7cfdf2ac6fdf0e1aea59563eac9b8ce0ed
5df0c16bb43dec9546633c6dbe23e3e90459ffb3a769579574e38cadd362
eeaea905c3944ecc01370ac326d847f6e975cbeb6c36193d846cf3eab610
38f1ab1cd588947583a89f2814302575ad498d80a7a585616a54994cf0ae
6f4feb4075107cb6ec78be6f69cfa1c40806c656a79634ab1af07216080b
0bcb7c7e36502f3dca48987b5bfc51f0a4e458a1866830ade6c609b02fa1
470727628df5c3bdb4eea19c69609032c56484edb7374be3ed1bb3b340b5
7a7f16ff1a3dbeae499961199864c00dfd31036a2cbad77eaaa1dd11ea86
fdf41bc83b0601d88bd18b1d8d9a99799d03efa8e425823d3781eed2bd53
4178e602ba9cf8470f19c729063e76bcbe7b8d3e50333e602743ece0bc44
9c3989f47477e1c9ecb4971003250504e3ca25b54115d63dc66a9bc02c8f
7dc79fe318feb186f3196afb49b8eb303372e8c680292019ca67b2277d1a
6bfdd02cded6c48fb56cac86713c881f77f867f9fb29a51708ac8d08ad66
dcb41e985168ada36fc21260de0804da7d6760f8e3aa5f47a090763e8549
143b4494245add36e70e8c1cf1d7957871fa29104dae1a236e91fd246a82
d0e94d44ef5c045e047ba8b7d4eea1cc2f0b962837a0f39a74dd0aa02293
31aa9e172be6c85b1e12a695c5608ece5e9e1bebcd7753caa6231c7db84a
42e26751d2d12b7eea85a2076b186f4a1ee9d033c355358956ee9c48238a
758504527a8c76ae4180a25bc7b2f84f7215ed5c8e9f84be91c1b68d4426
eafcbe0e8326b0b370d965ca9ede450ddb4f373eca49279bd206e27cd1e1
1c65b9c6dc7d739c68675908a2c55779f05db3909ee4ebce174cd982b735
6ddf3831b5677c337f4499729eaaa15ab1c6874bfdd350c08b9d2cca236a
52c01cdeb564372437317e07d3e275004b5e5687997289a4df5a11377eec
d9c80a37922058d96476754bbcfb840c48bc1b209bd8cc389dc9f65682c7
f87a2c0fe303139c69e4e86b3941fb73a4f414c2baedd90f5e6dd5059764
d4df7c154fd0dd71c03aebdd0e6ef7f4becc7482ca207fb50cc67c90966f
ce3a813acda28f006f2ee28425fd1e6a7469aefef17d15e0835dd616a596
f78acd2fa8c8e70fe893b4d2612bba92697ccaaa676f0de231c5a156ee3d
0c9fd4442f3910e118666ebfd006212844abc19aae622005f273a680aafd
61aae7df7214725d2fbdb35f04b928c9491aca80ffad4a61d2041d07edc9
0750142dc97567f4628b557edcd3d4e92f3be9d8b1ecf88305f1d207b98b
05a9e1dd131c980ea459940625f5827c5d5a14576635b70a054a24462757
d4d361b8f866f09434f239bbaaf6469ca16e99eb3ff9b21540e126ed81fb
3d13f5c1be05e47c97101392be6a79f9948cc297eba11283c17b04585e87
a09f27dcacf7a61b0d3edf0b9db479b970c38ef101ee6e3beb6eece1dd51
ef4166aeed15c42fae09cf60387c2a2d2341cd2627898a63e613b0a57ca8
cc90565ac5e457f7790b033759069a57c0ff9b17e9c29bea36e04d96b7b9
cd09a7b9b68b5e1f71158a4a9bb25a3cb3e40b7fb014b8355ad1cbb91f68
525b7b94d047bbb84f2bbba780e2e592a3aa1a38b5afd18671aefc87b993
54852946f74073b0d2b3496951c2ba9e2957002f90cf250c6580d3c40987
8252b648d4ec8f99c735759a2b2034b62bd9de89e4de41fe27933d380000
cc1997d0b2ba9a120001d738c09e0100b041e4c5b1c467fb020000000004
595a
1644  Bitcoin / Development & Technical Discussion / Re: using Shannon's information to measure block weights on: June 28, 2011, 11:11:16 AM
From main.h, here's how a block's work gets calculated:

    CBigNum GetBlockWork() const
    {
        CBigNum bnTarget;
        bnTarget.SetCompact(nBits);
        if (bnTarget <= 0)
            return 0;
        return (CBigNum(1)<<256) / (bnTarget+1);
    }


The total work done up to a certain block is the sum of the work of all previous blocks, down to the genesis block

Basically, the "work" the highest possible hash value divided by the maximum acceptable hash value at the block's difficulty.  As Pieter Wuille remarked, this is just the expected number of hashes you'd have to calculate before solving a block.  What you're suggesting calculating is -ln( 1 / "work" ) = ln( "work" ) and adding these up.  Pieter is right to point out that the original definition of total work estimates how much computational power has been invested to date into securing the block chain.  Your definition of total work would be appropriate only if it took a constant amount of calculation to get one an extra bit at the beginning of the hash to be zero.  But it doesn't take a constant amount of work, it takes twice as much work.

Here's a vivid example of what would go wrong.  Say I have 16 block chained together, A1->...->A16, each of which has "work" of 2, and additionally, three blocks X->Y->Z, each of "work" 16.  Under the original definition of aggregate work, the total work in A1->A16 is 32, while the total work in X->Z is 48. These two aggregate works are proportional to the amount of time it would take you to secure each block chain with a constant-speed miner.  Under your definition of work, A1->A16 would have aggregate work 16*ln(2) = 11.1, while X->Y->Z would have aggregate work 8.3, even though X->Y->Z took much longer to secure.

Thanks for your comment.  I'll read that later but it's too late to discourage me, as I have just finished writing a prototype:

http://s0.barwen.ch/~grondilu/cgi-bin/timestamp

1645  Bitcoin / Development & Technical Discussion / Re: using Shannon's information to measure block weights on: June 27, 2011, 07:23:17 PM
I worked hard during two days but I finaly wrote a minimalist distributed timestamp server in bash!!!

Unfortunately I am once again in a cybercafé now so I can't publish it right now.   I'll do it tomorow, I promise.


Stay tuned as I think this is gonna be an MAJOR BREAKTHROUGH in crypto anarchism!
1646  Bitcoin / Development & Technical Discussion / using Shannon's information to measure proof-of-work on: June 25, 2011, 08:31:31 PM
Guys, I am so excited about this new idea of mine that I can't wait until tomorrow when I get my usal internet access to tell it to you.  So I'm writing this from a cybercafé.  I hope you'll enjoy.

I was working on my catalaxia project and I was thinking very hard about how I could avoid using Satoshi's compicated algorith for adjusting difficulty.  Somehow I beleived there should be a more elegant, mathematically pure way to do this.

I was troubled by the idea of mesuring the "strengh" of a block chain, and I must confess I never managed to understand exactly how Satoshi does it.  I wanted something much more simple.

Then I remembered my old lessons in physical statistics and information theory.   Then I thought about entropy and Shannon's information concept.

Basically shannon's information is a way to measure unlikelyness of an event.  A bit like probability, but with additive properties.

In probabilities, when two events e1 and e2 occurs in the same time, the probability of this to happen is the product of the probability:

P(e1 & e2) = P(e1) * P(e2)

Shannon wanted to have the same thing, but with additive property:

I(e1 & e2) = I(e1) + I(e2)

Obviously the solution was to use the logarithm function, so he came up with this formula:

I(e) = - ln ( P(e) )

And he called that "the information".  It's measured in bits if you divide by the natural logarithm of two, and it's quite a fascinating concept.

Ok, enough for the theory.

The idea now is to use this as a measure for the "weight" of a block.  Basically all we have to do is to divide 2^256 by the block hash, and take the natural logarithm.  The total information of the block chain is nothing but the sum of each information for each block.

The good news is that we won't have to start the block chain from scratch or whatever, as the longuest block chain currently almost certainly has the highest Shannon's information.

I think there are many advantages on this, such as simplicity and robustness.  There are also many interesting implications such as the possibility to make the information being a inside secondary currency inside the block chain, which could be used to trade between miners in order to avoid chain forks.  I'll explain later.

There are many things to say about why I think this is a good idea, but right now I just wanted to tell it to you before someone else does, so I can claim the glory of being the first to have dropped it, in case it appears as great an idea as I think it is.
1647  Local / Discussions générales et utilisation du Bitcoin / Re: protocole d'adjudication décentralisé on: June 25, 2011, 12:17:19 PM
A quel point ca peut recouvrir ce que fait le GLBSE ?

Je n'ai que très vaguement suivi ce truc.  Mais je doute qu'ils distribuent l'adjudication.
1648  Bitcoin / Bitcoin Discussion / Re: how to bury some bitcoins without even installing the client on: June 24, 2011, 11:11:46 AM
Well, this seems much more complicated than executing my code, which is just a few bash scripts lines.  The longest part is the conversion of the public key into a bitcoin address, but it's not that long.


you need to learn to think like an avg Joe.  my steps are actually pretty easy and logical from a newbs standpoint.  the bash lines for non Linux users are too foreign and incomprehensible and would scare a newb.
[/quote]

My script is not intended to avg Joe.  At all.  It is really designed to be used by linux nerds.
1649  Local / Discussions générales et utilisation du Bitcoin / Re: protocole d'adjudication décentralisé on: June 24, 2011, 11:02:20 AM
Tu pourrais donner un exemple, j'ai du mal à voir ce que ca pourrait donner concrètement.
En gros ce serait une place de marché d'actifs décentralisée dont les
transactions sont enregistrées dans une blockchain ? 

En gros, oui.  J'ai eu l'idée tandis que je développais mon projet "euronymous".  J'ai d'abord réalisé qu'il n'y aucune raison de le limiter aux devises, puis je me suis dit que je peux laisser les clients créer leurs propres actifs.

C'est quand j'ai été sur le point d'attaquer le code de l'adjudication que l'idée m'est venue de répartir la tâche à la manière de bitcoin.

Du coup j'ai complètement réécrit la chose et je l'ai renommée "catalaxia":

http://s0.barwen.ch/~grondilu/cgi-bin/catalaxia

Pour l'instant ce n'est pas du tout fonctionnel mais ça le sera très bientôt.  La FAQ et l'aide sont déjà dispo.
1650  Bitcoin / Project Development / Re: My new projet: an almost anonymous exchange market place on: June 24, 2011, 10:59:23 AM

This project is turning me crazy.

First I realised there is no reason to limit the currencies to bitcoin and
euros.  Then I realized there is no reason to limit it to currencies.  So I
changed it and started to developp a project that kind of looks like the loom
project.


But then I had an even crazier idea:  what about decentralizing adjudication?
The idea would be to use bitcoin-like concepts to distribute the adjudication
process amongst the clients.  Each of them would compute a proof-of-work on the
book of the orders they know about.  The winner publishes its results and gets
rewarded by the arbitrage opportunities he could exploit in his order book.

http://s0.barwen.ch/~grondilu/cgi-bin/catalaxia
1651  Local / Discussions générales et utilisation du Bitcoin / protocole d'adjudication décentralisé on: June 24, 2011, 10:52:19 AM

Une idée toute bête mais potentiellement révolutionnaire m'est venue à l'esprit cette nuit.  Quasiment une révélation.


En quelques mots:  appliquer les principes de décentralisation de bitcoin pour
l'adjudication d'un carnet d'ordres.

L'idée c'est que tous les noeuds se communiquent tous leurs ordres (achat ou
vente sur des actifs quelconques).  Chaque noeud effectue l'adjudication des
Les noeuds vérifient que la preuve de travail est bien conforme à la difficulté
en cours, ordres dont il a connaissance, et en même temps cherche une preuve de
travail sur son carnet d'ordres.  Lorsqu'il a trouvé, il publie à tous les
autres noeuds à la fois son carnet et l'adjudication correspondante.

Les noeuds vérifient que la preuve de travail est bien conforme à la difficulté
en cours, et que l'adjudication est conforme au protocole sur lequel chacun est
sensé être d'accord (ça devrait pas poser trop de problème).

Pas de frais de transaction, ou alors des frais volontaires.  Les adjudicateurs
peuvent aussi se rémunérer en arbitrant leurs carnets.  Ayant le privilège
temporaire de l'adjudication, ils sont les seuls à pouvoir exploiter eux même
les opportunités d'arbitrage.


Je crois que c'est une riche idée et je vais bosser dessus très activement.


1652  Economy / Trading Discussion / Re: Bitcoin7 a new exchange on: June 23, 2011, 11:38:06 AM

successfully transfered a few euros via SEPA.   Bought a few coins.  The guys seem totally legit to me.
1653  Local / Wiki, documentation et traduction / Re: Français : traduction du papier de Satoshi on: June 23, 2011, 11:35:13 AM

Y'a beaucoup de gens qui postent "je suis partant pour faire la traduc", mais je ne vois pas beaucoup de traduction effective copiée-collée ici.

:/
1654  Bitcoin / Bitcoin Discussion / Re: how to bury some bitcoins without even installing the client on: June 23, 2011, 11:25:26 AM
grondilu:

would u please comment on the live CD technique being discussed?  it goes as follows:

1.  boot into Ubuntu Live CD
2.  download btc client with new wallet.
3.  copy receiving address and email it to yourself
4.  close client and copy wallet.dat from data directory directly to secure usb stick or cd rom
5.  delete wallet.dat from data directory.
6.  reload copied wallet.dat from usb stick or cd rom back into data directory and reopen client to verify it can be read properly.
7.  once verified, close client and Ubuntu, erasing entire process

i should add #6 is my variation on this theme.  i hope it makes sense in the sense of not leaving any fingerprints.

Well, this seems much more complicated than executing my code, which is just a few bash scripts lines.  The longest part is the conversion of the public key into a bitcoin address, but it's not that long.
1655  Bitcoin / Project Development / Re: My new projet: an almost anonymous exchange market place on: June 23, 2011, 11:07:20 AM
I haven't tried the interface, but from the manual, it seems that you can deposit and withdraw BTC or withdraw EUR, but cannot deposit EUR.

I was just wondering how that will work then if there is no EUR in the system to support buy orders. It's a bit like TradeHill at the moment. They have markets for about 20 currencies, but there's no way to submit a buy order for the 17 or so that do not yet accept deposits.


The site owner will be the only one who will be able of depositing paper currencies.

So with this site, you CAN NOT buy bitcoins.  But you can sell them.


By the way, here is the latest version of my code.  I have totally rewritten it:


[code]
#!/bin/bash

THIS_IS_BETA() { true ; }

content() { echo "Content-type: ${2:-text}/${1:-html};" ; echo ; }
error() { content plain ; echo "$@" ; exit ; }

# uncomment this for debugging
#content plain ; exec 2>&1 ; set -e

# Testing installations on server
bash --version | grep -q -v ' [0-3]\.' ||
    error "too old bash version.  Please upgrade to >4.0"
openssl version | grep --q -v ' 0\.[0-9]' ||
    error "wrong openssl version.  Please upgrade to >1.0."
bc --version >/dev/null 2>&1 ||
    error "missing bc.  Please install the unix basic calculator."
dc --version >/dev/null 2>&1 ||
    error "missing dc.  Please install the unix desk calculator."
gawk --version >/dev/null 2>&1 ||
    error "missing gawk.  Please install GNU Awk."
[[ -f base58.sh ]] ||
    error "missing file base58.sh"
. base58.sh ||
    error "error in file base58.sh"

# database protection
unlock() { lockfile-remove "$0" ; }
error() { unlock ; content plain ; echo "$@" ; exit ; }
lock() {
    local maximum_number_of_lock_attempts=2
    if [[ -n "$maximum_number_of_lock_attempts" ]]
    then lockfile-create -r "$maximum_number_of_lock_attempts" "$0"
    else lockfile-create "$0"
    fi || error "Could not lock the database.  Please try again later."
}

# associative arrays to define different kinds of currencies
declare -A smallest_notes=([EUR]=5 [USD]=1)
declare -a paper_currencies=(${!smallest_notes
  • })
declare -A humanCurrencyNames=(\
    BTC="bitcoin" \
    [eur]="euro" \
    [usd]="U.S. dollar" \
    [jpy]="japanese yen" \
    [chf]="swiss franc" \
    )


# a function to determin the kind of a currency
currencyType() {
    local currency="${1^^}"
    if [[ "$currency" = 'BTC' ]]
    then echo "crypto"
    else
        for c in "${paper_currencies
  • }"
        do
            if [[ "$currency" = "$c" ]]
            then echo "paper" ; return
            fi
        done
        echo "unknown"
        return 1
    fi
}

# a function to compare floating point numbers
compare() {
    bc <<<"if ($1 > $2) print \">\" else if ($1 < $2) print \"<\" else print \"=\""
}

# a function to get account balance in any given currency
getbalance() {
    case "${1,,}" in
        "$(THIS_IS_BETA || echo "btc")")
            bitcoind getbalance "$2"
            ;;
        *)
            # server has illimited deposit capability
            if [[ "$2" = "$server_account" ]]
            then echo 1000
            else
                grep "^$2,${1^^}," "$0-moves.csv" |
                gawk -F, -v OFS=, -v s=0 '{ s+=$3 } END { print s }'
            fi
            ;;
    esac
}

# some regular expressions
account_regex='^[a-z0-9]{40}$'
amount_regex='(0|0{,1}\.[0-9]+|[1-9][0-9]*\.[0-9]+|[1-9][0-9]*)'

# prevent use of real bitcoind for now
# (additionnal security to THIS_IS_BETA)
bitcoind() { : ; }

# server parameters
admin="XXXXXX"
server_privkey="-----BEGIN PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
-----END PRIVATE KEY-----"
server_pubkey() { openssl pkey -pubout <<<"$server_privkey" ; }
server_account="$(
openssl pkey -pubout <<<"$server_privkey" |
openssl dgst -rmd160 -binary |
xxd -p)"

# command line client function
# requires curl, openssl version >1, xxd
euronymousClient() {

    #you may have to modify this line manually
    local url="http://localhost/cgi-bin/euronymous"

    case "${1,,}" in

        getnewaddress)
            if [[ -n "$2" ]]
            then curl -s "$url?getnewaddress&account=$2"
            elif ! local privkey="$(openssl genpkey -algorithm RSA)"
            then echo "could not create private key" 2>&1 ; return 1
            elif ! local account="$(
                openssl pkey -pubout <<<"$privkey" |
                openssl dgst -rmd160 -binary |
                xxd -p)"
            then echo "could not compute rmd160 of public key" 2>&1 ; return 2
            elif ! gpg -e -r "$USER" <<<"$privkey" > "$account.pem.gpg"
            then echo "could not encrypt private key" 2>&1 ; return 3
            else
                echo "created ./$account.pem.gpg" 2>&1
                $FUNCNAME getnewaddress "$account"
            fi
            ;;

        withdraw|transfer|trade|cancel)
            local client_privkey="$(cat)" command="$(date +%s) $@"
            curl -s -d "$(
            if [[ "${1,,}" = "withdraw" ]] && [[ "${3,,}" = "eur" ]]
            then
                echo "encrypted:"
                openssl pkeyutl -encrypt -pubin -inkey <(curl -s "$url?pubkey") |
                xxd -p
            else cat
            fi <<<"$command"
            openssl pkey -pubout  <<<"$client_privkey"
            openssl dgst -rmd160 -sign <(echo "$client_privkey") -binary <<<"$command" |
            xxd -p
            )" "$url"
            ;;

        getbalance)
            curl -s "$url?getbalance&currency=$2&account=$3"
            ;;

        view)
            local order="$(curl -s "$url?order=$2")"
            if [[ "$order" = "no such order" ]]
            then return 1
            elif
                echo "$order"
                grep -q "^encrypted:$" <<<"$order"
            then
                local client_privkey="$(cat)"
                if [[ -n "$client_privkey" ]]
                then
                    echo "Decrypted command:"
                    sed '
                    1,2d
                    /-BEGIN PUBLIC KEY-/,$d
                    ' <<<"$order" |
                    xxd -p -r |
                    openssl pkeyutl -decrypt -inkey <(echo "$client_privkey") 2>&1
                fi
            fi
            ;;
        *)
            echo "usage:  $FUNCNAME {create|getnewaddress|withdraw|trade|cancel}  [arguments...]

            For more help, visit $url?help" >&2
            return 2
            ;;
    esac
}
clientcode() { sed -n '/^# command line client function/,/^}$/p' "$0"; }

# Ok now the real CGI part...

# GET requests
if [[ "$REQUEST_METHOD" = "GET" ]]
then
    case "$QUERY_STRING" in
        "")
            # home page
            content
            echo "
            <title>$0</title>
            <h1>$0:  almost anonymous currency exchange marketplace</h1>
            <ul>
            <li><a href=$0?faq>F.A.Q.</a>
            <li><a href=$0?book>trading book</a>
            <li><a href=$0?orders>full list of all orders</a> (<a href=$0?orders&format=csv>CSV</a>)
            <li><a href=$0?moves>adjudications, transfers, withdrawals and deposits</a> (<a href=$0?moves&format=csv>CSV</a>)
            <li><a href=$0?help>help for the command line client</a>
            <li><a href=$0?source_code>source code of this site</a> (<a href=$0?source_code=client>client only</a>)
            <li><a href=$0?postal_fees>postal fees</a>
            </ul>

            <p>Last adjudication: (TODO)</p>

            <p>You can see which bitcoin addresses are associated to a given account with this form:<br>
            <form action=$0 method=get>
            <input type=hidden name=show value=addresses>
            <input type=text name=account size=40>
            <input type=submit value=\"see addresses\">
            </form>
            </p>

            <p>Our <a href=$0?pubkey>public key</a>:<xmp>$(server_pubkey)</xmp></p>
            "
            ;;
        book)
            # display trading book in HTML table
            content plain
            join -t, -v 1 <(
            sort -t, "$0-trade-orders.csv"
            ) <(
            sort -t, "$0-cancelled-trades.csv" ) |
            cut -d, -f 4
            ;;
        orders)
            # display all command history in a big HTML table
            content
            echo "<title>$0 list of all orders</title>

            <table width=75%>
            <thead align=left>
            <tr>
            <th>reference</th><th>account</th><th>date</th><th>command</th>
            </tr>
            </thead>
            <tbody>"
            cat "$0-"{withdraw,trade,transfer,cancel}-orders.csv |
            cut -d, -f 1,2,3,4 |
            sort -t, -g -k 3 |
            while IFS=, read ref account date command
            do
                echo "
                <tr>
                <td><a title=$ref href=$0?order=$ref name=$ref>${ref::5}...${ref: -2}</a></td>
                <td><a title=$account>${account::8}...${account: -3}</a></td>
                <td><a title=\"$(date -d @$date)\">$(date -d @$date +"%F %R")</td>
                <td>$(
                case "$command" in
                    cancel' '*)
                        cancelled_order="${command#* }"
                        echo "cancel <a href=#$cancelled_order>${cancelled_order::6}...${cancelled_order: -3}</a>"
                        ;;
                    transfer' '*)
                        destination_account="${command##* }"
                        echo "${command% *} <a title=$destination_account>${destination_account::8}...${destination_account: -3}</a>"
                        ;;
                    *)
                        echo "$command"
                        ;;
                esac
                )
                </td>
                </tr>"
            done
            echo "
            </tbody></table>"
            ;;

        orders'&'format=csv)
            # loads orders in CSV format
            content csv
            cat "$0-"{withdrawal,trading,transfer,cancel}"-orders.csv"
            ;;
        moves)
            # view of all accounting entries
            content
            echo "TODO"
            ;;
        moves'&format=csv')
            # loads accounting entries in CSV format
            content csv
            echo "TODO"
            ;;
        faq)
            # Frequently Asked Question HTML page
            content
            echo "
            <title>$0 Frequently Asked Questions</title>

            <h1>$0 F.A.Q.</h1>

            <h2>What is the purpose of this site?</h2>

            <p>This site aims to be a more or less anonymous bitcoin exchange
            marketplace.  By more or less, we mean that our priority is to
            provide anonymity for us, not for you.  Our main goal is to prevent
            government from shutting our site down.</p>

            <p>The reason we can not provide you any full anonymity, is that we
            will need your postal address to send you your euros.  However,
            your accounts are anonymous and you can create as many of them as
            you want.  Therefore, we have no way to know exactly the total
            amount of money you own in our book.  This ignorance offers you
            some protection.</p>

            <h2>What can I do on this site?</h2>

            <p>You can trade bitcoins against other national currencies, mainly
            euros.  You can create accounts, deposit bitcoins, withdraw
            bitcoins, withdraw euros via cash in the mail, and trade
            bitcoins/euros on your account against euros/bitcoins on some other
            account.</p>

            <h2>What can I NOT do on this site?</h2>

            <p>You can NOT send us national currencies.  Receiving national
            currencies anonymously is almost impossible (if you know a
            method, please let us know).  Therefore, you can only fund your
            account using bitcoins.  If you want to sell your national
            currencies in cash, we suggest you mirror this site.</p>

            <h2>Do you plan on publishing my postal address?</h2>

            <p>No, we will publish an encrypted version of the address.  Only the owner
            of the account will be able to decrypt it, so he can verify it was transmitted
            correctly.</p>

            <p>We shall, however, always publish the signature of each order, so that
            we can prove our good faith in case of a disagreement.</p>

            <h2>Why are you not online all the time?</h2>

            <p>We have our reasons.</p>

            <p>We shall try to be online at least a few hours every day,
            though.  In the future, it should be possible to submit orders with
            anonymous email via i2p for instance.</p>

            <p>Right now, you can ping our webserver to check if we are online:</p>

            <xmp>$ ping -q -c 5 $HTTP_HOST</xmp>

            <p>Use this command in scripts if you want an order to be sent as soon as
            the server is back online.</xmp>
            "
            ;;
        help)
            # command line client help HTML page
            content
            echo "
            <title>$0 command line client help</title>

            <h1>Sendings orders on command line</h1>

            <p>To send commands you must use a bash command line function which
            is <a href=$0?source_code>published with the server's source
            code</a>.
            </p>

            <p>Here it is for convenience:</p>

            <textarea rows=10 cols=80 readonly=yes>$(clientcode)</textarea>

            <h2>Creating an account</h2>

            <p>An account number is just the rmd160 of a public key.  Creating
            one can be done offline since no commmunication with the server is
            necessary.</p>

            <p>Although the creation of an account can be made easy with our client (see below),
            you can do it manually on your prefered shell command line.  Just run:</p>

            <xmp>$ openssl genpkey -algorithm RSA</xmp>

            <p>This will print on stdout a RSA private key that will be
            perfectly suitable as a private key for an account on our server.
            However, for better security, you might want to encrypt the output
            using GPG: </p>

            <xmp>$ openssl genpkey -algorithm RSA | gpg -e -r \$USER > priv.pem.gpg</xmp>

            <p>To get the account number, you can run:</p>

            <xmp>$ gpg < priv.pem.gpg | openssl dgst -rmd160</xmp>

            <p>You might then want to copy paste the account number in order to rename the
            file priv.pem.gpg:</p>

            <xmp>$ mv {priv,ACCOUNT_NUMBER}.pem.gpg</xmp>

            <p>Of course, you can write your own shell functions to automize this.</p>

            <h2>Deposit bitcoins</h2>

            <p>To deposit some bitcoins on your $0 account, you need to request
            a bitcoin address where to send some bitcoins.  So basically you
            will ask the server to run a <i>getnewaddress</i> bitcoin
            command.</p>

            <p>This can be done only once, or as many times as you want.  It's
            up to you.</p>

            <p>If you have already created an account as explained above, you can run:<p>

            <xmp>$ euronymousClient getnewaddress ACCOUNT_NUMBER</xmp>

            <p>On the server side, this command will execute:</p>

            <xmp>bitcoind getnewaddress ACCOUNT_NUMBER</xmp>

            <p>Thus creating the appropriate bitcoin account if it doesn't
            exist already.</p>

            <p>The command will print the generated bitcoin address on stdout.
            You can then use this address to fund your account.</p>

            <p>If you had not already created an account, you can have the
            client create one for you by running the getnewaddress command with no account number:</p>

            <xmp>$ euronymousClient getnewaddress</xmp>

            <p>Along with the bitcoin address on stdout, this command will also
            create a private key in an ACCOUNT_NUMBER.pem.gpg file in the
            current working directory.</p>

            <p>You can retrieve a signed list of bitcoin addresses associated
            to an account at this url (there is also a small html form on the home
            page to do this):</p>

            http://$HTTP_HOST/cgi-bin/$0?show=addresses&account=ACCOUNT_NUMBER

            <p>This removes to us plausible deniability of an association
            between a bitcoin address and one of your accounts.  We suggest you
            keep a copy of this list for each of your accounts.</p>

            <h2>Withdraw bitcoins</h2>

            <p>To withdraw some bitcoins, you need to provide a bitcoin address
            and an amount of bitcoins you want to receive.</p>

            <xmp>$ euronymousClient withdraw AMOUNT btc to BITCOIN_ADDRESS</xmp>

            This command will read the private key from stdin, so a complete command could be:

            <xmp>$ euronymousClient withdraw AMOUNT btc to BITCOIN_ADDRESS < ACCOUNT_NUMBER.pem</xmp>

            <p>Notice that in most shells you can place the redirection
            wherever you want on the command.  Thus you could as well have
            entered:</p>

            <xmp>$ euronymousClient <ACCOUNT_NUMBER.pem withdraw AMOUNT btc to BITCOIN_ADDRESS</xmp>

            <p>You can use GnuPG for more security:</p>

            <xmp>$ gpg < ACCOUNT_NUMBER.pem.gpg | euronymousClient withdraw AMOUNT btc to BITCOIN_ADDRESS</xmp>

            <p>Or:</p>

            <xmp>$ <ACCOUNT_NUMBER.pem.gpg gpg| euronymousClient withdraw AMOUNT btc to BITCOIN_ADDRESS</xmp>

            <h2>Withdraw euros</h2>

            <p>To withdraw euros, you need to provide a postal address where to
            receive cash via mail.  Only use multiples of 5 (in order to use
            only bank notes).  Postal fees will be deducted from your euro
            account.  For instance, if you withdraw ten euros, ten euros will be
            sent but 10.55 euros will be deducted from your euro balance.</p>

            <xmp>$ euronymousClient withdraw AMOUNT eur to POSTAL_ADDRESS</xmp>

            <p>Again, this command reads the private key from stdin.</p>

            <p>POSTAL_ADDRESS should be a double or single quote enclosed
            string.  Please do not put any carriage return or other fancy
            character in the address.  It might false the signature process.
            Use a semi-colon (Wink if you want to specify a carriage return.</p>

            <p>Exemple:</p>

            <xmp>$ euronymousClient withdraw 50 eur to \"Satoshi Nakamoto;42, unknown street,;Tokyo, JAPAN\"</xmp>

            <p>For this kind of order, the command is not sent in clear through
            the internet.  Instead, it is encrypted with the server's <a
            href=$0?pubkey>public key</a>.</p>

            <h2>Transfer funds from one account to another</h2>

            <p>To do so you can run:</p>

            <xmp>$ euronymousClient transfer AMOUNT {eur|btc} to ACCOUNT_NUMBER</xmp>

            <p>AMOUNT should be a positive number.  This commands reads private key from stdin.</p>

            <h2>Trade bitcoins vs. euros</h2>

            <p>To submit a trading order, you run a command such as:</p>

            <xmp>$ euronymousClient trade 5.982 btc -19.43 eur</xmp>

            <p>Use signed values to indicate the direction of your trade:
            negative for the currency you want to sell, positive for the
            currency you want to buy.</p>

            <p>Only use three letters currency ISO
            code.</p>

            <p>This command also reads the private key from stdin.</p>

            <p>You can use shell expansion magic if you want to make a trade
            on a more conventionnal price/amount notation.</p>

            <p>Example: buying 50 bitcoins at  16.4 EUR/BTC</p>

            <xmp>$ amount=50 price=16.4; euronymousClient trade \$amount btc -\$(dc <<<\"4k \$amount \$price *n\") eur</xmp>

            <h2>Cancel an order</h2>

            <p>Euro withdrawals and trade orders are the only orders you can
            cancel.</p>

            <p>You can cancel a trading order as long as the order has
            not been fully executed.  Cancellation of a partially executed
            trading order will only prevent the rest of the trade to be
            adjudicated.

            <p>You can cancel a euro withdrawal as long as the letter
            has not been sent yet.</p>

            <p>To cancel an order, just run:</p>

            <xmp>$ euronymousClient cancel REFERENCE_NUMBER</xmp>

            <p>REFERENCE_NUMBER is a reference number published in the <a
            href=$0?orders>list of all orders</a>.  It is actually the md5sum of the
            signature.</p>

            <p>This command reads the private key from stdin.</p>

            <h2>Checking</h2>

            <p>You can visualize an order, whether it is a trading, withdrawal
            or cancelling order, by running:</p>

            <xmp>$ euronymousClient view ORDER_REFERENCE_NUMBER</xmp>

            <p>If the order is a euro withdrawal order, thus containing a
            postal address, then the command will read the private key from
            standard input in order to decrypt the command.</p>

            "
            ;;
        order=*)
            # viewing specific order
            ref="${QUERY_STRING#*=}"
            content plain
            if ! grep -q "^$ref$" "$0.orders"
            then echo "no such order"
            else sed -n "/^$ref$/,/^$/ {/^.*$/p}" "$0.orders"
            fi
            ;;
        getbalance'&'currency=*'&'account=*)
            # balance inquiry
            currency="${QUERY_STRING#*=}"
            currency="${currency%%&*}"
            account="${QUERY_STRING##*=}"
            content plain
            getbalance "$currency" "$account"
            ;;
        pubkey)
            # Server's public key displaying request
            content plain
            server_pubkey
            ;;
        show=addresses'&'account=*)
            # displaying bitcoin addresses associated to a given, specific account
            account="${QUERY_STRING##*=}"
            [[ "$account" =~ $account_regex ]] ||
                error "'$account' is not a valid account format"
            content plain
            server_pubkey
            {
                echo "Here are the bitcoin addresses for account ref. $account:"
                if THIS_IS_BETA
                then echo NONE
                else
                    list="$(bitcoind getaddressesbyaccount "${QUERY_STRING#*=}")"
                    echo "${list:-NONE}"
                fi
            } |
            tee >(
            openssl dgst -rmd160 -sign <(echo "$server_privkey") -binary |
            xxd -p
            )
            ;;
        source_code)
            # server's source code request
            content plain
            # some portions of the code must be hidden
            sed -r '
            /^admin=.*/s/.*/admin=XXXXXXXXX/
            /^rpcpasswd=/s/.*/rpcpasswd=XXXXXXXX/
            /^server_privkey="-----BEGIN PRIVATE KEY-----/,/-----END PRIVATE KEY-----"$/ {
            s/.{64}/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/
            s/.*==$/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ }' "$0"
            ;;
        source_code=client)
            # source code request (only the client part)
            content plain
            clientcode
            ;;
        getnewaddress'&'account=*)
            # getnewaddress command
            account="${QUERY_STRING##*=}"
            [[ "$account" =~ $account_regex ]] ||
                error "wrong account format"
            bitcoin_address="$(THIS_IS_BETA || bitcoind getnewaddress "$account")" ||
                error "could not generate address Sad"

            content plain
            sleep 5 # we make the client wait a bit to prevent abuse
            echo "$bitcoin_address"
            ;;
        server_info)
            # server information request
            content plain
            set
            ;;
        *)
            # error
            error "unknown query string: $QUERY_STRING"
            ;;
    esac
fi

# POST requests

if [[ "$REQUEST_METHOD" = "POST" ]]
then
    # reading post data
    #
    # post data is supposed to be made of:
    # - the command
    # - the client's public key
    # - the signature of the command, corresponding to the given public key
    read -N $CONTENT_LENGTH post_data ||
        error "could not retrieve post data"

    # extracting public key first
    pubkey="$(sed -n '/^-\+BEGIN PUBLIC KEY-\+$/,/^-\+END PUBLIC KEY-\+$/p' <<<"$post_data")"

    # if there is no public key, then there is no point going further.
    [[ -n "$pubkey" ]] ||
        error "no public key in post data"

    # checking that the public key is a valid one
    openssl pkey -pubin -pubout <<<"$pubkey" >/dev/null ||
        error "invalid public key in post data"

    # now that we have the client's public key, we can compute the
    # corresponding account number
    account="$(openssl dgst -rmd160 -binary <<<"$pubkey" |xxd -p)"

    # extracting signature
    signature="$(sed '1,/^-\+END PUBLIC KEY-\+$/d' <<<"$post_data")"

    # all commands in POST requests must be signed so if there is no signature, we stop here
    [[ -n "$signature" ]] ||
        error "no signature in post data"

    # extracting the command
    command="$(sed '/^-\+BEGIN PUBLIC KEY-\+$/,$d' <<<"$post_data")"

    # if command begins with "encrypted:", then it is encrypted with the
    # server's public key.  This happens when the command is a paper currency
    # withdrawal, as such a command has a postal address in it.
    # In that case, we just have to decrypt it first.
    if [[ "$command" =~ ^encrypted: ]]
    then command="$(xxd -p -r <<<"${command#encrypted:}" |
        openssl pkeyutl -decrypt -inkey <(echo "$server_privkey"))" ||
            error "could not decrypt command"
    fi

    # now we check the signature
    <<<"$command" openssl dgst -rmd160 \
        -verify <(echo "$pubkey") -signature <(xxd -p -r <<< "$signature") ||
        error "wrong signature"

    # The signature is correct, we can make a reference number out of it.
    # this is used as a unique identifier for all orders
    reference="$(openssl dgst -md5 -binary <<<"$signature" | xxd -p)"

    # checking that the reference is not already in the orders file
    # (the database is not locked yet so we'll have to check that again later)
    grep -q "^$reference$" "$0.orders" &&
        error "this order has already been submitted"

    # We put the command words in an array.  It will help parsing
    read -a command_array <<<"$command"

    # first word shoud be a time in seconds since EPOCH
    date="${command_array[0]}"

    [[ "$date" =~ ^[1-9][0-9]*$ ]] ||
        error "wrong date format"

    # comparing given time with server time
    now="$(date +%s)" acceptable_delay_in_minutes=2
    ((date<now-60*acceptable_delay_in_minutes)) &&
        error "claimed date ($(date -d @$date)) is more than $acceptable_delay_in_minutes minutes in the past"

    # The server won't accept an order which pretends to be coming from the future.
    ((date>now)) &&
        error "claimed date ($(date -d @$date)) is in the future"

    # We store the base properties of order in a pre CSV record
    order="$reference,$account,$date"

    # LOCKING THE DATABASE
    # We're about to parse the command.  As we do, we'll extract data from the
    # database, and we'll do many consistency check.  We don't want these data
    # to have changed once we commit to the actual database edition.  So we
    # lock the database NOW.
    lock

    # Let's check again that the order is not already in the database
    ! grep -q "^$reference$" "$0.orders" ||
        error "this order has already been submitted"

    # First command word was the time.  We've already extracted it.  The second
    # word is the type of the order.  We deal with the different
    # possibilities in a case block.
    # Each kind of order has its own format for storage. There is a common
    # $0.orders file, though.

    case "${command_array[1]^^}" in
        WITHDRAW)
            # withdraw order

            # specific file for withdrawal orders is "$0-withdraw-orders.csv"
            order_file="$0-withdraw-orders.csv"

            # command should be of the form:
            # TIME withdraw AMOUNT CURRENCY to DESTINATION

            # DESTINATION could be several words,
            # so the command should have at least 6 words
            [[ "${#command_array
  • }" -ge 6 ]] ||
                error "not enough arguments for a withdraw order"

            # Third word is the amount to be withdrawned
            amount="${command_array[2]#+}"
            [[ "$amount" =~ ^$amount_regex$ ]] ||
                error "wrong amount format or negative amount"

            # it should be positive
            [[ "$amount" -ge 0 ]] ||
                error "null amount in a withdrawal order"

            # the 'to' preposition is not optionnal
            [[ "${command_array[4]^^}" = "TO" ]] ||
                error "wrong command format (was expecting 'to', not '${command_array[4]}')"

            # storing currency name in lower case
            currency="${command_array[3],,}"

            # checking balance
            balance="$(getbalance "$currency" "$account")" ||
                error "could not get $currency balance for account $account"

            # checking that there is enough funds for the requested
            # withdrawal amount
            [[ "$(compare "$amount" "$balance")" = '<' ]] ||
                error "not enough ${humanCurrencyNames[$currency]:-$currency} funds on this account"

            # Now, depending on whether we're dealing with a cryptographic
            # currency or a paper currency, the procedure will not be the
            # same.  A cryptocurrency can be withdrawned electronically,
            # but a paper currency must be sent via postal mail.
            case "$(currencyType "$currency")" in
                crypto)
                    # so far bitcoin is the only cryptocurrency, so we'll
                    # just assume we're dealing with bitcoins
                    bitcoin_address="${command_array[5]}"
                    checkBitcoinAddress "$bitcoin_address" ||
                        error "invalid bitcoin address"

                    order+="${command#* },$currency,$amount,$bitcoin_address"
                    bitcoind_args=(sendfrom "$account" "$bitcoin_address" "$amount" "${minconf:=1}" "$reference")
                    if THIS_IS_BETA
                    then echo "$(date): bitcoind ${bitcoind_args
  • }" >> "$0.log"
                    else
                        : bitcoind "${bitcoind_args
  • }"
                    fi
                    ;;
                paper)
                    humanName="${humanCurrencyNames[$currency]:-$currency}"

                    # paper currencies can only be sent via postal mail if the
                    # amount is a multiple of the smallest bank note in this
                    # currency
                    smallest_note="${smallest_notes["${currency^^}"]}"
                    [[ "$(dc <<<"$amount $smallest_note/$smallest_note*n")" = "$amount" ]] ||
                        error "amount in $humanName should be a multiple of $smallest_note in order to be sent via postal mail"

                    # for a paper withdrawal we can't store the full command
                    order+=",$amount $humanName withdrawal,$currency,$amount"
                    if ! THIS_IS_BETA
                    then
                        # Mail instructions to administrator
                        {
                            gpg -ae -r "$admin" 2>/dev/null || cat
                        } <<<"
                        order ref. $reference (account n° $account):
                        ${command#* }
                        " |
                        mail -s "$amount $humanName withdrawal" "$admin" &
                    fi

                    # encrypt command to hide the address
                    command="encrypted:"
                    command+="$(openssl pkeyutl -encrypt -pubin -inkey <(echo "$pubkey") <<<"$command")"
                    ;;
                *)
                    error "unkown currency (or not supported yet)"
                    ;;
            esac
            moves=("$account,${currency^^},-$amount")
            ;;

        TRADE)
            # trade order

            # specific file for trade orders is "$0-trade-orders.csv"
            order_file="$0-trade-orders.csv"

            # command should be of the form:
            # TIME trade AMOUNT1 CURRENCY1 AMOUNT2 CURRENCY2

            # considering the format of a trade order, the command array
            # should be six words long.
            [[ "${#command_array
  • }" = '6' ]] ||
                error "incorrect number of arguments for a trade order"

            # extracting amounts and currencies
            amounts=("${command_array[2]}" "${command_array[4]}")
            currencies=("${command_array[3]}" "${command_array[5]}")

            humanNames=()
            for c in "${currencies
  • }"
            do humanNames+=("${humanCurrencyNames[$c]:-$c}")
            done

            # checking amounts
            declare -i n i
            for i in 0 1
            do
                # checking format
                [[ ! "${amounts}" =~ ^[+-]{,1}$amount_regex$ ]] &&
                    error "wrong amount format for currency '${currencies}'"

                # detecting the negative amount
                [[ "${amounts::1}" = '-' ]] && n=i

                # detecting a null amount
                ((${amounts%.*})) ||
                    error "'${currencies}' amount is null"
            done

            # checking that amounts don't have the same sign
            ((${amounts[0]%%.*}*${amounts[1]%%.*} < 0)) ||
                error "amounts have the same sign"

            # checking balance
            balance="$(getbalance "${currencies[n]}" "$account")" ||
                error "could not check balance"

            # checking funds
            [[ "$(compare "${amounts[n]:1}" "$balance")" = '>' ]] ||
                error "not enough funds"

            order+=",${command#* }"
            moves=()
            for i in 0 1
            do
                order+=",${amounts},${currencies}"
                moves+=("$account,${amounts},${currencies},$reference")
            done
            ;;

        TRANSFER)
            amount_to_transfer="${command_a
1656  Local / Discussions générales et utilisation du Bitcoin / Re: Paradigm Shift 2011 - Recherche d'un intervenant on: June 22, 2011, 11:45:05 AM
J'ai demandé à Renaud Lifchitzt lors de son workshop bitcoin, il serais éventuellement intéressé, mais si il donne finalement une réponse négative, un remplaçant est toujours bienvenu.


Entre nous vous pourriez faire un petit effort pour rémunérer l'intervenant (et en bitcoins, tant qu'à faire).  45 minutes de présentation, c'est du boulot, et Bitcoin n'est pas une association caritative.
1657  Bitcoin / Project Development / Re: My new projet: an almost anonymous exchange market place on: June 22, 2011, 10:57:11 AM
REMOVED
1658  Local / Other languages/locations / Re: Esperanto ! on: June 21, 2011, 12:57:00 PM
Saluton! Vi havas belajn femurojn!

Pardonu?
1659  Bitcoin / Project Development / Re: My new projet: an almost anonymous exchange market place on: June 21, 2011, 10:38:55 AM
So, if I'm understanding this correctly, most transactions require a signature (as opposed to a password)? Good, I was just envisioning something like that recently. It should be more secure overall---the only question is how to incorporate that into a web interface. Actually, are you planning on including a web interface?

There will be no HTML-form based interface.  It's really a pain in the ass to program imho.  And such things exist already.

My plan is really to build a HTTP server for a command line client.

The web server will only be used to publish informations and general help.

When the site is ready the plan is to publish it on a hidden TOR server.

Right now I'm publishing it with my real name as I see no way anyone can claim I am doing anything illegal.  This site doesn't work yet so I can't do any actual trading.  Publishing it is really a matter of free speech.
1660  Bitcoin / Project Development / My new projet: an almost anonymous exchange market place on: June 20, 2011, 03:08:04 PM

Guys I'm so enthusiastic about this new project of mine that I can't resist publishing it even if it's currently a work in progress.

The FAQ is already here, along with the command line help, and many of the difficult technical parts are done (signing, verifying and encrypting orders, protecting the database with locks, and so on).

I think it is going to be pretty cool.

Check it out:

http://s0.barwen.ch/~grondilu/cgi-bin/euronymous


It's 100% GNU/bash CGI Smiley
Pages: « 1 ... 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 ... 206 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!