Heroku Demo blog

  • OsCurrency Heroku Deployment


    "Anyone can run their own financial system." - Bernard Lietaer at the Naropa Intentional Economics workshop.

    Thanks to Lee Azzarello, oscurrency can now be deployed to heroku with the master branch. For production use, the edge branch is preferred as previous testing in development and production has been done with edge. Also, two more items need to be worked on for heroku deployment. In edge, search is done with sphinx which heroku does not support. Since a community currency system generally does not need industrial strength search, perhaps this can be replaced with standard database queries. Also, the edge branch uses workling and starling for background processing of newsletter and forum post emails. Heroku uses DJ workers.

    sudo gem install aws-s3
    git clone git://github.com/austintimeexchange/oscurrency.git
    cd oscurrency
    heroku create
    git push heroku master
    heroku rake db:migrate
    heroku rake install
    export AMAZON_ACCESS_KEY_ID=[amazon_access_key_id]
    export AMAZON_SECRET_ACCESS_KEY=[amazon_secret_access_key]
    heroku config:add AMAZON_ACCESS_KEY_ID=$AMAZON_ACCESS_KEY_ID
    heroku config:add AMAZON_SECRET_ACCESS_KEY=$AMAZON_SECRET_ACCESS_KEY
    script/create_s3_bucket [bucket_name]
    heroku config:add S3_BUCKET_NAME=[bucket_name]
    heroku config:add GMAIL_SMTP_USER=[gmail_username]
    heroku config:add GMAIL_SMTP_PASSWORD=[gmail_password]

    Here's a larger version of the screencast on blip.tv.

    Posted over 2 years ago

  • CapCard: Opentransact with OAuth



    The previous two screencasts demonstrated using Opentransact for simple web payments without using OAuth. Now we see how Opentransact web payments can be made with OAuth. Watch the original larger screencast to make reading the typing easier on the eyes.

    To get OsCurrency to work with CapCard, I made this checkin.

    Posted over 2 years ago

  • Part 2: Greco's The End of Money

    Welcome back! In the previous entry, the evolution of money was explored to the extent that we could see how its essence changed at every step in the ladder of economic civilization. The essence of modern money is credit. This time, I cover the second half of Thomas Greco's book where he shares an abundance of wisdom and guidance.


    After thinking about The End of Money and the Future of Civilization some more, it occurred to me that the money system is like Windows 95.  In the same way Windows 95 didn't know whether it was an archaic 16 bit operating system or a modern 32 bit operating system, our current money system doesn't know whether it is using commodity money or credit money.  Windows 95 tried to reform Windows 3.11.  This effort generated billions of dollars for Microsoft which produced two more commercially successful versions (98 and Me) but this effort was eventually abandoned.  Today, it's easy to forget what it was like losing all of your work.  Cue Barbara Streisand singing Memory.

    Maybe central bankers aren't deliberately trying to marginalize people.  It may just be that with outdated jargon, they've painted themselves into a corner and they don't have the tools to build a stable money system.  Only we do.

    Because we make sense of new systems by drawing on familiar experiences to describe them, it is inevitable that we sometimes inherit inappropriate language when systems are upgraded.  Greco shares the example of "driving" a car which is left over from driving a team of horses. (p. 102)  In the last post, we learned from Greco that continuing to use language (loan, deposit) from legacy systems perpetuates conditions for system instability.

    What can we do to fix this bug?

    Instead of "building a better horse" or patching the system, we can transcend it.  Banks have been doing it among themselves for over a hundred years.  Greco describes the origins of mutual credit clearing systems which include check clearing by banks in clearing houses. (125)  A mutual credit system recognizes that "ultimately, it is your sales that pay for your purchases." (130)  A medium of exchange is really unnecessary as "money is merely an accounting system" (102)  

    Money isn't stuff.  It's a statistic.  Like your credit limit?  No.  Your credit limit is not money. 
    Money is a kind of placeholder, an instrument that enables one who has delivered goods or services to later on requisition from the marketplace other goods or services that one may desire.(146)
    For a given system, the money supply is a measure of outstanding IOUs.  It "is determined by adding up the sum of either the positive balances or the negative balances." (131)  It is perfectly fine for the money supply to be zero at a given instant.  When money was stuff, a zero money supply would be problematic because if you need stuff to buy and sell and there's no stuff, then you can't buy and sell.  

    Likewise, it is perfectly fine for an account holder's balance to always be negative "so long as it is actively trading and the negative balance does not exceed some appropriate limit." (134)  On what basis is this limit determined?  Greco suggests borrowing an idea from the banks.
    Just as banks use your income as a measure of your ability to repay a loan, it is reasonable to set maximum debit balances based on the amount of revenue flowing through an account - in other words, the maximum line of credit on any account should be decided on the basis of the amount of that member's sales of goods and services averaged over some recent time period.  Past experience in conventional money and banking has provided a rule of thumb that may be useful here.  It says that a negative account balance should not exceed an amount equivalent to about three months' average sales.

    Again, three months is just a rule of thumb1 which chooses an appropriate credit buffer for the account holder.  Instead of 3 months, you might choose 100 days to make it easy to do certain calculations in your head.  Greco refers to a metric called the reflux rate which is the rate at which currency is redeemed by an issuer as a percentage of the buffer.  The reflux rate is proportional to the sales rate and another way to describe it is the percentage of the credit buffer (using, for instance, dollars) sold in a given time interval, for instance, in one day.  It is not clear what the origin of this metric is.  It is perhaps inspired by the law of reflux but certainly the term is meant to convey the idea that what matters is how quickly an account holder redeems his own currency or the system in general redeems her own currency.  Of course, new members do not have a sales history in the system.  This is addressed in section 5.3.3 of Appendix A: A Model Membership Agreement for a Credit Clearing Service.
    New members may be granted a minimum line of credit based on their sales history prior to membership but such credit lines may not exceed two months' sales averaged over the past twelve months.(236)
    There's an exception in 5.3.1 which seems to apply to members in general which allows the credit limit to be determined based on "the value of goods currently offered and available for sale within the Exchange."  Obviously, assessing the value of the goods would be an extra burden on the management.

    Let's do a few simple credit limit calculations to get in the habit and perhaps gain some further insight on the nature of the reflux rate.

    • Suppose we calculate the average sales rate using the last year of sales.  If the account holder has sold $400,000 of cookies in the last year, then his sales rate is $400,000 per year.  If we choose a 3 month buffer, then he is allowed a negative balance (buffer) of $100,000.  Since we're using a 3 month buffer, his reflux rate needs to be at least 33% per month ($33k/month) to maintain his current credit limit.
    • Suppose we calculate the average sales rate using only the last 6 months.  If the account holder has sold $10,000 of cookies in the last 6 months, then his sales rate is $20,000 per year. If we choose a 3 month buffer, then he is allowed a negative balance (buffer) of $5,000.  Since we're using a 3 month buffer, his reflux rate needs to be at least 33% per month ($1.6k/month) to maintain his current credit limit.
    • Instead of choosing a 3 month buffer, let's slightly change it to 100 days.  Suppose we calculate the average sales rate using only the last 100 days.  If the account holder has sold $100,000 of cookies in the last 100 days, then he is again allowed a negative balance of $100,000.  Since we're using a 100 day buffer, his reflux rate needs to be at least 1% per day ($1k/day) to maintain his current credit limit.

    I've purposely chosen relatively big numbers for the buffers in the examples and Greco notes that the "actual starting point for a complementary currency will be much lower building up gradually over time." (150)

    One thing I notice is that these calculations are exactly like the calculations made in video streaming.  Measured in time, both buffers are constant.  In video streaming, the buffer might be 5 seconds.  In credit streaming, the buffer might be 100 days.  If the video stream is 50 kb/s, then a full buffer would contain 250 kb.  If the reflux rate is $1000/day, then a full buffer would contain $100,000.  The buffer is emptied by playback or spending.  It needs to be replenished with more video data or sales.  If there is sufficient network congestion, then the video server reduces the bandwidth of the stream from 50 kb/s to maybe 25 kb/s to a 125 kb buffer (still 5 seconds worth of buffer).  If there is a sufficient reduction in sales, then the credit system may reduce the reflux rate to from $1k/day to $0.5k/day to a $50k buffer (still 100 days worth of buffer).  If available bandwidth or sales increase, the buffer is increased.

    Greco says "in the absence of legal tender laws, a currency with too slow a reflux rate will be devalued by the traders in the market...That is why currency should be issued on the basis of goods and services that have a high everyday demand.  Such a basis will guarantee that the currency will be quickly returned to the issuer for redemption and not accumulate in the hands of those who have little opportunity to spend it.  From historical experience, a minimum daily reflux of 1 percent is necessary for a currency to hold its market value at par." (147)  This is regulated by the system by reducing an account holder's credit buffer when the average daily reflux stays below 1 percent over some larger interval of time.  Greco calls the account holders who provide goods and services that everyone needs on a daily basis "trusted issuers" and they obviously include food, utility and transportation companies.  For instance, one third of the Leipzig Dresden Railway's capital was issued in the form of "railway money certificates" that circulated for forty years. (75)

    Greco stresses "not all credit is suited to serve the exchange function.  A distinction must be made between short-term turnover credit and long-term investment credit" (146)  Long-term credit enables the "renewal or expansion of the economy's production capacity" (214) but to do so "an economy must produce a surplus over its current consumption needs...It is our collective savings that provide the financing for the creation of new productive capacity" (215)  If you create credit for long term investment like real estate mortgages or business plans that take years before returning revenue, then it will be a long time before the borrower can redeem the currency he has spent - no "timely reflux and redemption by the issuer." (148)  This lowers the reflux of the system and devalues the currency.  Instead, surplus turnover credits in accounts can be reallocated from turnover credit to investment credit.  Greco cites many reasons why equity investment is generally more desirable than bond issues. (220)  In particular, an equity investment relationship isn't an antagonistic relationship like debt with interest is and a debt contract puts all the risk on the borrower.

    For commercial trade exchanges, Greco warns against the trade exchange's own account "cherry picking" the best goods or services with inside information.  More worrisome is the notorious "borrow and spend" clause that allows the trade exchange's account to spend beyond its means.  Greco says "the resulting ballooning of debt in the system account results in the debasement of the value of the internal trade credits and the loss of confidence in the trade exchange management." (164)  Also, for commercial exchanges, Greco says all levels of the supply chain should be included.
    If a trade exchange has a retail member, it should try to recruit the wholesale companies that supply that retail member, then try to recruit the manufacturing companies that supply those  wholesalers, then try to recruit the basic commodity producers that supply those manufacturers, and so on - until the loop is eventually closed by recruiting the employees/customers who are supplied by the retailers.  In this way, each participant will be able to pay their suppliers by means of credit clearing.
    Barter exchanges formerly were the target of the IRS that assumed they were trying to avoid paying taxes.  This harassment ended when it was agreed that barter exchanges would provide annual reports of member's incomes with form 1099B. (169)  It is not taxes members are trying to avoid, it is the unnecessary costs associated with conventional banking.

    There are many more lessons to be learned in the book, but one that I must mention before wrapping up is surety of contract guidance.  Greco warns "we should not be overly sanguine about people's behavior where money and material wealth are concerned." (135)  One way to make sure members do not drop out without settling their balances is to require a pledge of collateral which will be forfeited in the case of default.  This could be a second mortgage on real estate.  Greco clarifies that collateral should only be used for surety of contract and not to determine credit limits.  Another approach is that members would not join individually but join with others in an affinity group and those in this smaller group would share the risk of one of its members defaulting.  Finally, despite these measures, the system should have an insurance fund, so not only must the system itself have revenues for operating costs but also for bad debts.  This insurance pool can be built with usage fees.  (136)
    All who are really dedicated to the earliest possible attainment of economic and physical success for humanity - and thereby realistically to eliminate war - will have to shift their efforts from the political arena to participate in the design revolution.2 (111)  




    1. Obviously, some businesses will have longer or shorter turnover intervals and will require longer or shorter buffers measured in time. 
    2. Buckminster Fuller, Critical Path, p. 237

    Posted over 2 years ago

  • PrĂ©cis of Greco's The End of Money and the Future of Civilization

    To mix things up, I thought it would be fun to share some knowledge gained from Thomas Greco's The End of Money and the Future of Civilization across two blog posts.  This first post will cover the challenges facing us (ch. 1-10).  The second post will cover how we can navigate into the future (ch. 11-20).  

    I apologize in advance for any misinterpretations of the material and look forward to corrections.  I can think of no better executive summary than to quote Greco directly.
    The most graceful and promising approach to empowering ourselves and our communities is through voluntary, entrepreneurial activities that can liberate the exchange process and reclaim the credit commons. (p. 111)
    The good news is that Congressman Ron Paul has brought attention to the issue of money creation.  Greco includes an exchange between Ron Paul and Alan Greenspan at a February 11, 2004 House Financial Services Committee hearing in which Paul suggested that the power to create financial bubbles was an ominous power. (39)  Greenspan's response was interesting.
    Congressman, as I've said to you before, the problem you are eluding to is called the conversion of a commodity standard to fiat money.  We have statutorily gone onto a fiat money standard and as a consequence of that it is inevitable that the authority, which is the producer of the money supply, will have inordinate power.
    The bad news is that even though there seems to be rough consensus that the Federal Reserve is the problem and that it has too much power, Paul's strange position of reverting to money backed by gold (so-called "sound money") ignores the primary issue that it is not credit money but the monopoly of credit money that is the problem.  It's like saying all media is bad if there was a mediaopoly.  As John Adams wrote to Jefferson, it is the widespread misunderstanding of money that enables the "perplexities, confusion and distress in America."

    Mercifully, Greco takes us up the steps of the "ladder of economic civilization" (H. Withers) to where we are currently overlooking what some observers are calling "the controlled demolition of the global financial system." (58)  At each step in the ladder, we can detect how the essence (or value basis) of money changed.  To be clear, this historical investigation is limited to reciprocal exchange which excludes gifts, involuntary transfers (taxes, theft, etc) and counterfeiting.

    1. Barter trade - Barter is the most primitive form of reciprocal exchange as it only involves two people and depends upon the "double coincidence" of needs. (90)
    2. Commodity money - The first step on the ladder is when traders began to accept commodities for their exchange value.  Traders accept the commodity because there is sufficiently high demand (or "general demand" as Greco says) for them.  (Determining which commodities can serve as money seems to be a good application of the Keynesian beauty contest).  Commodity money, of course, includes gold and silver coins and Greco points out that transactions with commodity money "essentially remained a barter trade of one thing for another." (90)  Elsewhere, Greco credits E.C. Riegel with the term "split-barter."
    3. Symbolic money - Claim checks or receipts for deposited commodities like gold or wheat are symbolic money.  What's noteworthy about symbolic money is its acceptability "derives from the fact that it can be redeemed by the holder on demand for the amount of commodity that it represents." (92)  Greco spends relatively little space on symbolic money and calls it the half step between commodity money and credit money.
    4. Credit money -  The "great monetary transformation" from commodity and symbolic to credit money (an IOU) both gave humanity the ability to expand the money supply to meet the needs of commerce and also provided a new major vector for abuse.  The origin of credit money is attributed to goldsmiths whose original business was to issue (create and put into circulation) paper receipts (symbolic money) for gold deposits.  Again, people readily accepted these paper banknotes because they could be redeemed for gold on demand.  The goldsmiths noticed that as long as they had a safe buffer of surplus gold, they could create additional banknotes.  They could create a lot more than they could spend so they started making loans with these additional banknotes.  With this new financial innovation, both credit money and fractional reserve banking were born and goldsmiths became bankers.  Do you see a problem?  Greco reveals "one of the most fundamental problems with paper money historically was the fact that both symbolic paper and credit paper were both made redeemable for gold." (94)  Inevitably, banks would run out of gold and shut down.  This failure to distinguish between symbolic paper and credit paper was the source of chronic financial instability manifested by bank runs and panics and led people to mistakenly distrust all paper money.  Greco tells us the important question to ask is "What does the paper represent?"

    Of course, as Greco points out, the redeemability of paper was abandoned and that's not a bad thing.  Let's summarize.  No money was created with barter trade, so we were not yet on the ladder.  The creation of commodity money took place simply by harvesting the earth's natural resources.  Symbolic money was created when a deposit of commodities was made.  What about credit money?  Hmmm....

    Let's try a simple thought exercise that is not necessarily consistent with Greco's explanation in the book but is partly inspired by his other writing.  Suppose Joe Customer starts with an account balance of zero.  Joe needs to buy some stuff so he applies for a credit card.  Based on some set of heuristics (this may or may not involve chickens on a roulette wheel.  In any case, hacking the process is public knowledge), the bank authorizes a credit limit of $1000.  Joe's account balance is still zero.  Each time Joe makes a purchase, Joe's account balance is deducted by the amount of purchase.  If the deduction results in Joe's account balance falling below -$1000, then the purchase is declined.  So, when was the credit money created?  When the transaction was approved, newly created credit money in the amount of the purchase was added to the merchant's account balance.  Joe's account balance dropped by the amount of the purchase and the bank earned an IOU from Joe.  Credit money is only created when Joe makes a purchase.  The bank depends on the transaction between Joe and the merchant to create the credit money.  The bank owes the merchant the amount of the purchase and Joe owes the bank the amount of purchase (thus, all money that is created represents credit obligations).  Greco again uses terminology from Withers, calling the creation of credit money "mutual indebtedness." (93)

    So, what is this "loan" business?  What happens when the bank "loans" Joe $1000?  It's like the credit limit authorization just described, except that instead of Joe's balance starting at zero after the authorization, Joe's balance starts at $1000.  Instead of payment declined at an account balance of -$1000, payment is declined at an account balance of $0.    At the time of the loan, just like the credit authorization, no credit money is created.  However, in the terms of a so-called loan, the bank requires that Joe give an IOU to the bank at the time of the loan instead of later when Joe makes one or more purchases.  Joe receives nothing in exchange for the IOU at the time of the loan.  So, ideally, by accepting the bank's terms, Joe's intention should be to use the amount of the "loan" immediately.1    Just because the bank is offering to set his account balance at $1000 instead of $0, Joe shouldn't think the bank actually loaned him anything.  The bank just authorized a credit limit and took his IOU ahead of time.  Credit money is created when it is accepted in exchange for goods or services.

    The common misuse of language reinforces the confusion around the nature of loans.  Greco shares C. Quigley's example of the abuse of the word "deposit" by the banking industry.  Quigley notes that the banking industry counts as deposits both lodged deposits and created deposits. (103)  Joe depositing his paycheck at the bank is an example of a lodged deposit.  A created deposit is one the bank makes in Joe's account when it makes a loan to Joe.  The first deposit is an asset.  The second "deposit" represents a debt.  Just because the bank calls it a deposit doesn't mean its a deposit, but calling it a deposit makes it a lot easier to profit off people like Joe by justifying a system where "people's own credit is privatized and loaned back to them at interest." (100)

    Greco acknowledges grassroots initiatives that support the return of money creation from the banking system to the national government but warns against any elite power.
    The fundamental problem with the present political money system is the monopolization of credit (money) per se, and not who happens to be the owner of that monopoly...what we really need for government to do is not to take control of the money monopoly, but to end it.

    In the next post, we'll continue with the second half of the book.

          




    1. This may happen automatically as Joe might immediately start earning token interest on the amount of the loan.  But this just proves the point as the newly created credit money has bought a badly performing investment from the bank and if it stayed there, Joe wouldn't be able to repay the loan.

    Posted over 2 years ago

  • Stupid Currency Tricks: OpenTransact with OsCurrency



    Here's another OpenTransact demo. Last time, Nubux, a simple reference implementation, was the financial service provider. This time, OsCurrency is the FSP.

    Posted over 2 years ago

  • Stupid Currency Tricks: OpenTransact Simple Web Payment



    There's been some good discussion on the Agile Banking list which includes simple web payments. This is like what we did on the previous screencast but simpler (mostly because we're not using oauth).

    The use of the callback to confirm the payment can be trouble. The callback could timeout or maybe the merchant is inside a firewall for some reason and can't be contacted from outside the firewall. In either case, If I'm selling pizzas, I'm not going to make the pizza if I don't get the callback.

    We've just started experimenting with open simple web payment protocol so there's more work to be done but think about the possibilities!

    The source code for Pelle Braendgaard's Nubux and my test merchant client are available. Both work on Heroku.

    Posted over 2 years ago

  • Stupid Currency Tricks: Payment Dropbox with OAuthActiveResource



    OAuth support with the OsCurrency API was first demonstrated in January. Ruby on Rails developers may have noticed that I didn't use ActiveResource with OAuth. Instead, in both the January screencast and the Twitter OAuth Consumer screencast, we coded in raw JSON. This was a bummer because, as easy as it is to write JSON, it is difficult to test, maintain and support. It would be much better if we could use ActiveResource.

    The good news is that Johannes Wagener has shared his OAuthActiveResource gem. The OAuthActiveResource gem was originally used for the Soundcloud API for music drop boxes. If we can have drop boxes for music, we can have drop boxes for complementary currency.

    Excited about this possibility, I created the oscurrency-ruby-api-wrapper gem to support payment drop boxes.

    It is very simple code but I did run into two problems. First, I could not use the latest 0.3.5 version of the OAuth ruby gem due to this issue with posting data that is not a hash so I had to use the 0.3.4 oauth gem on the client side. Second, the OAuthActiveResource gem currently does not use the conventional way to create a resource that is a child of another. For instance, with the soundcloud api, it posts to comments.xml instead of tracks/:track_id/comments.xml. Rather than fork the OAuthActiveResource gem to change this, I changed the site class method definition in my Exchange class which is a child of Person.

    Like the previous screencast, we're using my fork of the Roll My Blog app and Heroku to show off the payment drop box.

    In this demo, each payment is associated with a blog article but you could obviously associate each payment with a product instead. In the Payment::create method, I specify the edit method of the payment as the callback url when sending the visitor to the server to approve the payment.
    callback_url = edit_article_payment_url(@article,@payment)

    As I mention in the screencast, I didn't make any changes at all to the OsCurrency server for this demo. The big thing that is missing is that the OsCurrency server should display the amount of the payment to the blog visitor and make sure the exchange created by the blogging software does not exceed what was authorized by the blog visitor. I will leave that for next time.

    Also, I recorded some of my notes about the IIW2009a event at the Computer History Museum in Mountain View on the EFF Austin Blog. Rich and I will be speaking at the Lonestar Ruby Conference (August 27-29). If you are a Rubyist, this is a great conference that gets better every year. :)

    Posted over 2 years ago

  • Stupid Currency Tricks: Group Currencies and Heroku

    Like the last screencast, this one is a result of a feature request. About 9 months ago to the day, I met Johnny & Eva Barnett at Spiderhouse Coffee through Karen Gifford, the founder of ATEN. Johnny suggested a groups feature be added to oscurrency. This happened one week after Rich and I presented the idea of using insoshi for a currency server at One Web Day Austin and first started checking in code. Multiple improvements made to oscurrency have been a direct result of Johnny Barnett's help.

    In February of this year, Benjamin Bradley suggested some interesting use cases for this feature. The barn raising idea was interesting enough that Guillaume Lebleu blogged about it. If we're going to have groups, we'll need group currencies, too! This idea of easily created currencies is one of the components of the open money initiative supported by Michael Linton, the creator of LETS (unmoney convergence video).



    As luck would have it, there was already yuki's group_option branch for insoshi that was relatively easily merged into oscurrency.

    However, if one of the goals is to make currencies easy to create, we need software that is easy to install that does the job. Unfortunately, the search support that is included in insoshi (and therefore in oscurrency) is a bit too much for heroku.

    Therefore, I found a brand new, lightweight blogging software that accepts OpenID called roll_my_blog and forked a copy which would talk to the OsCurrency API. This blogging software is easily deployed to heroku and that is how we can easily install software to create new currencies, etc.

    Bonus: There is now some video footage of the early days of the Austin Time Exchange (the summer of '06). Among others interviewed, you can see and hear from current board members Karen, Rich and Sheila.

    Posted over 2 years ago

  • Life Inc: The Movie



    Life Incorporated via BoingBoing

    Posted over 3 years ago

  • Columbia Exchange Circle on KOMU TV



    The Columbia Exchange Circle was on TV yesterday...
    "The idea of the exchange circle is to connect community members and get people to share the skills and resources that they have in a way that does not rely on the current economy," said Maggy Rhein, another organizer for the C.E.C.

    And members say that taking the program online is the easiest way to connect.

    "People can post the request and people can see it instantly," said Vince Foley, another organizer for the group and the Web site manager.
    The Columbia Exchange Circle source code was forked by binaryseed in February of this year and is a great example of decentralized innovation on GitHub.

    Posted over 3 years ago