{"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-12429911"},"updated":{"$t":"2026-10-08T04:37:47.743-07:00"},"category":[{"term":"bitcoin"},{"term":"security"},{"term":"gwt"},{"term":"java"},{"term":"osx"},{"term":"spring"}],"title":{"type":"text","$t":"GavinTech"},"subtitle":{"type":"html","$t":""},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default?alt=json\u0026max-results=500"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"29"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"500"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-3667941402362734983"},"published":{"$t":"2015-09-09T10:15:00.001-07:00"},"updated":{"$t":"2015-09-09T10:15:30.026-07:00"},"title":{"type":"text","$t":"How efficient is Bitcoin's gossip protocol (part 1)?"},"content":{"type":"html","$t":"How much bandwidth do you need to run a fully validating node, both today and in the future?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe Bitcoin peer-to-peer network that broadcasts blocks and transactions is a \u003Cb\u003E\u003Ca href=\"https:\/\/en.wikipedia.org\/wiki\/Gossip_protocol\" target=\"_blank\"\u003Egossip network\u003C\/a\u003E:\u003C\/b\u003E\u0026nbsp;nodes are semi-randomly connected to each other, and information (transactions, blocks, IP or onion addresses of peers, and, very rarely, alert messages) is flooded across the network.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThere is a lot of academic research on \u003Ca href=\"https:\/\/scholar.google.com\/scholar?q=efficient+gossip+protocol\" target=\"_blank\"\u003Eefficient gossip network protocols\u003C\/a\u003E; for example, \"\u003Ca href=\"http:\/\/dl.acm.org\/citation.cfm?id=1810479.1810505\" target=\"_blank\"\u003EOn the bit communication complexity of randomized rumor spreading\u003C\/a\u003E\":\u003Cbr \/\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003EWe investigate the number of communication bits required for rumor spreading. On the lower-bound side, we establish that any address-oblivious algorithm taking O(lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E) rounds requires Ω(\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E\u0026nbsp;(\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003Eb\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E+ lg lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E)) communication bits to distribute a rumor of size\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003Eb\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E\u0026nbsp;bits. On the upper-bound side, we propose an address-oblivious algorithm that takes O(lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E) rounds and uses O(\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E(\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003Eb\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E+ lg lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E\u0026nbsp;lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003Eb\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E)) bits. These results show that, unlike the case for the message complexity, optimality in terms of both the running time and the bit communication complexity is attainable, except for very small rumor sizes\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003Eb\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E\u0026nbsp;\u0026lt;\u0026lt; lg lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E\u0026nbsp;lg lg lg\u0026nbsp;\u003C\/span\u003E\u003Ci style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003En\u003C\/i\u003E\u003Cspan style=\"background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;\"\u003E.\u003C\/span\u003E\u003C\/blockquote\u003E\nExecutive summary: gossip networks can scale up nicely with the number of peers in the network; in theory, each of the n peers in the network will receive all b bits in the messages, plus communication overhead that scales nicely. For example, a gossip network with 10,000 peers that is sending 500-byte messages, the theoretical upper bound on communication overhead for each message is lg lg 1000 * lg 500*8 or 18.4 bits... less than three bytes. \u0026nbsp;Scale up to a million peers and the overhead is 21.8 bits... still less than three bytes.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nEach peer will communicate 503 bytes of data to get a 500 byte message to everybody in the network.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThat's the theory, anyway... how efficient is the existing Bitcoin p2p protocol in practice?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI ran the reference implementation inside a virtual machine on the main network, and measured overall bandwidth usage (using 'iftop'). Preliminary results (I need to run longer tests, and make sure the numbers are repeatable -- \u003Ca href=\"mailto:gavinandresen@gmail.com\" target=\"_blank\"\u003Econtact me\u003C\/a\u003E if you'd like to help):\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNode with 1 outgoing connection:\u003Cbr \/\u003E\n11.1MB in 3567 seconds\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAverage block size over the last couple of days is close to 0.7MB, so in the hour I was running that test I'd expect about 4MB of transactions and blocks, or 8MB total. There's 50% unexplained overhead on top of the 100% overhead we get from transmitting transaction data twice.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNode with 8 outgoing connections:\u003Cbr \/\u003E\n28.8MB in 6392 seconds\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThat's not terrible, but not great-- eight times the number of connections meant about 50% more bandwidth use. If a simple flooding algorithm was being used (\"get data, send it to all of my peers\") the bandwidth usage would be seven times the 1-connection case. But a more efficient rumor-spreading protocol could drop that per-peer overhead down very close to zero.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt does mean the answer to \"how much bandwidth do you need to run a fully validating node with today's un-optimized p2p protocol\" is complicated; at current block sizes, if you're willing to run with -maxconnections=1 you can get away with less than 9GB per month.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI still need to test how much bandwidth is used by nodes that accept connections. The \u003Ca href=\"http:\/\/statoshi.info\/dashboard\/db\/bandwidth-usage\"\u003Estatoshi.info\u003C\/a\u003E\u0026nbsp;node, which is a long-running node with over 100 connections, is using something like 350GB per month, which is much more than I would expect-- maybe because it is a long-running node with fast connections it is relaying more data, or maybe it is serving a lot of historical block data to nodes that are catching up with the chain.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nMy testing TODO list (please contact me if you've already done, are are interested in doing, any of this):\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nRecord bytes-per-network-message statistics, to see where the bandwidth overhead is coming from (repeated 'inv' messages? 'addr' messages?)\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nRepeat the tests, running for longer and with 1\/8\/16\/32 outgoing connections.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nRepeat the tests with simulated transactions (maybe replayed-from-the-main-network transactions) and 8MB -regtest blocks. Or maybe just measure bandwidth usage of\u0026nbsp;https:\/\/blog.conformal.com\/btcsim-simulating-the-rise-of-bitcoin\/\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nRun a node with one connection to Matt's fast relay network and measure the bandwidth used to see how close it's algorithm gets to the theoretical limit.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/3667941402362734983\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/3667941402362734983","title":"1 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3667941402362734983"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3667941402362734983"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2015\/09\/how-efficient-is-bitcoins-gossip.html","title":"How efficient is Bitcoin's gossip protocol (part 1)?"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"1"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2583176136079994356"},"published":{"$t":"2015-04-22T07:23:00.000-07:00"},"updated":{"$t":"2015-04-22T07:23:03.601-07:00"},"title":{"type":"text","$t":"Joining the MIT Media Lab Digital Currency Initiative"},"content":{"type":"html","$t":"I'm pleased to announce that I’ve joined the MIT Media Lab’s newly launched \u003Ca href=\"https:\/\/medium.com\/@medialab\/launching-a-digital-currency-initiative-238fc678aba2\"\u003EDigital Currency Initiative\u003C\/a\u003E to continue my work on the Bitcoin project. I'm looking forward to working with all the amazing people associated with the initiative.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWladimir van der Laan and Cory Fields, both formerly of the Bitcoin Foundation, have also decided that MIT is the best place to continue their work on Bitcoin Core and have joined the Media Lab as well.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo, does this mean that MIT has taken over from the Foundation as the center for \"core development\"?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNo. The Bitcoin Foundation was never the center of development; the Bitcoin Core open-source software project has been the center, and like most open-source software projects, the developers who work on Bitcoin Core are supported in many different ways. Some work for companies that want to see Bitcoin succeed, some for nonprofits, and many are self-funded and self-motivated.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nDiversity in developer support is good because it means less disruption if support from any individual, company, or organization fails.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI'd like to thank everybody who reached out to me over the last couple of months as it became obvious that the Foundation wouldn't be able to raise the funds necessary to continue supporting Wladimir, Cory, and me.\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd I’d also like to thank \u003Ca href=\"https:\/\/twitter.com\/joi\"\u003EJoi Ito\u003C\/a\u003E and \u003Ca href=\"https:\/\/twitter.com\/brianforde\"\u003EBrian Forde\u003C\/a\u003E for their leadership and support of the Bitcoin community through this initiative. I know they have been working hard to reach out to a broad, global community of people who work on Bitcoin. Please feel free to reach out to Brian \u003Ca href=\"mailto:brianforde@mit.edu\"\u003Ebrianforde@mit.edu\u003C\/a\u003E if you’d like to get involved."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2583176136079994356\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2583176136079994356","title":"14 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2583176136079994356"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2583176136079994356"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2015\/04\/joining-mit-media-lab-digital-currency.html","title":"Joining the MIT Media Lab Digital Currency Initiative"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"14"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-4149210122106526943"},"published":{"$t":"2015-01-20T11:17:00.000-08:00"},"updated":{"$t":"2015-01-20T11:23:29.651-08:00"},"title":{"type":"text","$t":"Twenty Megabytes testing results"},"content":{"type":"html","$t":"\u003Cb\u003EExecutive summary\u003C\/b\u003E: if we increased the maximum block size to 20 megabytes tomorrow, \u003Cb\u003Eand\u003C\/b\u003E\u0026nbsp;every single miner decided to start creating 20MB blocks \u003Cb\u003Eand\u003C\/b\u003E\u0026nbsp;there was a sudden increase in the number of transactions on the network to fill up those blocks....\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n... the 0.10.0 version of the reference implementation would run just fine.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nYou can check my work and get the detailed blow-by-blow in my for-testing-only megablocks branch (see \u003Ca href=\"https:\/\/github.com\/gavinandresen\/bitcoin-git\/blob\/megablocks\/megablocks_notes.txt\" target=\"_blank\"\u003Emegablocks_notes.txt\u003C\/a\u003E).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nCPU and memory usage scaled up nicely, there were no surprises. Both CPU and memory usage for the 20MB blockchain were within my criteria of \"somebody running a decent personal computer on a pretty good home network connection should be able to run a full node.\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI did have a surprise syncing a 20-MB chain to a VPS (virtual private server): bigger blocks were four times faster than the small, main-chain blocks. I don't know why; it is possible something else was happening on the VPS machine to affect the results, or maybe disk I\/O is better with larger blocks.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESo what's next?\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNext we need a soft fork to deal with some longstanding technical debt related to the recent OpenSSL-was-willing-to-validate-too-much-stuff problem. Pieter Wuille and Gregory Maxwell have been working through that.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBut then we need a concrete proposal for exactly how to increase the size. Here's what I will propose:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Col\u003E\n\u003Cli\u003ECurrent rules if no consensus as measured by block.nVersion supermajority.\u003Cbr \/\u003ESupermajority defined as: 800 of last 1000 blocks have block.nVersion == 4\u003Cbr \/\u003EOnce supermajority attained, block.nVersion \u0026lt; 4 blocks rejected.\u003C\/li\u003E\n\u003Cli\u003EAfter consensus reached: replace MAX_BLOCK_SIZE with a size calculated based on starting at 2^24 bytes (~16.7MB) as of 1 Jan 2015 (block 336,861) and doubling every 6*24*365*2 blocks -- about 40% year-on-year growth. Stopping after 10 doublings.\u003C\/li\u003E\n\u003Cli\u003EThe perfect exponential function:\u003Cbr \/\u003Esize = 2^24 * 2^((blocknumber-336,861)\/(6*24*365*2))\u003Cbr \/\u003E... is approximated using 64-bit-integer math as follows:\u003Cbr \/\u003E\u003Cbr \/\u003E\u003Cspan style=\"font-family: Courier New, Courier, monospace;\"\u003Edouble_epoch = 6*24*365*2 = 105120\u003Cbr \/\u003E(doublings, remainder) = divmod(blocknumber-336861, double_epoch)\u003Cbr \/\u003Eif doublings \u0026gt;= 10 : (doublings, remainder) = (10, 0)\u003Cbr \/\u003Einterpolate = floor ((2^24 \u0026lt;\u0026lt; doublings) * remainder \/ double_epoch)\u003Cbr \/\u003Emax_block_size = (2^24 \u0026lt;\u0026lt; doublings) + interpolate\u003C\/span\u003E\u003Cbr \/\u003EThis is a piecewise linear interpolation between doublings, with maximum allowed size increasing a little bit every block.\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Cbr \/\u003E\nI created \u003Ca href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1CuOEM9uwO5w-RwWGCCZpVGVFwhHHHegxJZqTP5KyapI\/edit?usp=sharing\" target=\"_blank\"\u003Ea spreadsheet and graph\u003C\/a\u003E of how the maximum size would grow over time.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EBut... but... WRECK! RUIN! MADNESS!\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI'm confident that there are no technical barriers to scaling up-- I've shown that our current code can handle much larger blocks, and assuming that progress in electronics and networking doesn't come to a sudden screeching stop, that our current code running on tomorrow's hardware would be able to handle the growth I'm proposing.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOf course, we won't be running current code on tomorrow's hardware; we'll be running better code. CPU usage should go down by a factor of about eight in the next release when we switch to Pieter's libsecp256k1 library for validating transactions. Network usage should get cut in half as soon as we stop doing the simplest thing and re-broadcasting transactions twice. And I'm sure all the smart engineers working on Bitcoin and Bitcoin-related projects will find all sorts of ways to optimize the software.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd yes, that includes making the initial block downloading process take minutes instead of days.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo that leaves economic arguments-- most of which I think I addressed in my \u003Ca href=\"https:\/\/blog.bitcoinfoundation.org\/blocksize-economics\/\" target=\"_blank\"\u003EBlocksize Economics\u003C\/a\u003E post.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI'll try to restate a point from that post that it seems some people are missing: you can't maximize the total price paid for something by simply limiting the supply of that something, \u003Cb\u003Eespecially if there are substitute goods available to which people can switch.\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\nPeople want to maximize the price paid to miners as fees when the block reward drops to zero-- or, at least, have some assurance that there is enough diverse mining to protect the chain against potential attackers.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd people believe the way to accomplish that is to artificially limit the number of transactions below the technical capabilities of the network.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBut \u003Ca href=\"http:\/\/en.wikipedia.org\/wiki\/Production_quota\" target=\"_blank\"\u003Eproduction quotas\u003C\/a\u003E don't work. Limit the number of transactions that can happen on the Bitcoin blockchain, and instead of paying higher fees people will perform their transactions somewhere else. I have no idea whether that would be Western Union, an alt-coin, a sidechain, or good old fashioned SWIFT wire transfers, but I do know that nobody besides a central government can force people to use product with higher costs, if there is a lower-cost option available.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo how will blockchain security get paid for in the future?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI honestly don't know. I think it is \u003Ci\u003Epossible\u003C\/i\u003E\u0026nbsp;blocks containing tens of thousands of transactions, each paying a few millibits in fees (maybe because wallets round up change amounts to avoid creating dust and improve privacy) will be enough to secure the chain.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt is also \u003Ci\u003Epossible\u003C\/i\u003E\u0026nbsp;big merchants and exchanges, who have a collective interest in a secure, well-functioning blockchain, will get together and establish assurance contracts to reward honest miners.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI'm confident that if the Bitcoin system is valuable, then the participants in that market will make sure it keeps functioning securely and reliably.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd I'm very confident that the best way to make Bitcoin more valuable is to make it work well for both large and small value transactions.\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/4149210122106526943\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/4149210122106526943","title":"24 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/4149210122106526943"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/4149210122106526943"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2015\/01\/twenty-megabytes-testing-results.html","title":"Twenty Megabytes testing results"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"24"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-8627149519248693301"},"published":{"$t":"2015-01-06T10:55:00.000-08:00"},"updated":{"$t":"2015-01-06T10:57:37.727-08:00"},"title":{"type":"text","$t":"Looking before the Scaling Up Leap"},"content":{"type":"html","$t":"I've been busy the last few weeks filling up my hard disk with copies of the main Bitcoin blockchain.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nMy goal is to prove that it is safe to raise the maximum block size from 1MB to at least 20MB, with the existing Bitcoin Core code (no fancy invertible bloom filters, no hyper-optimized-for-the Bitcoin-elliptic-curve verification code).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIf the existing code can handle 20 megabyte blocks, then I'll argue we should schedule a hard fork to raise the block size. Ideally, we would never run into the maximum block size limit -- we would always have a situation like we do today, where miners decide how large or small to make their blocks, and people using the blockchain decide whether they're willing to pay miners transaction fees to include their transactions.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo I've been testing the existing code with much larger blocks -- 20MB and 200MB.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI could create artificial tests that fill up blocks with randomly generated transactions, but it would be much better to test with real-world transactions packaged into bigger blocks. I'm running a couple of full Bitcoin nodes, so I have 20 or so gigabytes of real-world transactions.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI just had to figure out how to repackage them into bigger blocks. After a couple of false starts over a couple of frustrating days (wouldn't it be nice if our ideas always worked perfectly the first time?), I came up with the following scheme:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nFirst, I hacked the reference implementation and changed some constants related to the block size (MAX_BLOCK_SIZE, DEFAULT_BLOCK_MAX_SIZE, MAX_BLOCKFILE_SIZE). That part is easy.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe tricky bit is how to take transactions from the 1-MB and repackage them in bigger blocks. For most transactions, it is trivial, because ordinary transactions don't care what block they are in.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThere are two exceptions:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n1. Transactions that use the 'locktime' feature so they are not valid until a particular block height or date. I dealt with these by simply treating all transactions as 'final'.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n2. There are special rules for 'coinbase' transactions: there can be only one coinbase transaction per block, it must be the first transaction, etc. My first couple of false starts went down the path of relaxing those rules, but I gave up that approach because I found myself changing more and more code. I think if I was 22 years old I probably would have just forged ahead, unwilling to let go of a couple of days of programming effort because \"just one more change and it will probably all start to work...\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI wonder if old programmers throw away more code than young programmers. I bet we do.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnyway, after a rethink I came up with a much cleaner solution for handling coinbase transactions from the real blockchain: I write them to a 'coinbasetx.dat' file which the hacked bitcoind reads at startup and stores in memory (there are only 73 megabytes of them). As blocks are added to the big-block chain, those coinbases are added to the \"unspent transaction output set\" so they are available to be spent (and I set the COINBASE_MATURITY constant to zero instead of 100, so they can be spent right away, in the same big block).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI wrote a tool (\"gen_megablocks\") that creates the coinbasetx.dat file and blk*.dat files that are valid-but-oversized, -regtest-mode blocks.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThose big blocks are then loaded into the bigger-block-capable bitcoind using the -loadblock command-line option, where they go through full transaction and block validation and indexing.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe end result is a fully-indexed blockchain with real transactions arranged into much larger blocks. I can import some of my main-chain wallet private keys and create transactions that spend them; those transactions are valid on both the hacked big-block chain and the main Bitcoin 1-MB blockchain (because ordinary transactions are completely independent of blocks).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo far, the results are very good-- the time to process a block scales up linearly with the size of the block, there are no hidden O(n^2) gotchas waiting to bite us. My desktop machine (a quad-core, 16GB-memory, \"Late 2012\" iMac) can easily keep up with a 20-MB-per-block blockchain, and could even keep up with a 200-MB-per-block chain if run with bigger -maxsigcachesize and -dbcache settings.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nToday I'm generating alternate chains (I added an option to gen_megablocks to skip one or more transactions and their descendants); I'll be testing long and short blockchain re-orgs, measuring CPU time and memory usage. Once that is done I'll try syncing these 'megablock' chains across the internet and will measure real-world network bandwidth usage and time. And along the way I'll import a few keys and make sure the Bitcoin-Qt wallet works properly with big blocks (it should, it doesn't contain any code that cares about the block size).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOnce all that is done, I will write up the results, write up a detailed specification for increasing the block size, and will start working on a patch (and lots more tests) to make it happen.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd I'm bracing myself for \u0026nbsp;endless re-hashing of arguments about why a maximum block size tied to transaction volume or difficulty or exchange rate or total transaction fees or the phase of the moon would be better than some dumb, predictable formula....\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/8627149519248693301\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/8627149519248693301","title":"56 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8627149519248693301"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8627149519248693301"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2015\/01\/looking-before-scaling-up-leap.html","title":"Looking before the Scaling Up Leap"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"56"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-1331391053589111447"},"published":{"$t":"2014-06-09T08:07:00.000-07:00"},"updated":{"$t":"2014-06-11T07:12:26.194-07:00"},"title":{"type":"text","$t":"Bit-thereum"},"content":{"type":"html","$t":"I've been thinking about \u003Ca href=\"https:\/\/ethereum.org\/\" target=\"_blank\"\u003Eethereum\u003C\/a\u003E a bit recently. Parts of it are pretty interesting.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSome of it seems like needless re-engineering (like creating a new proof-of-work or a new currency). And in general, I suspect they're trying to do too much-- \"complexity is the enemy of security\"-- and will end up either radically reducing the scope of what they're trying to do or will get tired of playing whack-a-mole with security and DoS vulnerabilities.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBut I might be wrong; maybe I'm just an old, cynical curmudgeon who has played a lot of whack-a-mole with security and DoS vulnerabilities.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnyway, one of the ideas in ethereum I \u003Cb\u003Edo\u003C\/b\u003E\u0026nbsp;find interesting is a contract that has funds associated with it, arbitrary code and state. Verified by the network instead of a central authority. And with transactions as a pseudo-anonymous way of triggering evaluation of the contract, paying funds held in escrow with the contract, and updating its state.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo... could we take that interesting idea and map it onto Bitcoin? Could somebody create \"Bit-thereum\" on top of Bitcoin as it exists today?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe answer is \"yes,\" if we're willing to replace \"verified by the entire network\" with \"verified by a set of semi-trusted 'oracles'.\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThat's cheating, though, isn't it? We're not entirely decentralized if we are trusting eleven contract-verifying-services not to collude (or all get hacked) to violate conditions encoded in some contract(s).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt \u003Cb\u003Eis\u003C\/b\u003E cheating a bit... but all of the really interesting complex contracts I can think of require data from outside the blockchain. Like the BTC\/USD exchange rate on some future date (for blockchain-enforced futures contracts).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"font-family: inherit;\"\u003Eethereum doesn't have some magic solution to the \"data outside the blockchain\" issue: as their whitepaper says,\u0026nbsp;\"\u003Cspan style=\"background-color: white; color: #333333; font-size: 15px; line-height: 25.5px;\"\u003E\u003Ca href=\"https:\/\/github.com\/ethereum\/wiki\/wiki\/%5BEnglish%5D-White-Paper#financial-derivatives-and-stable-value-currencies\" target=\"_blank\"\u003Ea trusted source is still needed to provide the price ticker\u003C\/a\u003E.\" \u0026nbsp;And\u0026nbsp;\u003C\/span\u003Ethere is already at least one startup working on a solution to the \"data outside the Bitcoin blockchain\" problem (\u003Ca href=\"https:\/\/www.realitykeys.com\/\" target=\"_blank\"\u003EReality Keys\u003C\/a\u003E).\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nMoving from one trusted source to M-of-N semi-trusted sources would be an improvement.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo I'll start there, and imagine that there are semi-trusted '\u003Ca href=\"https:\/\/bitcointalk.org\/index.php?topic=8821.msg133604#msg133604\" target=\"_blank\"\u003Eoracles\u003C\/a\u003E' that compete to be the most reliable and trustworthy verifiers of contracts. People involved in contracts choose N of them, and then require that contract conditions be validated by one or more of them before the contract pays out. Pick more than one so no single oracle can steal the contract's funds, but less than N in case some of them go out of business or just aren't around to validate contracts when it is time for the contract to pay out.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThese oracles need an agreed-upon, machine-readable contract language, but that shouldn't be hard. There are lots of interesting design decisions on what information contract scripts have access to (and lots of not-so-interesting-to-me design decisions on the language itself; is it stack-based, register-based, high-level, low-level bytecode, etc etc etc). Copying most of the ethereum contract language design (and maybe re-using lots of their code) might be a good way to go.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nMaybe off-blockchain data would fetched from the web via URI. The tricky bit would be how to handle error conditions like \"This contract is about average temperature in Aruba according to the World Bank, but the World Bank is no longer publishing that information.\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThey also need a way to store some value in escrow, associated with the contract, so that M-of-N of them must agree to any release of funds. Bitcoin multi-signature transactions could be used for that:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n1. Whoever is involved in the contract gives the contract code to each of the N oracles and gets back N public keys.\u003Cbr \/\u003E\n2. The oracles would store the contract code and the private key, and should be willing to give out the public key to anybody who knows the contract code.\u003Cbr \/\u003E\n3. Anybody can then add funds to the contract by sending bitcoins into the M-of-N multisig made up of the public keys. And maybe associate some data with the escrowed funds by hashing it and include a prune-able OP_RETURN output with the hash.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo far, nothing tricky either on the Bitcoin side or the oracle's side. But what happens when it is time for the oracles to evaluate the contract and disburse some or all of the funds? What triggers the oracles to evaluate the contract (and update any state associated with the contract), and who creates and broadcasts the disburse-funds-from-escrow transaction?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThose are interesting design decisions. I'd probably have whoever is getting paid be responsible for creating the disbursement transaction, contacting M of N oracles to get signatures and then broadcast the transaction. When I say \"whoever\" I really mean some contract software running either in the cloud or on somebody's machine.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWhen to update the state associated with a contract is another interesting design decision. My intuition is a contract's state should be tied to Bitcoin transaction confirmations and the state of the transaction outputs being spent. So a contract could be in several states at once if one or more of its inputs are double-spends. Once blockchain confirmations choose one side of the double-spend or another the state of the contract would also be resolved.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI imagine the contract code would have access to all of the unspent transaction outputs (and associated OP_RETURN data, plus metadata like how many confirmations they have, which block they appeared in, maybe their merkle branch...) plus the disbursement transaction outputs. Another interesting design decision is how to handle unconfirmed transaction outputs; I suspect that letting contracts respend zero-confirmation outputs, combined with a promise from the oracles that they will never sign the same output twice might be incredibly powerful and allow all sorts of interesting applications.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOracles could be vulnerable to denial-of-service attacks-- e.g. an attacker requesting an endless number of public keys for contracts they have no intention of fulfilling. Or an attacker requesting an endless number of contract evaluations (and signatures).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nTo solve the first problem, oracles could require a small up-front payment to establish a contract. And to solve the second, oracles could require that any escrow disbursement also include a small payment (they would simply refuse to sign any escrow disbursement transaction that did not include a payment to their public key). All that makes economic sense, and gives oracle operators a clear business model.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nLeveraging Bitcoin transactions for the escrow\/funding parts of the problem protects oracles from a whole other set of possible denial-of-service attacks; for example, \"penny-flooding\" a contract to make it very CPU-expensive for the oracle to evaluate would cost the attacker a significant amount of Bitcoin transaction fees.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOracles might also put limits in their terms of service to fend off potential attackers, and collaborate to confiscate escrowed funds if an attacker created a very expensive-to-validate contract.: \"Any contract that uses more than one CPU-microsecond to validate may be terminated with the funds disbursed in equal amounts to the N validating oracles.\" \u0026nbsp;They would maintain their reputations by publishing all of the information about the rogue contract.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBut... but... doesn't it have to be more complicated than that? New Bitcoin Script opcodes? Contract code in the blockchain? A merged-mined chain or new colored coin or something?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI don't think so. Bitcoin already provides a global currency and distributed ledger-- there is no need to re-invent those wheels. Combining real-world information with Bitcoin is where things start to get really interesting.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Chr \/\u003E\n\u003Cb\u003EUpdate 11 June 2014:\u003C\/b\u003E\u003Cbr \/\u003E\n\u003Cb\u003E\u003Cbr \/\u003E\u003C\/b\u003E\nI love it when I spout off some half-baked idea and then somebody points to some project that is already doing it. So go check out \u003Ca href=\"https:\/\/github.com\/orisi\/wiki\/wiki\/Orisi-White-Paper\" target=\"_blank\"\u003EOrisi\u003C\/a\u003E, which was made public just a few hours before this blog post.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nAnd I'm not being sarcastic when I say I love it when that happens; it is what makes the Internet such a profound accelerator of innovation.\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/1331391053589111447\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/1331391053589111447","title":"25 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1331391053589111447"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1331391053589111447"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2014\/06\/bit-thereum.html","title":"Bit-thereum"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"25"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2972544328973079659"},"published":{"$t":"2014-03-21T10:24:00.001-07:00"},"updated":{"$t":"2014-03-21T10:29:44.456-07:00"},"title":{"type":"text","$t":"It ain't me! I've got a PGP imposter"},"content":{"type":"html","$t":"Somebody decided it would be fun to upload a couple of 'gavinandresen@gmail.com' PGP keys to the PGP key servers.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWhy? Who knows-- \"because they can\" maybe.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI use my PGP keys to sign Bitcoin git release tags, and to sign the \"SHASUMS.asc\" file that lets you verify the integrity of the Bitcoin binaries that you download, so it is possible they are planning some sort of phishing attack to try to get people to download and run (or compile and run) a malware-infested version of Bitcoin.\n\nOr maybe they will try to send email claiming to be from me, signed with one of the bad keys. That would \u003Ca href=\"http:\/\/www.gaudior.net\/alma\/johnny.pdf\"\u003Efool most PGP users\u003C\/a\u003E.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo: the bad, evil, bogus, no-good keys are these ones (strikethrough on purpose here, so nobody glances at this page and things these are the correct keys):\n\u003Cbr \/\u003E\n\u003Cblockquote\u003E\n\u003Cpre\u003E\u003Cstrike\u003Epub 1024R\/1F281E36 2014-01-01 Gavin Andresen (CODE SIGNING KEY) \u003Cgavinandresen gmail.com=\"\"\u003E\npub 1024R\/03DDF953 2014-01-01 Gavin Andresen \u003Cgavinandresen gmail.com=\"\"\u003E\u003C\/gavinandresen\u003E\u003C\/gavinandresen\u003E\u003C\/strike\u003E\n\u003C\/pre\u003E\n\u003C\/blockquote\u003E\nMy real keys (and their signing subkeys) are:\n\u003Cbr \/\u003E\n\u003Cblockquote\u003E\n\u003Cpre\u003Esec 4096R\/1FC730C1 2011-12-15\n Key fingerprint = 2664 6D99 CBAE C9B8 1982 EF60 29D9 EE6B 1FC7 30C1\nuid Gavin Andresen (CODE SIGNING KEY) \u003Cgavinandresen gmail.com=\"\"\u003E\nssb 4096R\/8E30B3ED 2011-12-15\n\nsec 1024D\/BE38D3A8 2010-10-18 [expires: 2035-10-12]\n Key fingerprint = 01CD F462 7A3B 88AA E4A5 71C8 7588 242F BE38 D3A8\nuid Gavin Andresen \u003Cgavinandresen gmail.com=\"\"\u003E\nssb 2048g\/60CB2496 2010-10-18\n\u003C\/gavinandresen\u003E\u003C\/gavinandresen\u003E\u003C\/pre\u003E\n\u003C\/blockquote\u003E\nBut you shouldn't trust this blog post \/ web page alone-- it \u003Ci\u003Ecould\u003C\/i\u003E have been compromised. You can get my PGP key from \u003Ca href=\"https:\/\/bitcoin.org\/gavinandresen.asc\"\u003Ehttps:\/\/bitcoin.org\/gavinandresen.asc\u003C\/a\u003E and from \u003Ca href=\"https:\/\/github.com\/bitcoin\/bitcoin.org\/commits\/master\/gavinandresen.asc\"\u003Ehttps:\/\/github.com\/bitcoin\/bitcoin.org\/commits\/master\/gavinandresen.asc\u003C\/a\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2972544328973079659\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2972544328973079659","title":"8 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2972544328973079659"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2972544328973079659"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2014\/03\/it-aint-me-ive-got-pgp-imposter.html","title":"It ain't me! I've got a PGP imposter"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"8"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-5882017564551506497"},"published":{"$t":"2014-02-01T11:18:00.001-08:00"},"updated":{"$t":"2014-02-01T11:26:39.985-08:00"},"title":{"type":"text","$t":"Gitian-building Bitcoin releases"},"content":{"type":"html","$t":"\u003Ch2\u003E\nDeterministically building Bitcoin Core on OSX\u003C\/h2\u003E\nThe 0.9 release upgrades dependencies and the deterministic build environment, so I had to setup new VirtualBox VMs to get \"gitian builds\" working.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThis describe EXACTLY the steps I took to deterministically build Bitcoin on my Mac OSX version 10.8.5 system. Commands typed on my mac are in green; commands typed when logged into the virtual machine are in blue.\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nStarting with:\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nMac with the Developer Tools and MacPorts installed. git clone bitcoin and gitian-builder.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cdiv\u003E\n\u003Cdiv\u003E\n(TODO: links to all of that)\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Ch2\u003E\nOne-time setup: VirtualBox\u003C\/h2\u003E\nDownload, install then run VirtualBox from ...\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSanity check: is the \"VBoxManage\" command-line VirtualBox tool in your PATH?\u003C\/div\u003E\n\u003Cpre\u003E\u003Cspan style=\"background-color: #93c47d;\"\u003Ewhich VBoxManage\u003C\/span\u003E\n\u003Cspan style=\"background-color: #d9ead3;\"\u003E \/usr\/bin\/VBoxManage\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003Cdiv\u003E\n\u003Ch2\u003E\nOne-time setup: Create two virtual machines\u003C\/h2\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\nDownload Ubuntu 12.04.3 \"Server Install CD\" .iso files from\u0026nbsp;http:\/\/releases.ubuntu.com\/precise\/. You need both i386 and amd64 variations of the Ubuntu \"precise\" release because it says so at the top of the descriptor .yml files in the Bitcoin source tree:\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\u003Cpre\u003Ename: \"boost\"\nsuites:\n- \"precise\"\narchitectures:\n- \"i386\"\n- \"amd64\"\n\u003C\/pre\u003E\n\u003C\/blockquote\u003E\n\u003Cdiv\u003E\nThe next step is to create two virtual machines in VirtualBox from the two downloaded .iso files:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Col\u003E\n\u003Cli\u003EPoke the New button to create a new virtual machine\u003C\/li\u003E\n\u003Cli\u003EName: Gitian-precise-i386\u003Cbr \/\u003EType: Linux\u003Cbr \/\u003EVersion: Ubuntu\u003Cbr \/\u003E... and press Continue. The name is important! It must be Gitian-{suite}-{architecture} for gitian builder to work.\u003C\/li\u003E\n\u003Cli\u003EMemory Size: \u0026nbsp;6000 MB (6 gigabytes). Less probably works.\u003Cbr \/\u003E... and press Continue\u003C\/li\u003E\n\u003Cli\u003ECheck create a virtual hard drive now, press Create\u003C\/li\u003E\n\u003Cli\u003ECheck VDI (VirtualBox Disk Image)\u003C\/li\u003E\n\u003Cli\u003ECheck Dynamically Allocated\u003C\/li\u003E\n\u003Cli\u003ESelect 20.00 GB for the size\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Cdiv\u003E\nAt this point you should have a Powered Off Gitian-precise-i386 Virtual machine. Before starting it, you might want to play with VM settings using the VirtualBox Machine-\u0026gt;Settings dialog box (for example, if you are running on a multi-CPU system your builds will be quicker if you make the virtual machine multi-cpu, also).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBefore powering it on, use VBoxManage to setup an ssh tunnel on port 2223:\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: #93c47d;\"\u003EVBoxManage modifyvm Gitian-precise-i386 --natpf1 \"guestssh,tcp,,2223,,22\"\u003C\/span\u003E\u003C\/div\u003E\n\u003Cbr \/\u003E\nThe gitian-builder scripts use VBoxManage and ssh to control the virtual machine.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\nTime to power up the VM! \u0026nbsp;Poke the Start button in VirtualBox, and you'll immediately get: \"Please select a virtual optical disk file.\" \u0026nbsp;Select the folder icon, and then browse to the ubuntu-12.04.3-server-i386.iso file.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe virtual machine will now go through the Ubuntu installation process. \u0026nbsp;Select your language, keyboard layout, hostname (I decided \"gitian32\" was a good name), login user (ubuntu), password (I used ubuntu for that, too, and told the installer it was OK to use an insecure password), do not encrypt home directory. \u0026nbsp;Then did Guided - use entire disk \u0026nbsp;partitioning setup and let the installer use the whole 8GB virtual machine disk. No HTTP proxy. No automatic updates. The only software that needs to be installed: OpenSSH server. \u0026nbsp;Then let it install the grub boot loader into the VM's disk, reboot, and you should get a login: prompt.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nLogin with the username and password you chose during setup (ubuntu\/ubuntu for me), and catch up with any updates by running:\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #6fa8dc;\"\u003Esudo apt-get update \u0026amp;\u0026amp; sudo apt-get upgrade\n\u0026nbsp; \u0026nbsp;...enter password for ubuntu account so 'sudo' is happy (\"ubuntu\")..\n\u003C\/pre\u003E\n\u003Cbr \/\u003E\nThe next step is creating an ssh key that gitian-builder will use to login to the virtual machine. On your Mac or Linux machine, run:\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #93c47d;\"\u003Ecd gitian-builder\nssh-keygen -t dsa -f var\/id_dsa -N \"\"\nssh -p 2223 -oNoHostAuthenticationForLocalhost=yes ubuntu@localhost 'mkdir -p .ssh \u0026amp;\u0026amp; chmod 700 .ssh \u0026amp;\u0026amp; cat \u0026gt;\u0026gt; .ssh\/authorized_keys' \u0026lt; var\/id_dsa.pub\n\u003C\/pre\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\nEnter the password for the ubuntu account on the VM when prompted (\"ubuntu\" if you were lazy like me).\u003C\/div\u003E\n\u003Cbr \/\u003E\nA couple more things to set up on the VM (allow ssh login to the root account, and install packages needed to build), so log in:\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #93c47d;\"\u003Essh -p 2223 -i var\/id_dsa -oNoHostAuthenticationForLocalhost=yes ubuntu@localhost\n\u003C\/pre\u003E\n\u003Cbr \/\u003E\nThis time you should NOT get prompted for the password. Then run:\n\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #6fa8dc;\"\u003Esudo mkdir -p \/root\/.ssh \u0026amp;\u0026amp; sudo chmod 700 \/root\/.ssh \u0026amp;\u0026amp; sudo cp .ssh\/authorized_keys \/root\/.ssh\/\n\u0026nbsp; \u0026nbsp;...enter password for ubuntu account so 'sudo' is happy (\"ubuntu\")...\u003C\/pre\u003E\n\u003Cpre style=\"background-color: #6fa8dc;\"\u003Esudo apt-get install\u0026nbsp;autoconf2.13 automake build-essential bsdmainutils faketime g++ g++-mingw-w64 git-core libqt4-dev libtool libz-dev mingw-w64 nsis pciutils pkg-config psmisc subversion unzip zip\n\u003C\/pre\u003E\n\u003Cpre style=\"background-color: #6fa8dc;\"\u003Eexit\n\u003C\/pre\u003E\n\u003Cbr \/\u003E\nLast step: \u0026nbsp;Snapshot the VM's state with the name: \u003Cb\u003EGitian-Clean\u003C\/b\u003E\u003Cbr \/\u003E\nThe name is important; the build process restores the virtual machine to that snapshot before performing a build, so it starts with a new build environment every time.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOne last sanity check; make sure the low-level gitian-builder commands work properly on the host (your Mac or Linux box) system. Shut down the VM, then run:\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #93c47d;\"\u003Eexport USE_VBOX=1\nPATH=$PATH:$(pwd)\/libexec \u0026nbsp;# assuming you're still cd'ed into gitian-builder\nmake-clean-vm --suite precise --arch i386\nstart-target 32 precise-i386\non-target ls -la\nstop-target\n\u003C\/pre\u003E\n\u003Cbr \/\u003E\nIf you get no errors, congratulations! The virtual machine is set up and ready to build.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNow do the whole process again, but with amd64 instead of i386.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWhen you're done, you should have a \"Gitian-precise-i386\" and \"Gitian-precise-amd64\" virtual machines, both in the powered off state.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\nBuilding dependencies\u003C\/h2\u003E\nHere's how I built the boost-linux dependency. \u0026nbsp;We need to download dependencies (using wget or curl or your web browser), put them in gitian-builder\/inputs, run gbuild, then copy the results into the inputs\/ directory to be used for further builds:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cpre style=\"background-color: #93c47d;\"\u003Ecd inputs # assuming you're still cd'ed into gitian-builder\nwget 'http:\/\/downloads.sourceforge.net\/project\/boost\/boost\/1.55.0\/boost_1_55_0.tar.bz2'\ncd ..\nexport USE_VBOX=1\n# MAC ONLY: get MacPorts sha256sum in PATH:\nexport PATH=$PATH:\/opt\/local\/libexec\/gnubin\nbin\/gbuild --commit bitcoin=HEAD\u0026nbsp;..\/bitcoin\/contrib\/gitian-descriptors\/boost-linux.yml\n\u003C\/pre\u003E\n\u003Cpre style=\"background-color: #6fa8dc;\"\u003Emv build\/out\/* inputs\/\u003C\/pre\u003E\n\u003Cbr \/\u003E\nHere is the output from a successful build of boost-linux.yml on my machine:\n\u003Cbr \/\u003E\n\u003Cpre\u003E************* WARNING: kvm not loaded, this will probably not work out\n\n--- Building for precise i386 ---\nStopping target if it is up\nMaking a new image copy\nRestoring snapshot 3a0ad094-8853-499c-84c9-72ab0d8d2ed6\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nStarting target\nChecking if target is upWaiting for VM \"Gitian-precise-i386\" to power on...\nVM \"Gitian-precise-i386\" has been successfully started.\n.\nPreparing build environment\nboost_1_55_0.tar.bz2 100% 55MB 55.5MB\/s 00:01\nUpdating apt-get repository (log in var\/install.log)\nInstalling additional packages (log in var\/install.log)\nGrabbing package manifest\nCreating build script (var\/build-script)\nRunning build script (log in var\/build.log)\nGrabbing results\nboost-linux32-1.55.0-gitian-r1.zip 100% 21MB 20.5MB\/s 00:01\n--- Building for precise amd64 ---\nStopping target if it is up\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nMaking a new image copy\nRestoring snapshot 7024b172-e5b0-4469-b754-25add66398a0\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nStarting target\nChecking if target is upWaiting for VM \"Gitian-precise-amd64\" to power on...\nVM \"Gitian-precise-amd64\" has been successfully started.\n.\nPreparing build environment\nboost_1_55_0.tar.bz2 100% 55MB 55.5MB\/s 00:01\nUpdating apt-get repository (log in var\/install.log)\nInstalling additional packages (log in var\/install.log)\nGrabbing package manifest\nCreating build script (var\/build-script)\nRunning build script (log in var\/build.log)\nGrabbing results\nboost-linux64-1.55.0-gitian-r1.zip 100% 21MB 20.9MB\/s 00:01\nGenerating report\nbb5611a3e3cf3367503805e929171b988c8a9f21103804f7236f4e8ff147cd6f boost-linux32-1.55.0-gitian-r1.zip\nee5f901cb9649c89183d71776944cf21eb46a4fbbe416aed3d0bf09ca92616a0 boost-linux64-1.55.0-gitian-r1.zip\n272c3b6e41006f9205fc6db148028b9c976664826432b586f7e7070070e0cdef boost-res.yml\nDone.\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\nIf you can build boost-linux, you're mostly done! \u0026nbsp;Follow the instructions in the Bitcoin source tree (doc\/release-process.md) to build the rest of the dependencies.\u003Cbr \/\u003E\n\u003Ch2\u003E\nDependencies done: build Bitcoin!\u003C\/h2\u003E\n\u003Cdiv\u003E\nOnce all the dependencies are built and their results are in gitian-builder\/inputs,\u0026nbsp;\u003C\/div\u003E\n\u003Ch2\u003E\nDebugging techniques\u003C\/h2\u003E\nYou can check on the progress of a build while it is happening by looking at the gitian-builder\/var\/{build,install}.log files (e.g. 'tail -f var\/build.log' during build phase will show you exactly what is happening on the virtual machine).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nYou can also login to the virtual machine while gbuild is running, or, if it fails, after it fails. The reason it failed is usually obvious by looking at the end of build.log.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/5882017564551506497\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/5882017564551506497","title":"3 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/5882017564551506497"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/5882017564551506497"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2014\/02\/gitian-building-bitcoin-releases.html","title":"Gitian-building Bitcoin releases"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"3"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2494232239993875251"},"published":{"$t":"2013-10-03T19:22:00.000-07:00"},"updated":{"$t":"2013-10-03T19:24:18.337-07:00"},"title":{"type":"text","$t":"Responsible disclosure. And email spam."},"content":{"type":"html","$t":"\u003Ca href=\"http:\/\/bitcoin.org\/en\/development\" target=\"_blank\"\u003EThe \"development\" page\u003C\/a\u003E\u0026nbsp;at bitcoin.org got a section on Responsible Disclosure of security vulnerabilities a few months ago.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSo, of course, the email address that is used to report vulnerabilities has been getting more spam these days. Not a big deal, it just means two minutes of work once a week to make sure there are no real reports and delete the 5-10 spam messages.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOne spam message caught my eye today, just because a security researcher just might start their email with \"I have reviewed your website\":\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\nFrom:\u0026nbsp;\"Paul\"\u0026nbsp;\u003Cpaulwilsire gmail.com=\"\"\u003E\u003Cspan style=\"background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;\"\u003E\u0026nbsp;\u003Cpaulwilsire gmail.com=\"\"\u003E\u003C\/paulwilsire\u003E\u003C\/span\u003E\u003Cspan style=\"background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;\"\u003E\u0026nbsp;\u0026lt;PaulWilsire@gmail.com\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003ETo:\u0026nbsp;\"Bitcoin-security\" \u003Cbitcoin-security lists.sourceforge.net=\"\"\u003E\u003Cbr \/\u003EDate:\u0026nbsp;Wed, 2 Oct 2013 14:32:55 +0100\u003Cbr \/\u003ESubject:\u0026nbsp;[SPAM] Website Evaluation\u0026nbsp;\u003C\/bitcoin-security\u003E\u003C\/paulwilsire\u003E\u003C\/blockquote\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\u003Cdiv\u003E\n\u0026nbsp;I've reviewed your website and would love to setup some time to go through my findings with you (no cost). You could be ranked considerably higher in the search engines for the keywords that matter to your business.\u003Cbr \/\u003E\n\u003Cdiv style=\"direction: ltr;\"\u003E\n\u003Cdiv style=\"background-color: white; color: #222222; font-family: Calibri; font-size: 11pt; margin: 0in;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"background-color: white; color: #222222; font-family: Calibri; font-size: 11pt; margin: 0in;\"\u003E\nI found errors in your websites code (on-site optimization) as well as a lack of substantial, quality backlinks (links pointing to your website from sources with authority). These two primary issues are holding you back from the top spots in Google that your competition is currently holding.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/blockquote\u003E\nPaul Wilsire is a big fat liar-- there is no way he reviewed our website. Google \"bitcoin\" and the first result is Wikipedia. The second is bitcoin.org.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIf you're thinking of hiring somebody to do search engine optimization for you, then google their name, and see how well they've done SEO'ing themselves. \"\u003Ca href=\"https:\/\/www.google.com.au\/search?q=paul+wilsire\" target=\"_blank\"\u003EPaul Wilsire\u003C\/a\u003E\" doesn't seem to exist, according to Mr. Google...."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2494232239993875251\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2494232239993875251","title":"1 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2494232239993875251"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2494232239993875251"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2013\/10\/responsible-disclosure-and-email-spam.html","title":"Responsible disclosure. And email spam."}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"1"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2400834077022178077"},"published":{"$t":"2013-08-18T17:44:00.000-07:00"},"updated":{"$t":"2013-08-18T17:44:18.330-07:00"},"title":{"type":"text","$t":"The macro-economics of alt-coins"},"content":{"type":"html","$t":"Besides urging people to \"\u003Ca href=\"https:\/\/bitcointalk.org\/index.php?topic=42465.0\" target=\"_blank\"\u003Ebe safe\u003C\/a\u003E,\" I've been pretty quiet about all of the various Bitcoin variants that have sprung up over the last couple years.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe number of alt-coins has exploded recently; trying to keep up with them is like trying to read parts of the \u003Ca href=\"http:\/\/www.kingjamesbibleonline.org\/Numbers-Chapter-1\/\" target=\"_blank\"\u003EOld Testament in the Bible\u003C\/a\u003E:\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\"... and Litecoin begat Feathercoin and Digitalcoin and Worldcoin and Phenixcoin and many brothers who were numbered in the wilderness of the bitcointalk alternative currencies forum. Then Feathercoin begat Gamecoin, and...\"\u003C\/blockquote\u003E\n\u003Cbr \/\u003E\nSo what? \u0026nbsp;The free market at work, right? If they're good they'll survive, if not, then they'll fail. If they're better than Bitcoin somehow then maybe someday one or more of them will usurp Bitcoin as the biggest and best!\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI'm admittedly biased, but I don't like alt-coins.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOne of the big appeals to me for Bitcoin is the fact that it is inflation-proof-- the supply of Bitcoin is fixed and completely predictable. Everybody knows that 21 million Bitcoins will be produced, and everybody knows approximately how quickly they will be produced.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nCreating gazillions of alt-coins seems to me to just be a way of getting back to an \"inflate on demand\" world. Not enough genuine Bitcoin money for you? No problem! Create a new alt-coin to produce more!\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt is all about supply and demand; Bitcoin makes the supply predictable, so price is purely a function of demand. Throw altcoins into the mix, and suddenly supply becomes essentially infinite, because it is trivial to create Yet Another Altcoin \u0026nbsp;(\u003Ca href=\"http:\/\/www.yacoin.org\/\" target=\"_blank\"\u003Eyet another altcoin is an actual thing, by the way\u003C\/a\u003E).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Ci\u003EMaybe\u003C\/i\u003E altcoins will be an important safety valve in some future crypto-currency-dominated world. Maybe if there is lots of economic growth and some technical reason prevents the velocity of money from accelerating to match the increased demand for transactions people will use altcoins to fill the gap. Right now, I don't see the altcoins fulfilling any unmet need, and I think they just divert engineering talent and potentially confuse customers who have a hard enough time understanding Bitcoin, let alone figuring out how the heck Litecoin is different from Bitcoin is different from Freicoin.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI would have no theoretical objections if demand for alt-coins didn't affect the demand for Bitcoin-- if they operated in some completely different market. I think there will be successful spin-offs of Bitcoin where having a reliable, secure, predictable supply of digital tokens will be incredibly valuable. For example, I think Namecoin might have been successful if its designers had focused on the market for domain names instead of confusing it with the market for money; Namecoin .bit domains should have been bought and sold using Bitcoins or euros or whatever currency is most convenient.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2400834077022178077\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2400834077022178077","title":"21 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2400834077022178077"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2400834077022178077"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2013\/08\/the-macro-economics-of-alt-coins.html","title":"The macro-economics of alt-coins"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"21"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-8228379816716826862"},"published":{"$t":"2012-07-03T18:55:00.001-07:00"},"updated":{"$t":"2012-07-03T18:55:41.568-07:00"},"title":{"type":"text","$t":"Off-the-chain transactions"},"content":{"type":"html","$t":"\u003Cdiv\u003E\nThis is a half-baked idea that occurred to me as I was thinking about scaling up Bitcoin.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nThe problem: is there a safe and secure way to make Bitcoin transactions without relying on the block-chain but, instead, relying on some semi-trusted third-party?\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nIf there is, then Bitcoin is more easily scalable; most transactions could happen off the block chain, with in-the-block-chain transactions happening every once in a while to \"settle up\" off-chain transactions.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nSo here is the half-baked idea:\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nUse multisignature transactions to split the ownership of some bitcoin value between a customer (lets call her Alice) and a transaction service (lets call it \"Joe's UltraTransactions\" -- Ultra for short).\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nAlice deposits 100 bitcoins into her Ultra wallet, and what actually happens behind the scenes is Alice's software generates a new keypair, gets a public key from Ultra, and coins are sent into a 2-of-2 transaction.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nAlice withdrawing the bitcoins (getting them out of the UltraTransaction system) is the boring case-- she'd generate a transaction, sign her half, then ask Ultra to sign the other half (and there would be some sort of authentication check-- maybe Ultra sends Alice an SMS to approve the withdrawal).\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nNow Alice wants to pay Bob 10BTC, who also happens to be an UltraTransaction customer. This is where things could get interesting.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nInstead of generating a block-chain transaction, Alice could just give Bob her private key. Both Alice and Bob would sign a message with the private key saying \"Alice is sending 10 bitcoins to Bob; she's given him the private key that she generated.\" \u0026nbsp;Bob would send the message to Ultra, which would send Alice an SMS to make sure she approves, and then any withdrawal involving those 10 bitcoins associated with that private key would require Bob's authorization instead of Alice's.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nAlice would still know the private key, but won't be able to spend what is now Bob's money (Ultra would only let her send\/withdraw 90 of the 100 bitcoin tied up with that private key).\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003EUltra is only semi-trusted; it never has the private key, so can't spend the coins without either Alice or Bob's aproval. Joe can't decide to run off with everybody's coins when the Ultra wallet is worth a few million dollars.\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003EAlice and Bob \u003Cb\u003Edo\u003C\/b\u003E have to trust that Ultra keeps track of who owns what accurately, and that Ultra will be around to sign it's half of the transaction when they want to withdraw some coin. And\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"background-color: white;\"\u003EBob has to trust that Alice \u003Cb\u003Edid\u003C\/b\u003E generate the private key, didn't share it with Ultra, and isn't actually Joe trying to trick him.\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003EThat's quite a lot of trust required, but the ability to instantly transfer value between Ultra customers with zero Bitcoin-block-chain transaction fees might outweigh the risks. And there are probably variations on this idea that would minimize trust in Ultra (maybe there's a semi-trusted service that Ultra pays to keep offline, \"use-only-if-we-go-out-of-business\" backups of their private keys).\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003EAnd it scales beautifully; one UltraTransaction server cluster could easily handle hundreds or thousands of transactions per second, and you could imagine companies popping up all over the world, handling most transactions outside the blockchain.\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"background-color: white;\"\u003E\u003Cbr \/\u003E\u003C\/span\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/8228379816716826862\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/8228379816716826862","title":"8 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8228379816716826862"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8228379816716826862"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2012\/07\/off-chain-transactions.html","title":"Off-the-chain transactions"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"8"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2447648845877507496"},"published":{"$t":"2012-05-01T13:45:00.000-07:00"},"updated":{"$t":"2012-05-01T13:45:08.002-07:00"},"title":{"type":"text","$t":"Neutralizing a 51% attack"},"content":{"type":"html","$t":"A \"51% attack\" means a bad guy getting as much computing power as the entire rest of the Bitcoin network combined, plus a little bit more. The Bitcoin wiki \u003Ca href=\"https:\/\/en.bitcoin.it\/wiki\/Attacks#Attacker_has_a_lot_of_computing_power\" target=\"_blank\"\u003Ehas a good summary\u003C\/a\u003E of what a 51% attacker can and cannot do.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nOne of the things a 51% attacker can do is prevent any transactions or new blocks from anybody besides themselves from being accepted, effectively stopping all payments and shutting down the network.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThat would be bad.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nBut it would also be obvious it was happening, and pretty easy to defend against. As I said \u003Ca href=\"https:\/\/bitcointalk.org\/index.php?topic=78403.0\" target=\"_blank\"\u003Eon the Bitcoin Forums\u003C\/a\u003E:\u003Cbr \/\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\u003Cspan style=\"background-color: #f6f6f6; font-family: verdana, sans-serif; font-size: 13px; line-height: 16px;\"\u003ESomething like \"ignore a longer chain orphaning the current best chain if the sum(priorities of transactions included in new chain) is much less than sum(priorities of transactions in the part of the current best chain that would be orphaned)\" would mean a 51% attacker would have to have both lots of hashing power AND lots of old, high-priority bitcoins to keep up a transaction-denial-of-service attack. And they'd pretty quickly run out of old, high-priority bitcoins and would be forced to either include other people's transactions or have their chain rejected.\u003C\/span\u003E\u003C\/blockquote\u003E\nThe code already has a notion of \"bitcoin priority\" that it uses to prevent transaction spam (sending gazillions of tiny transactions to yourself, just to make everybody else do the work of validating and storing them); extending that to influence the chain-fork-selection code wouldn't be hard.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe devil is in the details, of course, and the risk of introducing a new chain-acceptance rule (high) have to be weighed against the chances that somebody rich and irrational will try to pull off the attack (low, in my opinion, but \u0026nbsp;maybe I'm not sufficiently paranoid about Big Banks or Big Government using Dirty Tricks to shut down Bitcoin). Maybe I'll code it up and keep it as a \"Not To Be Used Except In Case of Emergency\" branch.\u003Cbr \/\u003E\n\u003Cbr \/\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2447648845877507496\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2447648845877507496","title":"17 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2447648845877507496"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2447648845877507496"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2012\/05\/neutralizing-51-attack.html","title":"Neutralizing a 51% attack"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"17"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-885860450250426940"},"published":{"$t":"2012-03-19T09:00:00.000-07:00"},"updated":{"$t":"2012-03-19T09:00:08.722-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"bitcoin"},{"scheme":"http://www.blogger.com/atom/ns#","term":"security"}],"title":{"type":"text","$t":"Full disclosure: Bitcoin-Qt on Windows vulnerability"},"content":{"type":"html","$t":"A \u003Ca href=\"http:\/\/bitcoin.org\/critfix\" target=\"_blank\"\u003Emajor bug in Bitcoin-Qt on Windows\u003C\/a\u003E went unnoticed for over four months. The bug was in the bitcoin-qt.pro file, in these two lines of code:\u003Cbr \/\u003E\n\u003Cblockquote class=\"tr_bq\"\u003E\n\u003Cspan style=\"font-family: 'Courier New', Courier, monospace;\"\u003Ewindows:LIBS += -lws2_32 -lshlwapi\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"font-family: 'Courier New', Courier, monospace;\"\u003Ewindows:DEFINES += WIN32\n\u003C\/span\u003E\u003C\/blockquote\u003E\nSee the bug?\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI don't-- I can't see it, because the problem was Bitcoin-Qt on Windows should have been linked with the \"mingw\" multithreading library and compiled with the -D_MT to turn on support for multithread-safe C++ exception handling in the \"mingw\" library (\u003Ca href=\"https:\/\/github.com\/bitcoin\/bitcoin\/commit\/8864019f6d88b13d3442843d9e6ebeb8dd938831\" target=\"_blank\"\u003Eyou can see the 3-line fix here\u003C\/a\u003E).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThere might be developers reading this who have had experience writing multithreaded mingw-based C++ applications who will say \"Duh! You guys are idiots, everybody knows that!\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIf that's you and you're interested in Bitcoin: \u0026nbsp;we need people like you to help out! Review the code, review the build process, let us know when we're being idiots. There seem to be a lot fewer Windows developers willing to help out with Bitcoin than Linux or Mac developers, which is unfortunate since a majority of our downloads are Windows users.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nNon-mingw-C++-multithreaded developers are reading this and thinking \"the bug was \u003Ci\u003ETHERE\u003C\/i\u003E? \u0026nbsp;Not in some \u003Cspan style=\"font-family: 'Courier New', Courier, monospace;\"\u003E#ifdef WINDOWS\u003C\/span\u003E C++ code or some slightly-out-of-date library that you were linking against?\"\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThe other reason this bug went unnoticed for so long is because it almost never matters. Bitcoin-Qt doesn't throw a lot of exceptions normally, and most of the time the single-threaded-application exception support in mingw works just fine. I'm still not sure exactly what triggers the bug-- probably something like two threads throwing exceptions at the same time, or one thread being interrupted while in a try{} block and then resuming later and crashing because the exception handling code is in a different state.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nMatt Corallo deserves a lot of credit for being persistent and finding the bug when investigating hard-to-reproduce reports of Bitcoin-Qt crashing sometimes when run with the -server flag and handling JSON-RPC requests. He was never able to get the code to crash when running outside of the debugger, which is typical of bugs related to multithreading. But he did see crashes not involving RPC requests, and that is why we consider this a critical issue and are telling everybody affected to upgrade \u003Cb\u003Eimmediately\u003C\/b\u003E.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt it exploitable? Could an attacker craft bitcoin protocol messages that triggered the bug and compromised Windows computers? Has it already been exploited?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWe don't know. We think it would be extremely difficult to craft a usable exploit, partly because it is hard to even trigger the bug reliably but also because Bitcoin-Qt has some security-in-depth to try to prevent this type of bug from becoming exploitable.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIf we're very careful and extremely lucky, this will be the last time we have to tell users to shutdown and upgrade immediately because of some potential vulnerability. But there is no such thing as perfect security, and I expect that there will be another subtle bug either in Bitcoin or in one of the many libraries we link against that becomes a potential security issue.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nThat doesn't mean we give up and go back to paying each other with cowrie shells; it means we assume that devices get compromised and design around that assumption. I think that is a lesson that the entire software industry needs to learn better."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/885860450250426940\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/885860450250426940","title":"7 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/885860450250426940"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/885860450250426940"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2012\/03\/full-disclosure-bitcoin-qt-on-windows.html","title":"Full disclosure: Bitcoin-Qt on Windows vulnerability"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"7"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-7519223115156641829"},"published":{"$t":"2012-03-01T15:22:00.000-08:00"},"updated":{"$t":"2012-03-01T19:20:12.764-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"bitcoin"},{"scheme":"http://www.blogger.com/atom/ns#","term":"security"}],"title":{"type":"text","$t":"Bitcoin Faucet Hacked"},"content":{"type":"html","$t":"I lost 5 bitcoins today when the server holding the \u003Ca href=\"https:\/\/en.bitcoin.it\/wiki\/Bitcoin_Faucet\"\u003EBitcoin Faucet\u003C\/a\u003E's wallet was hacked.\n\nUnfortunately, I wasn't alone-- at least one other customer of the web hosting company (\u003Ca href=\"http:\/\/status.linode.com\/2012\/03\/manager-security-incident.html\"\u003ELinode.com\u003C\/a\u003E) \u003Ca href=\"https:\/\/bitcointalk.org\/index.php?topic=66916.0\"\u003Ehad their wallet stolen, too\u003C\/a\u003E. According to Linode:\n\u003Cbr \/\u003E\n\u003Cblockquote\u003E\nOur investigation has revealed a customer support interface was used to access your account. The compromised credentials have been restricted and we are discussing policy changes to prevent this from recurring.\u003C\/blockquote\u003E\nI knew that using a shared hosting service was a risk, which is why I kept so few bitcoins in the Faucet's wallet. It made sense to spend $30\/month on web hosting where I risked losing $25 worth of bitcoins rather than spending a couple hundred dollars a month on a dedicated ultra-secure server or tens of thousands of dollars on full-time system administrator managing my own hardware.\n\nIt is annoying, though. I've got to create a new wallet for the Faucet, do some work on it's web pages to give a new donation address (any new donations to the old Faucet address could be stolen by the thief), and decide if I trust that Linode really will be more careful about who has access to their customer support interface in the future.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u0026nbsp;It is also very preventable; I've been pushing as hard as I can for the last six months or so for \"multisignature transactions\" as a standard part of the Bitcoin infrastructure. Here's how a future version of the Faucet will work to prevent an incident like today's:\n\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Col\u003E\n\u003Cli\u003ECoins to fill up the Faucet's wallet will get sent to a \"2 signatures required\" bitcoin address.\u003C\/li\u003E\n\u003Cli\u003EThe Faucet's wallet only contains one of the two private keys required to send out coins; the other one would be stored on another machine at some other web hosting company.\u003C\/li\u003E\n\u003Cli\u003EWhen sending out coins, the Faucet would generate one signature and then send the transaction to the second machine.\u003C\/li\u003E\n\u003Cli\u003EThat second machine would look at the transaction, and check to make sure it looked like a valid Faucet transaction: very small payments to a few people happening at most every 10 minutes, with the change sent back into the main Faucet address. If it didn't smell fishy it would create the second signature and broadcast the completed transaction.\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Cdiv\u003E\nIf a hacker compromised the first machine and got the wallet, it wouldn't do them any good because they only have 1 of 2 keys required to spend. \u0026nbsp;If they compromised the machine and tried to generate a transaction to send them all the bitcoins in the wallet the second machine would notice and stop them.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nThey might compromise the first machine and send themselves a little trickle of coins so they don't get noticed, but that would be a lot of work and I would pretty soon notice that more coins were leaving the wallet than I expect.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nCompromising just the second machine doesn't help; they can't modify transactions before signing them, so they can't steal any coins. They'd only be able to steal the Bitcoins if they somehow managed to get both sets of keys from both machines.\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\nMultisignature support is, unfortunately, \u003Ca href=\"http:\/\/blockchain.info\/P2SH\"\u003Estill several months away\u003C\/a\u003E. Until then, I'll continue to keep only small amounts of Bitcoin in the Faucet's new wallet.\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/7519223115156641829\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/7519223115156641829","title":"15 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/7519223115156641829"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/7519223115156641829"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2012\/03\/bitcoin-faucet-hacked.html","title":"Bitcoin Faucet Hacked"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"15"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2932531434408582265"},"published":{"$t":"2011-11-07T06:32:00.000-08:00"},"updated":{"$t":"2012-12-03T14:02:05.878-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"bitcoin"},{"scheme":"http://www.blogger.com/atom/ns#","term":"osx"}],"title":{"type":"text","$t":"Deploying Bitcoin-Qt on OSX..."},"content":{"type":"html","$t":"My goal: create a .dmg file that anybody running OSX version 10.5 or later on an Intel-based Mac can use to install and run Bitcoin-Qt (aka Bitcoin version 0.5).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nHow hard could it be? There must be plenty of people who are using the QT cross-platform graphical user interface toolkit to create Mac applications... right?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nWith some help and hints and a lot of googling I did finally succeed, but not before giving up at least three separate times. I'm writing this to, hopefully, save somebody else lots of frustration.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nSide note: Bitcoin-Qt doesn't run on PowerPC chips, doesn't use more than 4 gigabytes of memory, and doesn't contain any CPU-performance-critical code. So there is no reason to create and deploy a \"universal\" app bundle, and I saved myself a lot of recompiling time by compiling just 32-bit i386.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EProblem 1\u003C\/b\u003E: I've got a 64-bit Mac running Snow Leopard (10.6).\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESolution 1\u003C\/b\u003E: compile \u003Cb\u003Eeverything\u003C\/b\u003E with these flags:\u003Cbr \/\u003E\n-mmacosx-version-min=10.5 -arch i386 -isysroot \/Developer\/SDKs\/MacOSX10.5.sdk\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nCompiling Bitcoin-Qt with those flags is easy when you know how; just add something like this to the Bitcoin-Qt.pro file:\u003Cbr \/\u003E\n\u003Cpre\u003Emacx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot \/Developer\/SDKs\/MacOSX10.5.sdk\n\u003C\/pre\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EProblem 1a\u003C\/b\u003E: I'm using macports for dependencies, so it wasn't obvious how to compile everything with those flags.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESolution 1a\u003C\/b\u003E: Edit \/opt\/local\/etc\/macports\/macports.conf and set macosx_deployment_target and the build_arch:\u003Cbr \/\u003E\n\u003Cpre\u003E# Building for lowest-common denominator OSX 10.5, 32-bit\n# (see build_arch i386 later in this file)\nmacosx_deployment_target 10.5\n\n# CPU architecture to compile for. Defaults to i386 or ppc on Mac OS X 10.5\n# and earlier, depending on the CPU type detected at runtime. On Mac OS X 10.6\n# the default is x86_64 if the CPU supports it, i386 otherwise.\n# GAVIN: overrode to default to 32-bit i386 build\nbuild_arch i386\n\u003C\/pre\u003E\nI then ran:\u003Cbr \/\u003E\n\u003Cpre\u003Eport list installed | cut -f 1 -d' ' | uniq \u0026gt; \/tmp\/portsinstalled\nsudo port uninstall installed\nsudo port install $(cat \/tmp\/portsinstalled)\n\u003C\/pre\u003E\n... to remove and recompile\/reinstall everything. Yes, that took several hours.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EProblem 2\u003C\/b\u003E: macdeployqt refuses to deploy one of our dependencies.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESolution 2\u003C\/b\u003E: file a bug (\u003Ca href=\"https:\/\/bugreports.qt.nokia.com\/browse\/QTBUG-21913\"\u003EQT-21913\u003C\/a\u003E), and patch my copy of macdeployqt.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nHow'd I patch? I found the macdeployqt source inside \/opt\/local\/var\/macports\/build\/ (find \/opt\/local\/var\/macports\/build -name macdeployqt -print), copied it to $HOME\/src\/, and ran qmake\/make to compile after editing its .cpp files.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EProblem 3\u003C\/b\u003E: macdeployqt created an App bundle that crashed on startup.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESolution 3\u003C\/b\u003E: When you 'port install qt4-mac', it installs a shared-library version of Qt. macdeployqt seems to work with a shared-library version of Qt... but it really doesn't. It wants the 'Framework' version. So the solution: 'port deactivate qt4-mac' then 'port install qt4-mac +framework'.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003EProblem 4\u003C\/b\u003E: Images were not being displayed by the deployed App.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cb\u003ESolution 4\u003C\/b\u003E: macdeployqt wasn't deploying plugins and the images are JPEG format which requires the JPEG plugin.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nIt wasn't deploying them because it thinks the plugin path is \"\/Developer\/Applications\/Qt\/plugins\"... but since I'm using macports, the actual pluginPath is \"\/opt\/local\/share\/qt4\/plugins\".\u003Cbr \/\u003E\n\u003Cbr \/\u003E\nI took the easy way out and changed the path in my patched version of macdeployqt. I'll send the patch to the macports qt4-mac maintainer.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Chr \/\u003E\n\u003Cbr \/\u003E\nDid I make things hard for myself by following the \u003Ca href=\"http:\/\/doc.trolltech.com\/4.7\/deployment-mac.html\"\u003EQt documentation for deploying on OSX\u003C\/a\u003E-- is there some magical XCode or commercial application for creating App bundles that I don't know about that would have saved me days of frustration and work?\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Chr \/\u003E\nUpdate: p2k created a nifty pure-python version of macdeployqt (\u003Ca href=\"https:\/\/github.com\/bitcoin\/bitcoin\/tree\/master\/contrib\/macdeploy\" target=\"_blank\"\u003E\"macdeployqtplus\"\u003C\/a\u003E) that Does The Right Things to create a downloadable .dmg file with everything packaged properly."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2932531434408582265\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2932531434408582265","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2932531434408582265"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2932531434408582265"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2011\/11\/deploying-bitcoin-qt-on-osx.html","title":"Deploying Bitcoin-Qt on OSX..."}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-965514600350145641"},"published":{"$t":"2008-08-14T07:16:00.000-07:00"},"updated":{"$t":"2008-08-14T07:28:45.179-07:00"},"title":{"type":"text","$t":"Yahoo Pipes Yay!"},"content":{"type":"html","$t":"This morning I decided to take a little time and look at tools I could use to filter my RSS feeds; for example, I have some feeds written by multiple authors, and I might want to get entries posted by just one of the authors.\u003Cbr \/\u003E\u003Cbr \/\u003E\u003Ca onblur=\"try {parent.deselectBloggerImageGracefully();} catch(e) {}\" href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEghqY_5jDF40FK4zOgqMVy160FAhl5TwU1AQr4kwLWhU4QzxbQgKHj5MM5CMAQZ5DfnBVIADHo0CfUGejiy3aFwFLspzMyw7p-UUU6OgxUYZ49hAwDaM0O-KWFKGKYxIBuffzgIXA\/s1600-h\/Picture+1.jpg\"\u003E\u003Cimg style=\"float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEghqY_5jDF40FK4zOgqMVy160FAhl5TwU1AQr4kwLWhU4QzxbQgKHj5MM5CMAQZ5DfnBVIADHo0CfUGejiy3aFwFLspzMyw7p-UUU6OgxUYZ49hAwDaM0O-KWFKGKYxIBuffzgIXA\/s320\/Picture+1.jpg\" border=\"0\" alt=\"\"id=\"BLOGGER_PHOTO_ID_5234378822954110706\" \/\u003E\u003C\/a\u003EA little searching turned up some small companies that look like they're struggling (ZapTxt, Blastfeed, FeedRinse) and \u003Ca href=\"http:\/\/pipes.yahoo.com\/\"\u003EYahoo Pipes\u003C\/a\u003E. I've already got a Yahoo account, and Yahoo is the least likely of the services to disappear tomorrow, so that's what I used.\u003Cbr \/\u003E\u003Cbr \/\u003EAnd wow! In less than five minutes I have a new rss feed that does exactly what I want! Now I'm going to see if I can come up with a filtering rule that nukes posts that are nothing but recycled content from somewhere else... (and I may have to write a filter for any post by \u003Ca href=\"http:\/\/delong.typepad.com\/sdj\/\"\u003EBrad deLong\u003C\/a\u003E that has the phrase \"a better press corps\" in it...)."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/965514600350145641\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/965514600350145641","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/965514600350145641"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/965514600350145641"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/08\/yahoo-pipes-yay.html","title":"Yahoo Pipes Yay!"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEghqY_5jDF40FK4zOgqMVy160FAhl5TwU1AQr4kwLWhU4QzxbQgKHj5MM5CMAQZ5DfnBVIADHo0CfUGejiy3aFwFLspzMyw7p-UUU6OgxUYZ49hAwDaM0O-KWFKGKYxIBuffzgIXA\/s72-c\/Picture+1.jpg","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-8290964038379565663"},"published":{"$t":"2008-07-16T08:30:00.000-07:00"},"updated":{"$t":"2008-07-16T08:49:31.193-07:00"},"title":{"type":"text","$t":"SoyLatte and GWT: Retreat!"},"content":{"type":"html","$t":"After much struggle and consternation trying to do development on my Mac with SoyLatte (version 1.0.2-- it's a JDK1.6 implementation for the Mac) and GWT (version 1.5), I've decided to retreat back to JDK1.5.\u003Cbr \/\u003E\u003Cbr \/\u003ESo, I've recompiled lots of stuff (we had compiled our own and third-party JARs with JDK1.6), rewrote a couple of little bits of code (surprisingly little-- one use of Deque that was a straight-up replacement with LinkedList, and one use of java.text.Normalizer that was easy to replace with sun.text.Normalizer), and I'm much happier.\u003Cbr \/\u003E\u003Cbr \/\u003EJust in case it helps somebody else, my dead ends were:\u003Cbr \/\u003E\u003Cbr \/\u003ESoyLatte wouldn't load the libgwt-ll.jnilib . Turns out simply creating a copy named \"libgwt-ll.dylib\" makes SoyLatte happy...\u003Cbr \/\u003E\u003Cbr \/\u003E... but trying to run the gwt hosted mode browser results in an error about not being able to open the X11 Display :0.0. No problem, I've got X on my mac, so I startx and run from an xterm window...\u003Cbr \/\u003E\u003Cbr \/\u003E... and I get some weird exception deep in the SoyLatte code. That's the point where I decided it would be less painful to go back to JDK1.5.\u003Cbr \/\u003E\u003Cbr \/\u003EOh, also, another bizarre-ness:\u003Cbr \/\u003E\u003Cbr \/\u003EI'm using ant's os.name built-in property to read a operating-system-specific .antproperties file (so the build can use the GWTCompiler in either the gwt-dev-mac or gwt-dev-linux jar files), like this:\u003Cpre\u003E\u0026lt;property file=\"${os.name}.antproperties\" \/\u0026gt;\u003C\/pre\u003EDepending on which version of ant I'm using, os.name is either \"Darwin\" or \"Mac OS X\".\u003Cbr \/\u003E\u003Cbr \/\u003EI don't like to check in filenames with spaces in them-- in my experience it's just not a good idea. So my solution is to check in the Darwin.antproperties file, and just manually create a symbolic link from that file to \"Mac OS x.antproperties\""},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/8290964038379565663\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/8290964038379565663","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8290964038379565663"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8290964038379565663"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/07\/soylatte-and-gwt-retreat.html","title":"SoyLatte and GWT: Retreat!"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-1970689612872796437"},"published":{"$t":"2008-06-18T11:23:00.000-07:00"},"updated":{"$t":"2008-06-18T12:15:06.828-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"gwt"},{"scheme":"http://www.blogger.com/atom/ns#","term":"java"},{"scheme":"http://www.blogger.com/atom/ns#","term":"spring"}],"title":{"type":"text","$t":"Spring Security+GWT Rant"},"content":{"type":"html","$t":"One day, I may come to love and appreciate Spring (aka acegi) Security.\u003Cbr \/\u003E\u003Cbr \/\u003EI'll appreciate the elegance of being able to inject security into web pages and methods that know nothing authentication and authorization. Maybe one day I'll embrace editing XML configuration files and restarting my web server as a Better Way than writing code in a scripting language like PHP or Python and poking the refresh button on my web browser.\u003Cbr \/\u003E\u003Cbr \/\u003EThat day is not today.\u003Cbr \/\u003E\u003Cbr \/\u003EMy task seems like it should be reasonably straightforward:\u003Cbr \/\u003E we've got a web site that you can browse either logged-in (in which case you'll see Edit buttons, and can submit edit\/updates) or not-logged-in (in which case you see \"Login to Edit\" links).\u003Cbr \/\u003E\u003Cbr \/\u003EWe're re-implementing an old version of the site using GWT and Spring. I'm rewriting the login\/logout code to use Spring Security... and MAN! It's been PAINFUL!\u003Cbr \/\u003E\u003Cbr \/\u003EIt's been painful for a few reasons:\u003Cbr \/\u003E\u003Cbr \/\u003E1. I'm new to Spring, XML configuration files, and GWT. Oh, and Java and Eclipse, too (but I feel like I've started to master those in the last couple of months).\u003Cbr \/\u003E\u003Cbr \/\u003E2. There's lots of documentation and examples available online, but it's not easy to figure out what's relevant and what's not. A lot of the documentation that's out there is for the old, deprecated, previous version (the acegi security library). A lot of the new documentation assumes that you were using the old, deprecated version-- so it contains all sorts of stuff that I don't need to know. But I don't know that I don't need to know it...\u003Cbr \/\u003E\u003Cbr \/\u003E3. The edit\/compile\/debug turnaround time is pretty bad. Editing the xml file with the security stuff in it, then patching it into the war.d\/ directory is quick, but starting up Jetty and refreshing my test web page takes about 45 seconds.\u003Cbr \/\u003E\u003Cbr \/\u003EANYWAY, in the hopes that describing the snags I encountered might help somebody else, here are a few random things that are probably obvious to somebody who knows a lot more about this stuff than I do:\u003Cbr \/\u003E\u003Cbr \/\u003EHere's the security-context.xml file I'm using:\u003Cbr \/\u003E\u003Cpre\u003E\u0026lt;?xml version=\u0026quot;1.0\u0026quot; encoding=\u0026quot;ISO-8859-1\u0026quot;?\u0026gt;\u003Cbr \/\u003E\u003Cbr \/\u003E\u0026lt;!-- Spring Security settings --\u0026gt;\u003Cbr \/\u003E\u003Cbr \/\u003E\u0026lt;beans:beans xmlns=\u0026quot;http:\/\/www.springframework.org\/schema\/security\u0026quot;\u003Cbr \/\u003E xmlns:beans=\u0026quot;http:\/\/www.springframework.org\/schema\/beans\u0026quot;\u003Cbr \/\u003E xmlns:xsi=\u0026quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance\u0026quot;\u003Cbr \/\u003E xsi:schemaLocation=\u0026quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans-2.5.xsd\u003Cbr \/\u003E http:\/\/www.springframework.org\/schema\/security http:\/\/www.springframework.org\/schema\/security\/spring-security-2.0.2.xsd\u0026quot;\u0026gt;\u003Cbr \/\u003E\u003Cbr \/\u003E \u0026lt;http auto-config='true'\u0026gt;\u003Cbr \/\u003E \u0026lt;intercept-url pattern=\u0026quot;\/foo\/**\u0026quot; access=\u0026quot;ROLE_USER\u0026quot; \/\u0026gt;\u003Cbr \/\u003E \u0026lt;\/http\u0026gt;\u003Cbr \/\u003E\u003Cbr \/\u003E \u0026lt;beans:bean id=\u0026quot;myJdbcDAO\u0026quot;\u003Cbr \/\u003E class=\u0026quot;org.springframework.security.userdetails.jdbc.JdbcDaoImpl\u0026quot;\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:property name=\u0026quot;dataSource\u0026quot;\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:ref bean=\u0026quot;varDataSource\u0026quot;\/\u0026gt;\u003Cbr \/\u003E \u0026lt;\/beans:property\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:property name=\u0026quot;usersByUsernameQuery\u0026quot;\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:value\u0026gt;SELECT email AS username, LOWER(password),'true' AS enabled FROM users WHERE email=?\u0026lt;\/beans:value\u0026gt;\u003Cbr \/\u003E \u0026lt;\/beans:property\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:property name=\u0026quot;authoritiesByUsernameQuery\u0026quot;\u0026gt;\u003Cbr \/\u003E \u0026lt;beans:value\u0026gt;SELECT email AS username, 'ROLE_USER' AS authority FROM users WHERE email=?\u0026lt;\/beans:value\u0026gt;\u003Cbr \/\u003E \u0026lt;\/beans:property\u0026gt;\u003Cbr \/\u003E \u0026lt;\/beans:bean\u0026gt;\u003Cbr \/\u003E \u0026lt;authentication-provider user-service-ref=\u0026quot;myJdbcDAO\u0026quot;\u0026gt;\u003Cbr \/\u003E \u0026lt;password-encoder hash=\u0026quot;sha\u0026quot;\/\u0026gt;\u003Cbr \/\u003E \u0026lt;\/authentication-provider\u0026gt;\u003Cbr \/\u003E\u003Cbr \/\u003E\u0026lt;\/beans:beans\u0026gt;\u003Cbr \/\u003E\u003C\/pre\u003EIn no particular order, this is different from what the Spring Security tutorials describe in the following ways:\u003Col\u003E\u003Cli\u003EFor initial testing, I'm protecting a non-existent URL ( \/foo ). I want to make sure that I get a login page if I go there.\u003C\/li\u003E\u003Cli\u003EUsernames and passwords are stored in an already-existing database (the varDataSource is a JdbcTemplate database doo-hickey that is defined in another xml configuration file).\u003C\/li\u003E\u003Cli\u003EI had to step through the code for org.springframework.security.providers.dao.DaoAuthenticationProvider to figure out why I was getting \"Bad credentials\" when trying to login. It turns out the SHA password comparison code inside Spring is fussy about upper and lowercase (you've gotta give it a lowercase hex string, which explains the LOWER(password) in the usersByUsernameQuery).\u003C\/li\u003E\u003Cli\u003EI've hardcoded all users to have ROLE_USER; eventually, I'll teach our old code to handle multiple roles\u003C\/li\u003E\u003Cli\u003EI only have a vague idea of why I have to say \u0026lt;beans:bean\u0026gt; (instead of just \u0026lt;bean\u0026gt;); if I understood XML namespaces I'm sure it would be easy and obvious.\u003C\/li\u003E\u003C\/ol\u003E\u003Cbr \/\u003E\u003Cbr \/\u003EThere's still one big security hole here-- passwords are sent across the network in the clear (I know that's true because I saw my clear-text password as I was stepping through the DaoAuthenticationProvider code on the server). One solution is to require logins go over an https connection, and Spring Security supports that, but I'm surprised that this hole wasn't mentioned in any of the Spring Security tutorials or documentation that I came across."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/1970689612872796437\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/1970689612872796437","title":"7 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1970689612872796437"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1970689612872796437"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/06\/spring-securitygwt-rant.html","title":"Spring Security+GWT Rant"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"7"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-381405913202086779"},"published":{"$t":"2008-03-03T17:13:00.000-08:00"},"updated":{"$t":"2008-03-22T10:50:35.417-07:00"},"title":{"type":"text","$t":"CMS Made Simple: very nice!"},"content":{"type":"html","$t":"I've volunteered to help the Amherst League of Women Voters with their web site (\u003Ca href=\"http:\/\/www.lwvamherst.org\/\"\u003Ehere\u003C\/a\u003E). Just about the first thing they mentioned is that they want an easier way to update content.\u003Cbr \/\u003E\u003Cbr \/\u003EI happen to know quite a bit about that problem; I implemented much of \u003Ca href=\"http:\/\/www.gravityswitch.com\/\"\u003EGravity Switch's\u003C\/a\u003E \"content management system\" (what an awful term for \"software that lets you create a web site\"). The Gravity Switch CMS would be overkill for what they need, and it had been a while since I'd looked at the open source solutions, so I decided to take another look at open source solutions.\u003Cbr \/\u003E\u003Cbr \/\u003EThe usual suspects-- Drupal, Joomla, WordPress-- are all still around, and they all have more than enough functionality. But they all fail the simplicity test; any software for creating a web site that doesn't have a \"Create a new page\" button is too complex.\u003Cbr \/\u003E\u003Cbr \/\u003EThen I found \u003Ca href=\"http:\/\/www.cmsmadesimple.org\/\"\u003ECMS Made Simple\u003C\/a\u003E, and played around with it. Finally, an open source CMS with a reasonable user interface, where simple things are simple and complex things are possible! One of these days I'm going to get around to converting my old, hand-coded HTML home page to a CMS Made Simple-powered site..."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/381405913202086779\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/381405913202086779","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/381405913202086779"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/381405913202086779"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/03\/cms-made-simple-very-nice.html","title":"CMS Made Simple: very nice!"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-3055382081545203680"},"published":{"$t":"2008-02-20T18:32:00.000-08:00"},"updated":{"$t":"2008-02-20T19:19:10.961-08:00"},"title":{"type":"text","$t":"Python SIGALRM oddness"},"content":{"type":"html","$t":"I usually don't stop debugging my code until I've found the root cause of a problem. And the cause just about always turns out to be me being an idiot and doing something boneheaded.\u003Cbr \/\u003E\u003Cbr \/\u003EAnyway, I ran into a hard-to-reproduce, hard-to-debug problem with some Python code, and \u003Ci\u003Estill\u003C\/i\u003E haven't figured out what's going on.\u003Cbr \/\u003E\u003Cbr \/\u003EThe code in question downloads PDF files from the Web, using Python's httplib2. I was using signal.alarm() to setup a timeout-- if httplib took more than four minutes to download the file, I wanted to abort the transfer and move on to the next file (otherwise a very slow web server could make the process take, essentially, forever).\u003Cbr \/\u003E\u003Cbr \/\u003EThe relevant code started out like this:\u003Cpre\u003E# How long to wait? Lets do a \"typical worst case\":\u003Cbr \/\u003E# 5 megabyte paper, through a fairly busy DSL connection (20Kbytes\/second upload)\u003Cbr \/\u003E# works out to 250 seconds (downloads have a little over 4 minutes before timing out)\u003Cbr \/\u003Ealarm_timeout = 250\u003Cbr \/\u003E\u003Cbr \/\u003Edef _alarm_handler(signum, frame):\u003Cbr \/\u003E \"\"\"Bail out of HTTP reads if server takes too long.\"\"\"\u003Cbr \/\u003E raise IOError(60, \"fetch timed out\")\u003Cbr \/\u003E\u003Cbr \/\u003Edef _start_alarm(timeout=alarm_timeout):\u003Cbr \/\u003E signal.signal(signal.SIGALRM, _alarm_handler)\u003Cbr \/\u003E signal.alarm(timeout)\u003Cbr \/\u003E\u003Cbr \/\u003Edef _stop_alarm():\u003Cbr \/\u003E signal.alarm(0)\u003Cbr \/\u003E\u003Cbr \/\u003Edef _remember_and_write(reader, db, save_to_directory):\u003Cbr \/\u003E _start_alarm()\u003Cbr \/\u003E data = reader.read()\u003Cbr \/\u003E _stop_alarm()\u003C\/pre\u003EThe problem was that every once in a while the alarm wouldn't go off and the code would hang. I'm fetching tens of thousands of pdf files, and maybe one in a thousand would hang-- and, of course, if I tried fetching that particular file again everything would work just fine. Python wasn't hung-- if I sent the process a SIGINT signal it would wake up and generate a KeyboardInterrupt, showing a stack trace somewhere deep in the httplib fetching code.\u003Cbr \/\u003E\u003Cbr \/\u003EThat stack trace gave me a clue, and helped me fix bug number 1: I was timing out only around the reading of the body of the HTTP request, but sometimes fetching (for example) the robots.txt file or the HTTP header could take a very long time. So, confident that I'd figured out the problem, I re-arranged the code so that an alarm was always set to go off if \u003Ci\u003Eanything\u003C\/i\u003E took too long. I re-run a big fetch... and it still hangs after several hours.\u003Cbr \/\u003E\u003Cbr \/\u003EI realize my code has another bug just thinking about the problem during my morning shower. What if something in httplib is catching (and silently dropping) the IOError that I raise in the alarm handler? So I rewrite my code to raise a custom exception, and re-run a big fetch... and no dice, it still hangs. But I can still interrupt it by sending a KeyboardInterrupt.\u003Cbr \/\u003E\u003Cbr \/\u003EMaybe httplib2 is catching ALL exceptions somewhere deep in it's code, so the alarm goes off, throws the exception, which is caught by httplib insted of interrupting out of whatever operation is hanging... I briefly contemplate digging into it's source, and decide it would be easier to just change my entire approach.\u003Cbr \/\u003E\u003Cbr \/\u003EWhich is what I ended up doing. Now I do a fork() to create two processes-- one of which does the downloads (as before), updating the timestamp on a file every time it starts a file download. And another which checks that file every four minutes, and if it hasn't changed in over 4 minutes, sends the main process a SIGINT (which Python turns into a KeyboardInterrupt exception) to tell it to proceed to the next file.\u003Cbr \/\u003E\u003Cbr \/\u003EWorks like a charm. I wrapped up the \"fork and monitor\" functionality into this nifty little routine:\u003Cpre\u003E#!\/usr\/bin\/env python\u003Cbr \/\u003E\"\"\"\u003Cbr \/\u003ERoutine that monitors a log file, and, if it hasn't been modified in a certain amount of time,\u003Cbr \/\u003Esends a signal to the process that called the routine.\u003Cbr \/\u003E\u003Cbr \/\u003EGavin ran into problems using SIGALRM, so came up with this solution instead.\u003Cbr \/\u003E\"\"\"\u003Cbr \/\u003E\u003Cbr \/\u003Eimport atexit\u003Cbr \/\u003Eimport os\u003Cbr \/\u003Eimport signal\u003Cbr \/\u003Eimport sys\u003Cbr \/\u003Eimport time\u003Cbr \/\u003E\u003Cbr \/\u003Edef monitor_and_signal(filename, timeout, signal):\u003Cbr \/\u003E \"If file doesn't change in timeout seconds, send this process {signal}. Returns monitoring process pid.\"\u003Cbr \/\u003E\u003Cbr \/\u003E parent_pid = os.getpid()\u003Cbr \/\u003E # Strategy is: fork a child process, which mostly sleeps.\u003Cbr \/\u003E pid = os.fork()\u003Cbr \/\u003E if pid == 0:\u003Cbr \/\u003E # We're the child process; monitor the file:\u003Cbr \/\u003E while 1:\u003Cbr \/\u003E time.sleep(timeout)\u003Cbr \/\u003E try:\u003Cbr \/\u003E info = os.stat(filename)\u003Cbr \/\u003E except OSError:\u003Cbr \/\u003E sys.exit(0) # Nothing to monitor any more, exit.\u003Cbr \/\u003E if (time.time() - info.st_mtime) \u003E timeout:\u003Cbr \/\u003E try:\u003Cbr \/\u003E os.kill(parent_pid, signal)\u003Cbr \/\u003E except OSError:\u003Cbr \/\u003E sys.exit(0) # Parent process goes away: exit.\u003Cbr \/\u003E return pid\u003Cbr \/\u003E \u003Cbr \/\u003Eif __name__ == '__main__':\u003Cbr \/\u003E fname = \"\/tmp\/pretendLog.log\"\u003Cbr \/\u003E fp = open(fname, \"w\")\u003Cbr \/\u003E fp.write(\"Testing\\n\")\u003Cbr \/\u003E\u003Cbr \/\u003E monitor_and_signal(fname, 3, signal.SIGINT)\u003Cbr \/\u003E\u003Cbr \/\u003E for i in range(1,8):\u003Cbr \/\u003E print(\"%d second delay (interrupt at \u003E3)\"%i)\u003Cbr \/\u003E try:\u003Cbr \/\u003E time.sleep(i)\u003Cbr \/\u003E except KeyboardInterrupt:\u003Cbr \/\u003E print(\"Interrupt, was sleeping %d seconds\"%i)\u003Cbr \/\u003E fp.write(\"%d\\n\"%i)\u003Cbr \/\u003E fp.flush()\u003Cbr \/\u003E fp.close()\u003C\/pre\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/3055382081545203680\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/3055382081545203680","title":"5 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3055382081545203680"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3055382081545203680"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/02\/python-sigalrm-oddness.html","title":"Python SIGALRM oddness"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"5"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-6610241645900883934"},"published":{"$t":"2008-02-04T13:05:00.000-08:00"},"updated":{"$t":"2008-02-04T13:10:46.871-08:00"},"title":{"type":"text","$t":"Mac, gwt, SoyLatte Java 1.6 == unhappiness"},"content":{"type":"html","$t":"I'm setting up a development environment for GWT (the Google Web Toolkit) on my Mac... and ran into \"issues.\"\u003Cbr \/\u003E\u003Cbr \/\u003EIt seemed to be going well, until I actually tried to run a sample application, and got:\u003Cbr \/\u003E\u003Cpre\u003E\u003Cbr \/\u003EWarning: The Mac OS -XstartOnFirstThread: is currently unsupported\u003Cbr \/\u003EUnable to load required native library 'gwt-ll'. Detailed error:\u003Cbr \/\u003ECan't load library: \/usr\/local\/lib\/gwt-mac-1.4.61\/libgwt-ll.dylib)\u003Cbr \/\u003E\u003Cbr \/\u003EYour GWT installation may be corrupt\u003Cbr \/\u003EException in thread \"main\" java.lang.UnsatisfiedLinkError: Unable to load required native library 'gwt-ll'. Detailed error:\u003Cbr \/\u003ECan't load library: \/usr\/local\/lib\/gwt-mac-1.4.61\/libgwt-ll.dylib)\u003Cbr \/\u003E\u003Cbr \/\u003EYour GWT installation may be corrupt\u003Cbr \/\u003E at com.google.gwt.dev.shell.LowLevel.init(LowLevel.java:107)\u003Cbr \/\u003E at com.google.gwt.dev.shell.mac.LowLevelSaf.init(LowLevelSaf.java:262)\u003Cbr \/\u003E at com.google.gwt.dev.BootStrapPlatform.go(BootStrapPlatform.java:29)\u003Cbr \/\u003E at com.google.gwt.dev.GWTShell.main(GWTShell.java:318)\u003Cbr \/\u003E\u003C\/pre\u003E\u003Cbr \/\u003E\u003Cbr \/\u003EA couple of hours of googling, searching, reading release notes, scratching my head...\u003Cbr \/\u003E\u003Cbr \/\u003E... and I found the cause, and a workaround.\u003Cbr \/\u003E\u003Cbr \/\u003EThe cause: I was running SoyLatte (a version of Java 1.6 for the Mac).\u003Cbr \/\u003EThe workaround: unset JAVA_HOME, and reset my PATH so I run the java that came with my Mac (version 1.5).\u003Cbr \/\u003E\u003Cbr \/\u003EGrumble, grumble... why does it seem like EVERYTHING I try to do with Java is about three times as hard as it should be? Maybe I've just been spoiled by PHP and Python..."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/6610241645900883934\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/6610241645900883934","title":"1 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6610241645900883934"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6610241645900883934"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2008\/02\/mac-gwt-soylatte-java-16-unhappiness.html","title":"Mac, gwt, SoyLatte Java 1.6 == unhappiness"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"1"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-1146263790733011310"},"published":{"$t":"2007-09-27T10:56:00.000-07:00"},"updated":{"$t":"2007-09-27T11:11:58.654-07:00"},"title":{"type":"text","$t":"Yay, Kingston Technology!"},"content":{"type":"html","$t":"My MacBook Pro suddenly started acting really flaky a few weeks ago-- random kernel panics started happening a couple of times a week, then became more and more frequent until they were happening once or twice a day.\u003Cbr \/\u003E\u003Cbr \/\u003EI suspected maybe some software I'd installed, but just to be sure, I ran Apple's Hardware Diagnostic software (reboot the Mac with system install disk in while pressing the 'D' key).\u003Cbr \/\u003E\u003Cbr \/\u003ESurprise! I got a cryptic error message that I soon figured out meant one of my two 1-gigabyte memory SIMMs was bad. I have no idea which of the two, so I pulled out the one on top and re-ran the Test. Murphy musta been on vacation, because the second run showed no errors.\u003Cbr \/\u003E\u003Cbr \/\u003EI don't buy memory from Apple, because they charge too much for it. But I also don't buy cheap memory. The SIMM that went bad was Kingston-brand memory, purchased from some online retailer (I don't remember which one). So, it was time to put Kingston's lifetime warranty to the test.\u003Cbr \/\u003E\u003Cbr \/\u003EI gotta give kudos to Kingston. I filled out their online RMA form, explaining how I'd diagnosed the problem, and got a fairly quick (next day) reply with instructions on how to return the bad memory. A quick trip to the Fedex shipping store down the street, and about a week later I get a replacement SIMM from the Fedex guy (which I'm testing now in the Apple Hardware Test tool-- the memory, not the Fedex guy)."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/1146263790733011310\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/1146263790733011310","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1146263790733011310"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1146263790733011310"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/09\/yay-kingston-technology.html","title":"Yay, Kingston Technology!"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-4894714698600111159"},"published":{"$t":"2007-07-03T10:51:00.001-07:00"},"updated":{"$t":"2007-07-03T11:09:09.870-07:00"},"title":{"type":"text","$t":"Stable, so far..."},"content":{"type":"html","$t":"uptime for gavinserver is 18 days, running without a hitch in my basement with just the one (power) wire, so I've moved over the nightly cron job that computes internal-rate-of-return for my \u003Ca href=\"http:\/\/www.gavintools.com\/fantasy\/\"\u003EFantasy Lending\u003C\/a\u003E web site.\u003Cbr \/\u003E\u003Cbr \/\u003EI ran into two MORE issues:\u003Cbr \/\u003E\u003Cbr \/\u003E1. resolv.conf was getting overwritten by something (dhclient, I think), so DNS lookups broke. I think installing the \"resolvconf\" package will fix that... we'll see.\u003Cbr \/\u003E\u003Cbr \/\u003E2. I want the cron daemon to send me email if Something Bad Happens with the nightly cron jobs-- otherwise it might be days before I notice that something isn't getting updated. 'mail gavinandresen@...' didn't work out-of-the-box; but I did get this somewhat-helpful message:\u003Cbr \/\u003E\u003Cblockquote\u003E\u003Cpre\u003EThe program 'mail' can be found in the following packages:\u003Cbr \/\u003E * mailx\u003Cbr \/\u003E * mailutils\u003Cbr \/\u003ETry: sudo apt-get install \u003Cselected package\u003E\u003Cbr \/\u003EMake sure you have the 'universe' component enabled\u003Cbr \/\u003E-bash: mail: command not found\u003C\/pre\u003E\u003C\/blockquote\u003E\u003Cbr \/\u003ESo, I install mailx. I don't want to get mail on this system, and made things even more difficult for myself because I decided to configure gavinserver as a 'satellite' system, with all outgoing mail sent via the EasyDNS mail server.\u003Cbr \/\u003E\u003Cbr \/\u003ESending mail via mailout.easydns.com requires authentication with a username and password. Which made me scratch my head, because the spiffy-auto-setup for postfix didn't let me specify a username and password.\u003Cbr \/\u003E\u003Cbr \/\u003EMore web searching turns up a \u003Ca href=\"http:\/\/www.freelock.com\/kb\/Postfix_relayhost\"\u003Ehelpful web page\u003C\/a\u003E that describes exactly what I need to do (create a SASL password file and point postfix at it). Works like a charm the first time!"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/4894714698600111159\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/4894714698600111159","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/4894714698600111159"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/4894714698600111159"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/07\/stable-so-far.html","title":"Stable, so far..."}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-1683236507789292479"},"published":{"$t":"2007-06-12T15:26:00.000-07:00"},"updated":{"$t":"2007-06-14T06:38:02.672-07:00"},"title":{"type":"text","$t":"Almost TOO easy..."},"content":{"type":"html","$t":"Eventually, I hope to setup dynamic DNS, and will connect to the Ubuntu machine from the server at my ISP, with my DSL router port-forwarding requests. But to do that, the PC will have to have a static IP address inside my network. So time to edit \/etc\/network\/interfaces again (I decide 192.168.2.88 is a good address; the FreeBeer network router is at 192.168.2.1, and assigns DHCP addresses in the range 192.168.2.100 through 192.168.2.254):\u003Cbr \/\u003E\u003Cpre\u003E# Wireless interface\u003Cbr \/\u003Eauto ra0\u003Cbr \/\u003Eiface ra0 inet static\u003Cbr \/\u003Eaddress 192.168.2.88\u003Cbr \/\u003Enetmask 255.255.255.0\u003Cbr \/\u003Egateway 192.168.2.1\u003Cbr \/\u003Ewireless-essid FreeBeer\u003Cbr \/\u003Ewireless-channel 11\u003Cbr \/\u003Ewireless-mode managed\u003Cbr \/\u003E\u003C\/pre\u003E\u003Cbr \/\u003ERestart the wireless connection with \"ifdown ra0\" \"ifup ra0\", and it's mostly working. Except DNS is busted-- I can't \"ping www.google.com\".\u003Cbr \/\u003E\u003Cbr \/\u003ESolution is easy, if you know how: figure out your DNS name servers, then add their IP addresses to \/etc\/resolv.conf. In my case, that means going to the router's admin screen (http:\/\/192.168.2.1\/), looking at the Primary and Secondary DNS settings on the router's \"Connection Summary\" screen, then adding:\u003Cbr \/\u003E\u003Cpre\u003E\u003Cbr \/\u003Enameserver 71.243.0.12\u003Cbr \/\u003Enameserver 68.237.161.12\u003Cbr \/\u003E\u003C\/pre\u003E\u003Cbr \/\u003E... to \/etc\/resolv.conf.\u003Cbr \/\u003E\u003Cbr \/\u003ERestart the ra0 network interface (ifup\/ifdown), then make sure I can \"ssh gavin@192.168.2.88\" from my mac. Success again!"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/1683236507789292479\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/1683236507789292479","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1683236507789292479"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/1683236507789292479"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/06\/almost-too-easy.html","title":"Almost TOO easy..."}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2398653186180135511"},"published":{"$t":"2007-06-12T14:13:00.000-07:00"},"updated":{"$t":"2007-06-12T15:26:19.020-07:00"},"title":{"type":"text","$t":"Wireless progress"},"content":{"type":"html","$t":"A Linksys WMP54G wireless PCI card arrived on my doorstep today (Amazon Prime; they hooked me with a free trial, and I'm now addicted...), so this afternoon I've been figuring out how to get it working with Ubuntu server.\u003Cbr \/\u003E\u003Cbr \/\u003EApparently, Ubuntu has a very nice network configuration GUI I could use. Except I installed Ubuntu Server, which doesn't include all the nice GUI stuff. So... either I install all the nice GUI stuff (I'd already installed X11R6 on my Mac, so theoretically I could run the GUI stuff over an ssh connection). Or I need to figure out how to set everything up via the command line.\u003Cbr \/\u003E\u003Cbr \/\u003EGoogling for \"ubuntu wireless\", I find the \u003Ca href=\"https:\/\/help.ubuntu.com\/community\/WifiDocs\/WiFiHowTo\"\u003EWifi HowTo\u003C\/a\u003E page, which points me in all the right directions. The iwconfig command tells me that the wireless card is named \"ra0\". I add this to \/etc\/network\/interfaces:\u003Cbr \/\u003E\u003Cpre\u003E# Wireless interface\u003Cbr \/\u003Eauto ra0\u003Cbr \/\u003Eiface ra0 inet dhcp\u003Cbr \/\u003Ewireless-essid FreeBeer\u003Cbr \/\u003Ewireless-channel 11\u003Cbr \/\u003Ewireless-mode managed\u003Cbr \/\u003E\u003C\/pre\u003E\u003Cbr \/\u003Ethen \"ifup ra0\", and success! It connects!"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2398653186180135511\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2398653186180135511","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2398653186180135511"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2398653186180135511"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/06\/wireless-progress.html","title":"Wireless progress"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-8808757859618191049"},"published":{"$t":"2007-06-08T20:19:00.000-07:00"},"updated":{"$t":"2007-06-08T20:43:10.830-07:00"},"title":{"type":"text","$t":"Easy when you know how"},"content":{"type":"html","$t":"So the Ubuntu patient is now running and on the network (wired). I ask my Router for it's IP address, and try to ssh in from my Mac.\u003Cbr \/\u003E\u003Cbr \/\u003ENo dice. Hmm... maybe sshd isn't running. Nope. Not even on the system.\u003Cbr \/\u003E\u003Cbr \/\u003E\u003Ca href=\"https:\/\/help.ubuntu.com\/7.04\/server\/\"\u003EThe Ubuntu documentation\u003C\/a\u003E is actually pretty helpful, and after a quick \"apt-get install ssh\" (after I'd sudo bash to get a root shell) I'm able to \"ssh gavin@192.168.1.109\" and get a Password: prompt, and login remotely.\u003Cbr \/\u003E\u003Cbr \/\u003EWhich is good, because Michele wants to use the new PC to play Guild Wars, and I'd stolen it's power\/keyboard\/ethernet\/etc. So I move it across the room, and plug it in \"headless\" -- just power and ethernet attached. Turn it on... and yay! I can still ssh in.\u003Cbr \/\u003E\u003Cbr \/\u003ESetup continues; \"apt-get install emacs\" (gotta have emacs), and lynx, and curl, and subversion. I need a few Perl packages, so I try: perl -MCPAN -e 'install Bundle::CPAN', which fails miserably. It's missing EVERYTHING (make, c compiler, ...).\u003Cbr \/\u003E\u003Cbr \/\u003EHmm. Browse documentation... Aha! I need to \"apt-get install build-essential\" to get make and g++ and all that Good Stuff.\u003Cbr \/\u003E\u003Cbr \/\u003EI forget how to get CPAN to re-run it's configuration script to figure out where make is. And I don't want to configure it all by hand. So I use the hammer approach-- I remove the ~\/.cpan directory and \/etc\/perl\/CPAN\/Config.pm, then re-run perl -MCPAN -e ... Success!\u003Cbr \/\u003E\u003Cbr \/\u003EI'm getting closer, I can feel it... Ok, try running the PHP script that computes portfolio returns. Oops, missing php, gotta apt-get install php5-cli.\u003Cbr \/\u003E\u003Cbr \/\u003ERun again. Oops, missing php's Math\/Finance. That's from \u003Ca href=\"http:\/\/pear.php.net\"\u003EPEAR\u003C\/a\u003E. Ok, apt-get install php-pear, then pear install --alldeps Math_Finance.\u003Cbr \/\u003E\u003Cbr \/\u003EMan oh man, that's a lot of arcane stuff sitting around in my brain. I'm starting to think maybe I should have installed the Desktop Ubuntu; maybe installing one of the graphical Linux IDE's from the graphical installer would have done most of this stuff for me.\u003Cbr \/\u003E\u003Cbr \/\u003ELet's see how many different ways of installing software I've used so far:\u003Cbr \/\u003E + Burn an installation CD and boot from it\u003Cbr \/\u003E + apt-get\u003Cbr \/\u003E + perl -MCPAN\u003Cbr \/\u003E + pear install\u003Cbr \/\u003E\u003Cbr \/\u003EAt least I haven't had to download a .tar.gz file and then edit configuration files and compile from source. Or use the rpm command."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/8808757859618191049\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/8808757859618191049","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8808757859618191049"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/8808757859618191049"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/06\/easy-when-you-know-how.html","title":"Easy when you know how"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-3165994838593617778"},"published":{"$t":"2007-06-08T18:45:00.000-07:00"},"updated":{"$t":"2007-06-08T18:57:20.228-07:00"},"title":{"type":"text","$t":"No Wireless For You!"},"content":{"type":"html","$t":"The first part of this project went pretty smoothly. I downloaded the Ubuntu Server .iso CD image to my Mac.\u003Cbr \/\u003E\u003Cbr \/\u003EI already happened to know that I needed to open it in \"Disk Utility\" to burn it to CD-- the last time I needed to burn a .iso, I think I remember it taking me a bunch of head-scratching and googling before figuring out how to do it (launch Disk Utility, File...Open the .iso image, make sure it's selected, then poke the big Burn button).\u003Cbr \/\u003E\u003Cbr \/\u003EI purchased a Belkin Wireless G Desktop network card, and installed it in the PC (replacing the wired ethernet card).\u003Cbr \/\u003E\u003Cbr \/\u003EThen I had to figure out how to tell the PC to boot into it's BIOS (the PC is a Dell Dimension 4100). Umm.... Escape? Nope. Ummm.... F1? Nope. Ok, google it... aha, press the F2 key while booting. Theoretically I knew that, but it's been a year or three since doing any significant work on a PC.\u003Cbr \/\u003E\u003Cbr \/\u003ESo, bring up the BIOS, tell it to boot from the CD first, put the CD in the drive, and reboot.\u003Cbr \/\u003E\u003Cbr \/\u003EYay! Ubuntu installer runs. After answering a bunch of questions, things seemed to be going swimmingly... until I was asked which networking I wanted, \"wifi0\" or \"aeth0\". Huh? I dunno... I try wifi0, which fails.\u003Cbr \/\u003E\u003Cbr \/\u003EMore googling. As far as I can see, the Belkin wireless card isn't supported by Linux out-of-the-box. Sigh.\u003Cbr \/\u003E\u003Cbr \/\u003EOk, gonna return the Belkin, and buy a Linksys card, which (apparently) is better supported. I do NOT want to spend hours twiddling network settings to try to get a brand-new wireless card to work.\u003Cbr \/\u003E\u003Cbr \/\u003ESo: sudo shutdown -h now to shutdown. Then remove the wireless card, put back in the wired card. Reboot."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/3165994838593617778\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/3165994838593617778","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3165994838593617778"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/3165994838593617778"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/06\/no-wireless-for-you.html","title":"No Wireless For You!"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-2906814802920892945"},"published":{"$t":"2007-06-08T18:34:00.000-07:00"},"updated":{"$t":"2007-06-08T18:45:10.945-07:00"},"title":{"type":"text","$t":"Ubuntu Server, baby..."},"content":{"type":"html","$t":"I'm running a couple of web sites on an inexpensive (less than $50\/month) \"virtual private server\" at SolarVPS.\u003Cbr \/\u003E\u003Cbr \/\u003EMy development machine is a Mac Powerbook Pro-- I spend most of my time in emacs in a bash shell, because I'm a crotchety old Unix hacker. I was running a bunch of CPU-intensive stuff (like calculating internal-rate-of-return on the Fantasy Prosper portfolios at gavintools.com\/fantasy ) on my development machine, fired off from a cron job every day. Which really isn't the right way of doing things-- Bad Things Happen when I take my laptop travelling and it's not hooked up to a network when the cron job wants to do it's thing.\u003Cbr \/\u003E\u003Cbr \/\u003EIt would be a bad idea to run the really CPU-intensive stuff on the VPS; I'm sharing the CPU with other random folks. Besides, I don't have a full development environment (compiler, etc) setup on that system. So, I need a system that's always turned on, always connected to the network, and can do a bunch of CPU-intensive work.\u003Cbr \/\u003E\u003Cbr \/\u003ESo I've decided to take an old (circa 2001) PC and turn it into my number-crunching server. The plan:\u003Cbr \/\u003E\u003Cbr \/\u003E1. Install Ubuntu Server (Linux) on it, with all the extra stuff I need.\u003Cbr \/\u003E2. Put a wireless networking card in it.\u003Cbr \/\u003E3. Move it down into the basement.\u003Cbr \/\u003E\u003Cbr \/\u003EShould be easy for an old unix hacker... except I'm not really a system administrator, I'm a software developer."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/2906814802920892945\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/2906814802920892945","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2906814802920892945"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/2906814802920892945"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/06\/ubuntu-server-baby.html","title":"Ubuntu Server, baby..."}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-6087962624530201679"},"published":{"$t":"2007-05-24T06:28:00.000-07:00"},"updated":{"$t":"2007-05-24T06:59:32.090-07:00"},"title":{"type":"text","$t":"Tragedy of the email commons"},"content":{"type":"html","$t":"I was listening to \u003Ca href=\"http:\/\/www.amazon.com\/Ethics-Liberty-Murray-Newton-Rothbard\/dp\/0814775594\/ref=pd_bbs_sr_1\/102-7780632-4520129?ie=UTF8\u0026s=books\u0026qid=1180013510\u0026sr=1-1\"\u003E\"The Ethics of Liberty\"\u003C\/a\u003E yesterday, and it got me thinking about email lists.\u003Cbr \/\u003E\u003Cbr \/\u003EMost email discussion lists seem to suffer from a Tragedy of the Commons-- there's not a whole lot of motivation for people posting their opinions to think twice about spouting off, or going on and on and on, or otherwise polluting the list with stuff that the subscribers to the list might consider junk.\u003Cbr \/\u003E\u003Cbr \/\u003EThere are a couple of solutions to these kinds of problems. You can try to set up some kind of policing system, with trusted moderators given the power to bless posts, ban people, etc. You need really thick-skinned, generous-hearted, even-tempered moderators for that to work.\u003Cbr \/\u003E\u003Cbr \/\u003EA solution that works in the real world that hasn't been tried for the email mailing list problem (as far as I know) is some kind of economic system, where the common resource is given a value and anybody wanting to use the resource must pay rent (which is then used to maintain the resource).\u003Cbr \/\u003E\u003Cbr \/\u003ESo, here's a thumbnail sketch of how this might work for an email mailing list:\u003Cbr \/\u003E\u003Cbr \/\u003ECreate an artificial currency. If you have enough of this currency, you're allowed to post messages to the list. Longer posts cost more than shorter posts.\u003Cbr \/\u003E\u003Cbr \/\u003EEverybody starts with some amount of this currency. Everybody is allowed to use it themselves, give it away, or sell it (for real money!) to people who want to use it to post messages.\u003Cbr \/\u003E\u003Cbr \/\u003EEvery message posted includes ways of:\u003Cbr \/\u003E - Tagging the message as \"Worthwhile\" --\u003E transfers currency from your account to the poster's account.\u003Cbr \/\u003E - Tagging the message as \"Waste of my Time\" --\u003E transfers currency from poster's account to the common pool of currency.\u003Cbr \/\u003E\u003Cbr \/\u003EThe amount of currency in the system is tied to the desired message traffic. We all have a limited attention span; basically, the trick will be to create an artificial economy so that the people who contribute positively are encouraged to contribute more, and people who \"pollute\" are punished.\u003Cbr \/\u003E\u003Cbr \/\u003ECurrency goes into the system every day (again, based on desired message traffic per day). Some is assigned to new people signing up for the list, and the rest evenly distributed to everybody already on the list.\u003Cbr \/\u003E\u003Cbr \/\u003E\"Lurkers\" on the list could either hoard their currency, offer to sell it, or give it away to people from whom they want to hear more."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/6087962624530201679\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/6087962624530201679","title":"2 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6087962624530201679"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6087962624530201679"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/05\/tragedy-of-email-commons.html","title":"Tragedy of the email commons"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"2"}},{"id":{"$t":"tag:blogger.com,1999:blog-12429911.post-6141351501705692238"},"published":{"$t":"2007-03-23T10:39:00.000-07:00"},"updated":{"$t":"2007-03-23T10:46:06.507-07:00"},"title":{"type":"text","$t":"Coding web forms using PHP"},"content":{"type":"html","$t":"I've made a bunch of fixes and upgrades to my code for \u003Ca href=\"http:\/\/www.onlamp.com\/pub\/a\/php\/2006\/03\/16\/autofill-forms.html\"\u003Eauto-filling PHP forms\u003C\/a\u003E. It's really a much, much nicer way of dealing with form re-display than the traditional way of mixing PHP code into your page's HTML. And it's a lot simpler than using a form API to generate the form programatically from your PHP code.\u003Cbr \/\u003E\u003Cbr \/\u003EThe biggest change: it now Does The Right Thing with arrays of values (form elements with name=\"foo[]\", which automagically get turned into PHP arrays when they're submitted).\u003Cbr \/\u003E\u003Cbr \/\u003EGet it from http:\/\/www.skypaint.com\/gavin\/code\/."},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/gavintech.blogspot.com\/feeds\/6141351501705692238\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.blogger.com\/comment\/fullpage\/post\/12429911\/6141351501705692238","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6141351501705692238"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/12429911\/posts\/default\/6141351501705692238"},{"rel":"alternate","type":"text/html","href":"https:\/\/gavintech.blogspot.com\/2007\/03\/coding-web-forms-using-php.html","title":"Coding web forms using PHP"}],"author":[{"name":{"$t":"Gavin Andresen"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/10105284501947275111"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}}]}}