BitcoinJS Webtuesday Presentation

722 views
659 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
722
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

BitcoinJS Webtuesday Presentation

  1. 1. Stefan Thomas • WeUseCoins.com$ BitcoinJS A divorce and new beginnings www.bitcoinjs.org Creative Commons 3.0 Attribution
  2. 2. $ login www.bitcoinjs.org Creative Commons 3.0 Attribution
  3. 3. $ login www.bitcoinjs.org Creative Commons 3.0 Attribution
  4. 4. $ login - Web developer 13 years www.bitcoinjs.org Creative Commons 3.0 Attribution
  5. 5. $ login - Web developer 13 years - Bitcoin evangelist www.bitcoinjs.org Creative Commons 3.0 Attribution
  6. 6. $ login - Web developer 13 years - Bitcoin evangelist 6 months www.bitcoinjs.org Creative Commons 3.0 Attribution
  7. 7. $ login - Web developer 13 years - Bitcoin evangelist 6 months www.bitcoinjs.org Creative Commons 3.0 Attribution
  8. 8. $ login - Web developer 13 years - Bitcoin evangelist 6 months www.bitcoinjs.org Creative Commons 3.0 Attribution
  9. 9. $ ls- What’s Bitcoin? (1 slide version)- Things that are... sub-optimal- Node.js to the rescue! www.bitcoinjs.org Creative Commons 3.0 Attribution
  10. 10. $ man bitcoin www.bitcoinjs.org Creative Commons 3.0 Attribution
  11. 11. $ man bitcoin- Limited set of tokens www.bitcoinjs.org Creative Commons 3.0 Attribution
  12. 12. $ man bitcoin- Limited set of tokens- Decentralized www.bitcoinjs.org Creative Commons 3.0 Attribution
  13. 13. $ man bitcoin- Limited set of tokens- Decentralized- Open-Source www.bitcoinjs.org Creative Commons 3.0 Attribution
  14. 14. $ man bitcoin- Limited set of tokens- Decentralized- Open-Source= Internet Money www.bitcoinjs.org Creative Commons 3.0 Attribution
  15. 15. $ wget blk*.dat www.bitcoinjs.org Creative Commons 3.0 Attribution
  16. 16. $ wget blk*.dat www.bitcoinjs.org Creative Commons 3.0 Attribution
  17. 17. $ wget blk*.dat x 140000 www.bitcoinjs.org Creative Commons 3.0 Attribution
  18. 18. $ wget blk*.dat x 140000= 620 MB www.bitcoinjs.org Creative Commons 3.0 Attribution
  19. 19. $ wget blk*.dat x 140000= 620 MB => 6-24 hours www.bitcoinjs.org Creative Commons 3.0 Attribution
  20. 20. $ wget blk*.dat x 140000= 620 MB => 6-24 hours www.bitcoinjs.org Creative Commons 3.0 Attribution
  21. 21. $ rm wallet.dat www.bitcoinjs.org Creative Commons 3.0 Attribution
  22. 22. $ rm wallet.datVirtualBox Dropbox Ironkey + Truecrypt www.bitcoinjs.org Creative Commons 3.0 Attribution
  23. 23. $ rm wallet.datVirtualBox Dropbox Ironkey + Truecrypt www.bitcoinjs.org Creative Commons 3.0 Attribution
  24. 24. $ rm wallet.datVirtualBox Dropbox Ironkey + Truecrypt www.bitcoinjs.org Creative Commons 3.0 Attribution
  25. 25. $ rm wallet.datVirtualBox Dropbox Ironkey + Truecrypt www.bitcoinjs.org Creative Commons 3.0 Attribution
  26. 26. $ rm wallet.datVirtualBox Dropbox Ironkey + Truecrypt www.bitcoinjs.org Creative Commons 3.0 Attribution
  27. 27. $ rm wallet.dat www.bitcoinjs.org Creative Commons 3.0 Attribution
  28. 28. $ rm wallet.dat www.bitcoinjs.org Creative Commons 3.0 Attribution
  29. 29. $ scp wallet.datMetasploit 4.0These additions include nine new SCADA exploits, improved 64-bit Linux payloads, exploits for Firefox and Internet Explorer,full-HTTPS and HTTP Meterpreter stagers, and post-exploitationmodules for dumping passwords from Outlook, WSFTP,CoreFTP, SmartFTP, TotalCommander, BitCoin and many otherapplications. www.bitcoinjs.org Creative Commons 3.0 Attribution
  30. 30. $ scp wallet.datMetasploit 4.0These additions include nine new SCADA exploits, improved 64-bit Linux payloads, exploits for Firefox and Internet Explorer,full-HTTPS and HTTP Meterpreter stagers, and post-exploitationmodules for dumping passwords from Outlook, WSFTP,CoreFTP, SmartFTP, TotalCommander, BitCoin and many otherapplications. www.bitcoinjs.org Creative Commons 3.0 Attribution
  31. 31. $ scp wallet.datMetasploit 4.0blah new post exploitation modules www.bitcoinjs.org Creative Commons 3.0 Attribution
  32. 32. $ scp wallet.datMetasploit 4.0blah new post exploitation modulesblah blah for dumping passwords blah www.bitcoinjs.org Creative Commons 3.0 Attribution
  33. 33. $ scp wallet.datMetasploit 4.0blah new post exploitation modulesblah blah for dumping passwords blahBlah, BitCoin, Blah, … www.bitcoinjs.org Creative Commons 3.0 Attribution
  34. 34. $ scp wallet.datMetasploit 4.0blah new post exploitation modulesblah blah for dumping passwords blahBlah, BitCoin, Blah, … www.bitcoinjs.org Creative Commons 3.0 Attribution
  35. 35. $ cat cmn_sense.txt www.bitcoinjs.org Creative Commons 3.0 Attribution
  36. 36. $ cat cmn_sense.txtBlock chain www.bitcoinjs.org Creative Commons 3.0 Attribution
  37. 37. $ uml blockchain www.bitcoinjs.org Creative Commons 3.0 Attribution
  38. 38. $ cat cmn_sense.txtBlock chain www.bitcoinjs.org Creative Commons 3.0 Attribution
  39. 39. $ cat cmn_sense.txtBlock chain UI www.bitcoinjs.org Creative Commons 3.0 Attribution
  40. 40. $ cat cmn_sense.txtBlock chain UI Wallet www.bitcoinjs.org Creative Commons 3.0 Attribution
  41. 41. $ cat cmn_sense.txt Block chain UI Wallet• HUGE!!• Global• Public www.bitcoinjs.org Creative Commons 3.0 Attribution
  42. 42. $ cat cmn_sense.txt Block chain UI Wallet • HUGE!! • Global • Public-> Server www.bitcoinjs.org Creative Commons 3.0 Attribution
  43. 43. $ cat cmn_sense.txt Block chain UI Wallet • HUGE!! • Complex • Global • Personal • Public • Private-> Server www.bitcoinjs.org Creative Commons 3.0 Attribution
  44. 44. $ cat cmn_sense.txt Block chain UI Wallet • HUGE!! • Complex • Global • Personal • Public • Private-> Server -> Client www.bitcoinjs.org Creative Commons 3.0 Attribution
  45. 45. $ cat cmn_sense.txt Block chain UI Wallet • HUGE!! • Complex • Simple • Global • Personal • Personal • Public • Private • Secret!!-> Server -> Client www.bitcoinjs.org Creative Commons 3.0 Attribution
  46. 46. $ cat cmn_sense.txt Block chain UI Wallet • HUGE!! • Complex • Simple • Global • Personal • Personal • Public • Private • Secret!! (ideally)-> Server -> Client -> Hardware www.bitcoinjs.org Creative Commons 3.0 Attribution
  47. 47. $ find platformBlock chain server• Peer-to-peer node www.bitcoinjs.org Creative Commons 3.0 Attribution
  48. 48. $ find platformBlock chain server• Peer-to-peer node• Realtime www.bitcoinjs.org Creative Commons 3.0 Attribution
  49. 49. $ find platformBlock chain server• Peer-to-peer node• Realtime• JSON-RPC www.bitcoinjs.org Creative Commons 3.0 Attribution
  50. 50. $ find platformBlock chain server• Peer-to-peer node• Realtime• JSON-RPC• Lots of concurrent users www.bitcoinjs.org Creative Commons 3.0 Attribution
  51. 51. $ find platformBlock chain server• Peer-to-peer node• Realtime• JSON-RPC• Lots of concurrent users www.bitcoinjs.org Creative Commons 3.0 Attribution
  52. 52. $ find platformBlock chain server• Peer-to-peer node• Realtime• JSON-RPC• Lots of concurrent users + www.bitcoinjs.org Creative Commons 3.0 Attribution
  53. 53. $ d8 server.js www.bitcoinjs.org Creative Commons 3.0 Attribution
  54. 54. $ d8 server.jsMemory leaks! Example: MongooseJS www.bitcoinjs.org Creative Commons 3.0 Attribution
  55. 55. $ d8 server.jsMemory leaks! Example: MongooseJSCollection.prototype.addQueue = function (name, args) { this.queue.push([name, args]); return this;};Collection.prototype.doQueue = function () { for (var i = 0, l = this.queue.length; i < l; i++){ this[this.queue[i][0]].apply(this, this.queue[i][1]); } return this;}; www.bitcoinjs.org Creative Commons 3.0 Attribution
  56. 56. $ d8 server.js Memory leaks! Example: MongooseJS Collection.prototype.addQueue = function (name, args) { this.queue.push([name, args]); return this; }; Collection.prototype.doQueue = function () { for (var i = 0, l = this.queue.length; i < l; i++){ this[this.queue[i][0]].apply(this, this.queue[i][1]); }+ this.queue = []; return this; }; www.bitcoinjs.org Creative Commons 3.0 Attribution
  57. 57. $ d8 server.jsMemory leaks! Example: node-binarysaw.chain = function () { var ch = Traverse(saw.handlers).map(function (node) { // ... if (typeof node === function) { this.update(function () { saw.actions.push({ path : ps, args : [].slice.call(arguments) }); return ch; }); } www.bitcoinjs.org Creative Commons 3.0 Attribution
  58. 58. $ d8 server.js Lesson www.bitcoinjs.org Creative Commons 3.0 Attribution
  59. 59. $ d8 server.js LessonNode.js librariescan be strange www.bitcoinjs.org Creative Commons 3.0 Attribution
  60. 60. $ d8 server.js LessonNode.js librariescan be strange www.bitcoinjs.org Creative Commons 3.0 Attribution
  61. 61. $ d8 server.js LessonNode.js librariescan be strangeBut overall it’snot that bad! www.bitcoinjs.org Creative Commons 3.0 Attribution
  62. 62. $ d8 server.js Lesson Also:Node.js libraries V8’s GC is very good!can be strangeBut overall it’snot that bad! www.bitcoinjs.org Creative Commons 3.0 Attribution
  63. 63. $ d8 server.jsDebugging Tip: “LiveObjectList”Getting set up# Compile V8 with LiveObjectList supportscons liveobjectlist=on ...# Run your program with debuggingnode --debug my_leaky_program.js# Connect to your program with D8d8 --remote_debugger www.bitcoinjs.org Creative Commons 3.0 Attribution
  64. 64. $ d8 server.jsDebugging Tip: “LiveObjectList”Usagelol c Capture a heap snapshotlol Show heap snapshotslol list List objects in a snapshotlol diff [s1] [s2] Show differences between snapshotslol path [obj_id] Show retaining paths for an object www.bitcoinjs.org Creative Commons 3.0 Attribution
  65. 65. $ d8 server.jsmoon@clymene:~/opt/node$ deps/v8/d8 --remote_debugger> Type: connectV8-Version: 3.1.8.26Protocol-Version: 1Embedding-Host: node v0.4.10stoppeddbg> lol cCaptured live object list 1: count 156079 size 8129300dbg> c(running)>stoppeddbg> lol cCaptured live object list 2: count 173343 size 8374416dbg> www.bitcoinjs.org Creative Commons 3.0 Attribution
  66. 66. $ d8 server.jsdbg> gcGC 7809868 => 6710536 (7.4M => 6.4M)dbg> lol diff 1 2 v t Array 1000objects: [ 1] @222138: size 16, 0xb39bd329 <JSArray> len 0 [ 2] @222139: size 16, 0xb39bd339 <JSArray> len 0 [ 3] @222143: size 16, 0xb39bd3a1 <JSArray> len 0 [ 4] @222144: size 16, 0xb39bd3b1 <JSArray> len 0 [ 5] @222145: size 16, 0xb39bd3c1 <JSArray> len 0 [ 6] @222365: size 16, 0xb39bede5 <JSArray> len 0 [ 7] @222498: size 16, 0xb39bfea5 <JSArray> len 0 [ 8] @222615: size 16, 0xb39c0d55 <JSArray> len 3...dbg> lol path @222138 www.bitcoinjs.org Creative Commons 3.0 Attribution
  67. 67. $ d8 server.js | | V[274] @79332 0xb4422699: size 20 : HeapObject DescriptorArray FixedArray0xb4422699: [FixedArray] - length: 3 [0]: 0xb77b3efd <FixedArray[53]> [1]: 0xb577404d <undefined> [2]: 0xb41eddd9 <JS array[0]> | | V[275] @215108 0xb41eddd9: size 16 : HeapObject JSObject JSArray0xb41eddd9: [JSObject] - map = 0xb5754861 - prototype = 0xb77b4f49 { #length: 0xb577e581 <Proxy> (callback) #_cast: (null descriptor) }===================================== www.bitcoinjs.org Creative Commons 3.0 Attribution
  68. 68. $ uname -aAnother thing… 32 bit 64 bit www.bitcoinjs.org Creative Commons 3.0 Attribution
  69. 69. $ uname -aAnother thing… 32 bit 64 bit- V8 heap limit 1 GB 1.9 GB www.bitcoinjs.org Creative Commons 3.0 Attribution
  70. 70. $ uname -aAnother thing… 32 bit 64 bit- V8 heap limit 1 GB 1.9 GB- MongoDB database 2.5 GB www.bitcoinjs.org Creative Commons 3.0 Attribution
  71. 71. $ bitcoinjs runNow STOP! www.bitcoinjs.org Creative Commons 3.0 Attribution
  72. 72. $ bitcoinjs runNow STOP!Demo time! www.bitcoinjs.org Creative Commons 3.0 Attribution
  73. 73. $ forecastLots more to be done!- GUI- Wallet- Shopping Cart Interface www.bitcoinjs.org Creative Commons 3.0 Attribution
  74. 74. $ git clone bitcoinjs-guiA matching client!- JS-based crypto (fun stuff!) www.bitcoinjs.org Creative Commons 3.0 Attribution
  75. 75. $ git clone bitcoinjs-guiA matching client!- JS-based crypto (fun stuff!)- HTML5 LocalStorage www.bitcoinjs.org Creative Commons 3.0 Attribution
  76. 76. $ git clone bitcoinjs-guiA matching client!- JS-based crypto (fun stuff!)- HTML5 LocalStorage- Socket.IO www.bitcoinjs.org Creative Commons 3.0 Attribution
  77. 77. $ git clone bitcoinjs-guiA matching client! www.bitcoinjs.org Creative Commons 3.0 Attribution
  78. 78. $ git clone bitcoinjs-guiA matching client!- Beta August 2011- Screencast: http:/ /www.youtube.com/watch?v=KTmFwnIRG9c www.bitcoinjs.org Creative Commons 3.0 Attribution
  79. 79. $ wallet 2.0Ideas for a more secure wallet www.bitcoinjs.org Creative Commons 3.0 Attribution
  80. 80. $ wallet 2.0Ideas for a more secure wallet- Deterministic Wallet www.bitcoinjs.org Creative Commons 3.0 Attribution
  81. 81. $ wallet 2.0Ideas for a more secure wallet- Deterministic Wallet- Distributed Key Generation www.bitcoinjs.org Creative Commons 3.0 Attribution
  82. 82. $ wallet 2.0Ideas for a more secure wallet- Deterministic Wallet- Distributed Key Generation- Hardware Device www.bitcoinjs.org Creative Commons 3.0 Attribution
  83. 83. $ exitThank youAnd good night! www.bitcoinjs.org Creative Commons 3.0 Attribution
  84. 84. $ tail -f github.com/bitcoinjs @bitcoinjs Meetup this Saturday! Oliver Twist Pub 16:30 www.bitcoinjs.org Creative Commons 3.0 Attribution

×