<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Austin Fatheree on Medium]]></title>
        <description><![CDATA[Stories by Austin Fatheree on Medium]]></description>
        <link>https://medium.com/@austinfatheree?source=rss-b4dc1d88fcbd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DztBl3dQf2_KhBuc9HUgbw.jpeg</url>
            <title>Stories by Austin Fatheree on Medium</title>
            <link>https://medium.com/@austinfatheree?source=rss-b4dc1d88fcbd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:37:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@austinfatheree/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Catallax and Enabling Financial Violence Against the State]]></title>
            <link>https://medium.com/@austinfatheree/catallax-and-enabling-financial-violence-against-the-state-5de11afe0a36?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de11afe0a36</guid>
            <category><![CDATA[demurrage]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[defundthepolice]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 00:00:00 GMT</pubDate>
            <atom:updated>2020-06-08T20:12:35.435Z</atom:updated>
            <content:encoded><![CDATA[<h3>Catallax and Enabling Peaceful Financial Violence Against the State</h3><p>The events of the last couple have been fascinating to watch. I spend a lot of time thinking about how a Catallax based society would approach some of these same issues. Specifically #DefundThePolice is fundamentally built into the underlying Catallax System.</p><p>Catallax isolates State Accounts in the system in a way that financial violence can be used against the state by the people in a couple of ways. First of all, State Accounts cannot have any kind of privacy in how funds are used. The inflows and outflows are public record by default.</p><p>In a Catallax based system each government domain has a State Account. They collect taxes via the systematic decay of currency in accounts that elect that domain. These Domain Accounts can create Agency Accounts for the various agency accounts that their collected taxes fund. The police department would be one of these agency accounts. Citizens that pay taxes into the Domain Level account get a Democratic Veto right to all agency accounts. The democratic veto is described as follows in my book <a href="https://amzn.to/2Yd2oaW">Immortality</a>:</p><h3>VTO. Democratic Veto</h3><p>… How can the <strong>(</strong><a href="https://skilesare.github.io/immortality/the_pattern_language/ctz_the_citizen.html"><strong>CTZ</strong></a><strong>)</strong>, using selective citizenship <strong>(</strong><a href="https://skilesare.github.io/immortality/the_pattern_language/scz_selective_citizenship.html"><strong>SCZ</strong></a><strong>)</strong> and the public ledger <strong>(</strong><a href="https://skilesare.github.io/immortality/achieving_supersociety/public-ledger.html"><strong>PLG</strong></a><strong>)</strong> keep the state’s power in check?</p><p><strong>Power corrupts and the citizen must have tools to regulate out of control power without the use of force.</strong></p><p>When a citizen pays taxes they should get a vote in that ‘state’. We will do this via the democratic veto.</p><p>This veto is a 3 phase vote. Citizens can vote ‘abstain’, ‘deny’, ‘override’ on a state account.</p><p>This gives power to small minorities to stop the payment from state accounts until their concerns are addressed or their negative vote is overridden by other citizens.</p><p>We also don’t want small issues gumming up the general working of the state. As a result we should provide for agency accounts that can be selectively vetoed when particular issues arise in the running of those agencies.</p><p>Therefore:</p><p><strong>Establish the democratic veto for state accounts and selective veto for agency accounts.</strong></p><p>This system allows small groups to have their voice heard and amplified. Larger groups must be proactive in overriding the veto and while this proactivity certainly hasn’t kept people from being oppressed in the past, it at least puts the burden of action on those that would seek to not meet the needs of the minority.</p><p>In a practical application, communities across the US could use the Democratic Veto to freeze the accounts of police departments across the nation and keep those accounts frozen until the departments make the demanded changes.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2020/6/8/catallax-and-enabling-financial-violence-against-the-state"><em>http://catallax.info</em></a><em> on June 8, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de11afe0a36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Catallax could soften the economic impact of pandemic]]></title>
            <link>https://medium.com/@austinfatheree/catallax-could-soften-the-economic-impact-of-pandemic-81bc9af0e9da?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/81bc9af0e9da</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[basic-income]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 04:45:00 GMT</pubDate>
            <atom:updated>2020-03-23T04:45:00.258Z</atom:updated>
            <content:encoded><![CDATA[<p>The Catallax project has been on ice for a while as we wait for the technology to catch up to the vision. ETH 2.0 and DFINITY currently are pushing forward with scalability advancements and ZK tech will have some interesting things to say about how to deal with the ‘privacy problem.’ As frustrating as it is to wait on these technologies to mature, it is even harder watching the current spread of Covid-19 and the associated recession knowing that a world with Catallax would have significantly more economic tools to help weather the storm. I’ll rip through a few of them, but if you want to know more you can check out <a href="http://catallax.info/">http://catallax.info</a> or read my book on the subject here <a href="https://amzn.to/39894up">https://amzn.to/39894up</a>.</p><h3>Cash Decays</h3><p>In a Catallax based economy cash decays overtime backward through the blockchain. This means that if you hold cash, it eventually is returned to the people that paid it to you. Now this happens slowly and it is very likely that you will have spent the cash before that happens. In scenarios like this economic trumpdown the governing system can print a lot of cash and ramp up the decay rate so that it is available to get the economy ginning again, but also decays back out of the economy quickly so that inflation is avoided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6M7IPv3sXYi4djIanC4A1Q.jpeg" /></figure><h3>Cash Decays to you</h3><p>The backflow of cash in a Catallax economy flows to the people who have spent money in proportion to how that money is used to build more value in the economy. As you spend more money over time you build up an earned basic income. The amount of your basic income payment depends on how you’ve spent your money. If you’ve spent it with sustainable and profitable businesses your income will be higher than if you spend it with companies that fail to build sustainability. Math dictates that this basic income will likely not come close to compensating for your entire income, but it is enough to help people make it through times like these with reduced employment.</p><h3>Grassroots agencies</h3><p>A portion of decay goes to support government agencies that are selected by the participants in a Catallax economy. In times like this groups can coordinate to fund new agencies with their tax dollars and cash starts flowing to those agences immediately.</p><h3>Holding Government Accountable</h3><p>In a Catallax economy, the people have the ability to shut off the account access of government agencies in order to pressure those agencies to act. Government inaction can lead to swift organization by those that participate in the system and pay taxes to those government agencies.</p><h3>Conclusion</h3><p>It is never fun to have to think about how to react to these things while in the midst of the emergency. Previously I dreamed up Harveycoin (<a href="http://catallax.info/news/2017/9/8/devlog-10-harveycoin-decentralized-disaster-relief">http://catallax.info/news/2017/9/8/devlog-10-harveycoin-decentralized-disaster-relief</a>) when it was the only thing I could do when I was evacuated from my home after the hurricane that hit Houston. Hopefully these ideas will inspire others that are currently social distancing and who have the time and ability to code these things in the new and scalable tech that is emerging. Please reach out if you’d like to talk more about these things or if you’d like to try to come up with some solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81bc9af0e9da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevLog 14 — Using a Catallax Trust to Pay Bug Bounties]]></title>
            <link>https://medium.com/@austinfatheree/devlog-14-using-a-catallax-trust-to-pay-bug-bounties-671f9bd350e9?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/671f9bd350e9</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Thu, 09 Nov 2017 16:59:21 GMT</pubDate>
            <atom:updated>2017-11-09T16:59:21.006Z</atom:updated>
            <content:encoded><![CDATA[<p>Fresh off DevCon 3 we have our first bug submitted on the Catallax Trust. Github user <a href="https://github.com/NickErrant">NickErrant</a> pointed out in this <a href="https://github.com/skilesare/catallaxtrust/issues/1">github issue</a> that a franchisee could lock up funds by pointing their payment address to a contract that throws on the fall back function.</p><p>Generally you can trust that people that want to get paid by a contract won’t do this, but in the case of a Catallax Trust the franchisee could be disgruntled about their payout or choose to protest for some other reason and lock up the contract.</p><p>The reason this can happen is that if address.transfer function fails then the function will throw. Because our withdraw() function pays out to the franchisee if they exist they can block the payment. The simple fix (and the one we’ve taken at the moment) is to use address.send instead. If this fails it just returns false and the rest of the function continues to function.</p><p>A better solution is to use the withdraw pattern and just set the money aside for the franchisee to come get later. This requires another storage variable in the contract so it has some cost.</p><p>We haven’t deployed the factory to produce this new contract yet so don’t set up a franchise contract until we do so. If you are interested in setting one of these up, please reach out to us and we will work with you to get everything setup correctly.</p><p>Nick raised a good point when reporting the bug that bug bounty contracts where you just try to steal the funds have pretty poor incentives for bug hunters. As a result, we’ve made Nick the beneficiary of the bug bounty contract. On 11/16 he’ll be able to call withdraw and get out 1/24th of the current balance.</p><p>We will leave Nick as the beneficiary until we get our next valid bug report. At that time, provided the bug is as serious as Nick’s, we will unlock the beneficiary and transfer it to the new bug hunter 36 days later.</p><p>Of course, if you’d like to try to steal the money out of the trust you can do that too.</p><p>If you’d like to use a Catallax Trust for one of your own bug bounties please reach out to us and we can help you set it up. The trust supports ETH and ERC20 tokens.</p><p>You can find the source code for the contracts here: <a href="https://github.com/skilesare/catallaxtrust">https://github.com/skilesare/catallaxtrust</a></p><p>Pull down the repo and load them up in <a href="http://remix.ethereum.org/">remix</a> to interact with the contracts.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/11/9/devlog-14-using-a-catallax-trust-to-pay-bug-bounties"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=671f9bd350e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevLog 12 — Catallax Trust Contract Code Release]]></title>
            <link>https://medium.com/@austinfatheree/devlog-12-catallax-trust-contract-code-release-f9741909a92e?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9741909a92e</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[banking]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Tue, 10 Oct 2017 02:49:28 GMT</pubDate>
            <atom:updated>2017-10-10T02:49:28.103Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m really excited to release our code for the Catallax Trust today. It has been a long time coming and it will be nice to get some new eyes on the code.</p><p>If this is your first time reading about the Catallax Trust you can read the <a href="https://drive.google.com/file/d/0B-hSYDUVwc9LVElWTnJfLUpoQm8/view?usp=sharing">white paper her</a>e. A Catallax Trust is a contract that will hold crypto and pay it out in the future in fiat-based chunks based on the exchange rate at the time of the withdrawal. I can be used for <a href="http://catallax.info/news/2017/10/3/using-a-catallax-trust-to-pay-and-get-paid-crypto-securely-and-accurately">employment contracts,</a> <a href="http://catallax.info/news/2017/10/5/giving-to-a-charity-with-strings-attached-with-a-catallax-trust">donating to a charity</a>, <a href="http://catallax.info/news/2017/10/6/give-ico-investors-more-confidence-with-a-catallax-trust">securing ICO fund</a>s, or <a href="http://catallax.info/news/2017/10/4/setting-up-a-smart-contract-recurring-income-from-your-eth-stack">simply helping you HODL with a budget</a>.</p><p>We have had one code review done and implemented a number of improvements identified in that code review. Of course, we hope that the contracts are production ready, but if you think otherwise, please let us know by sending the issue to <a href="/service/mailto:bugs@catallax.com">bugs@catallax.com</a> or filing an issue on the github repo: <a href="https://github.com/skilesare/catallaxtrust">https://github.com/skilesare/catallaxtrust</a></p><p>The Catallax Trust is made up of the following main contracts:</p><p><a href="https://github.com/skilesare/catallaxtrust/blob/master/contracts/FiatTrustCustodian.sol">FiatTrustCustodian.sol</a> — This is the custodian contract that oversees the creation of new trusts and tracks the fiat to crypto conversion rates for supported crypto / fiat pairs.</p><p><a href="https://github.com/skilesare/catallaxtrust/blob/master/contracts/FiatTrustFactory.sol">FiatTrustFactory.sol </a>— This is the factory contract that the custodian uses to create new trusts. We can swap this out if we create a better trust without having to republish the custodian.</p><p><a href="https://github.com/skilesare/catallaxtrust/blob/master/contracts/FiatTrust.sol">FiatTrust.sol</a> — This contract is the core trust. Users will deposit their ETH and / or ERC20 tokens in these contracts and be able to withdraw from them over time.</p><p>The following support contracts are included as well:</p><p>DateTime.sol — a date time library</p><p>SafeMath.sol — safe arithmetic functions</p><p>ERC20.sol — interacting with tokens</p><p><a href="https://github.com/skilesare/catallaxtrust/blob/master/contracts/TrustStorage.sol">TrustStorage.sol</a> — we have to store the historical history of crypto / fiat exchange rates. This is held in a storage contract so that we can easily move the history to upgraded custodians if necessary.</p><p>iLicensor.sol — a stub contract for future governance of the custodian</p><p>The general process for setting up the contracts follows the following process(this is the code from our test suite):</p><pre>prepEnvironment = (custodianOwner)-&gt;<br> return new Promise (resolve, reject)-&gt;<br>   custodian = null<br>   factory = null<br>   token = null<br>   storage = null<br>   #Create the custodian<br>   FiatTrustCustodian.new(from: custodianOwner).then (instance)-&gt;<br>     custodian = instance<br>     #create the factory<br>     FiatTrustFactory.new(custodian.address, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;new factory&#39;<br>     factory = instance<br>     #create a datetime library(this has been published previously on mainnet so you can use one of those)<br>     DateTime.new(from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;new DateTime&#39;<br>     #set the date time library<br>     custodian.SetDateTimeLibrary(instance.address, from: custodianOwner)<br>   .then (result)-&gt;<br>     console.log &#39;dt set&#39;<br>     #set the factory location<br>     custodian.SetFactory(factory.address, from:custodianOwner)<br>   .then (result)-&gt;<br>     console.log &#39;factory set&#39;<br>     #Create an ERC20 token to test with<br>     HumanStandardToken.new(tokenStartBalance,&quot;token&quot;,0,&#39;tkn&#39;, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;new token&#39;<br>     token = instance<br>     #create a new storage contract<br>     TokenStorage.new(from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;new storage&#39;<br>     storage = instance<br>     #set the storage contract<br>     custodian.SetStorage(storage.address, from: custodianOwner)<br>   .then (instance) -&gt;<br>     console.log &#39;storage set&#39;<br>     #update the owner of the storage to include the custodian contract<br>     storage.UpdateOwner(custodian.address, true, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;first conversion set&#39;<br>     #set an old conversion for ETH to USD<br>     custodian.SetConversion(ethTokenAddress, usdCurrencybytes, 1989,1, 1, web3.toWei(0.01,&quot;ether&quot;),1, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;conversion set&#39;<br>     #set an old conversion for ERC20 token to USD<br>     custodian.SetConversion(token.address, usdCurrencybytes, 1989,1, 1, web3.toWei(0.01,&quot;ether&quot;),1, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;max fee set&#39;<br>     #set the max fee<br>     custodian.SetMaxFee(usdCurrencybytes, 50, from: custodianOwner)<br>   .then (instance)-&gt;<br>     console.log &#39;origination fee set set&#39;<br>     #set the origination fee<br>     custodian.SetOriginationFee(usdCurrencybytes, 25, from: custodianOwner)<br>   .then -&gt;<br>     resolve<br>       custodian: custodian<br>       token: token</pre><p>Once your custodian is configured you need to create, fund, and start your trust. The following code will do that and then make time pass so you can do your first withdrawal:</p><pre>custodian.CreateTrust(ethTokenAddress, usdCurrencybytes, 12, 1, {from: accounts[0]})<br>   .then (txn)-&gt;<br>     trustAddress = null<br>     txn.logs.map (o)-&gt;<br>       if o.event is &#39;TrustCreated&#39;<br>         console.log &#39;found new Trust at&#39; + o.args.location<br>         i = FiatTrust.at(o.args.location)<br>         trustAddress = o.args.location<br>     console.log &#39;have instance&#39;<br>     #fund the wallet<br>     web3.eth.sendTransaction({ from: accounts[1], to: i.address, value: web3.toWei(0.44,&quot;ether&quot;) })<br>   .then (result)-&gt;<br>     #Start the Trust<br>     i.StartTrust(from:accounts[0])<br>   .then (result)-&gt;<br>     console.log result<br>     console.log &#39;sending ether&#39;<br>     #this function advances time in our test client by 34 days<br>     return new Promise (tResolve, tReject)-&gt;<br>       web3.currentProvider.sendAsync<br>         jsonrpc: &quot;2.0&quot;,<br>         method: &quot;evm_increaseTime&quot;,<br>         params: [86400 * 34],  # 86400 seconds in a day<br>         id: new Date().getTime()<br>       , (err)-&gt;<br>         tResolve true<br>   .then (result)-&gt;<br>     #calculate the next withdraw date<br>     i.NextWithdraw()<br>   .then (result)-&gt;<br>     console.log &#39;next &#39; + result<br>     nextPayout = result.toNumber()<br>     aDate = nextPayout * 1000<br>     aDate = moment.utc(new Date(aDate))<br>     console.log aDate<br>     console.log &#39;conversion set for &#39; + aDate.year() + (aDate.month() + 1) + aDate.date()<br>     #set the conversion for that tdate<br>     custodian.SetConversion(ethTokenAddress, usdCurrencybytes, aDate.year(), aDate.month() + 1, aDate.date(), web3.toWei(0.01,&quot;ether&quot;),1)<br>   .then (result)-&gt;#call the withdraw fucntion.  0.1 eth shold move from the contract to account[0]<br>     console.log &#39;conversion set&#39;<br>     aDate = nextPayout * 1000<br>     aDate = moment.utc(new Date(aDate))<br>     console.log aDate<br>     #check the current balance<br>     web3.eth.getBalance(custodian.address)<br>   .then (result)-&gt;<br>     console.log result<br>     startCustodianBalance = result.toNumber()<br>     assert.equal 250000000000000000, startCustodianBalance, &#39;custodian has ether it shouldnt&#39;<br>     startBalance = web3.eth.getBalance(accounts[0])<br>     console.log &#39;Start Balance&#39; + startBalance<br>     #withdraw from the trust<br>     i.Withdraw(from: accounts[0])<br>   .then (result)-&gt;<br>     console.log result<br>     web3.eth.getBalance(i.address)<br>   .then (result)-&gt;<br>     console.log &#39;withdrawl:&#39; + result<br>     assert.equal result.toNumber(), parseInt(web3.toWei(0.18,&quot;ether&quot;)) - parseInt(web3.toWei(0.01,&quot;ether&quot;)) * 0.005, &#39;withdraw wasnt right&#39;<br>     web3.eth.getBalance(accounts[0])<br>   .then (result)-&gt;<br>     console.log result<br>     #since payout is 0 eth per usd we multiply fiatpayout 1<br>     #we only test .9 eth and 1.1 because gas costs weigh in<br>     # so much gas cost<br>     #96 413397700000000000<br>     #96 502336500000000000<br>     #<br>     console.log &#39;eth increased&#39; + (result.toNumber() - startBalance.toNumber())<br>     assert.equal result.toNumber() &gt; startBalance.toNumber(), true, &#39;eth didnt transfer&#39;<br>     assert.equal result.toNumber() &lt; startBalance.toNumber() + parseInt(web3.toWei(0.01,&quot;ether&quot;)), true, &#39;too much eth transfered&#39;<br>     web3.eth.getBalance(custodian.address)<br>   .then (result)-&gt;<br>     console.log &#39;fee paid&#39; + result<br>     assert.equal result.toNumber(), 250000000000000000 + parseInt(web3.toWei(0.01,&quot;ether&quot;)) * 0.005, &#39;Fee wasnt paid&#39;</pre><p>Have fun exploring the contracts! Post questions and issues in our <a href="https://github.com/skilesare/catallaxtrust">github</a> or <a href="https://www.reddit.com/r/Catallax/">reddit here.</a></p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/10/9/devlog-12-catallax-trust-contract-code-release"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9741909a92e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Give ICO Investors more confidence with a Catallax Trust]]></title>
            <link>https://medium.com/@austinfatheree/give-ico-investors-more-confidence-with-a-catallax-trust-f459bb1df707?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f459bb1df707</guid>
            <category><![CDATA[token-sale]]></category>
            <category><![CDATA[white-papers]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[ico]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Fri, 06 Oct 2017 13:57:14 GMT</pubDate>
            <atom:updated>2017-10-06T13:57:14.067Z</atom:updated>
            <content:encoded><![CDATA[<p>The Catallax Trust has been designed to support a number of different scenarios. I’m outlining each one of these in a different post over the next few weeks as we move toward the release.</p><p>Today we are going to talk about how to use a Catallax Trust increase investor confidence in your ICO.</p><p>An ICO can funnel the proceeds of their token sale into a Catallax Trust and have it pay out a set fiat denominated amount of those proceeds to cover costs. They can further increase confidence by assigning ownership of the trust to a multi-sig account overseen by trusted members of the community.</p><p>For example, ZkCoin is holding a token sale to raise money for their ZkSnark based token. They expect to need $50,000 USD per month for the first year to get the project launched. Excitement is high and they expect to raise much more than is required. Some in the community do have some fear that the team is untrustworthy and will run off with the raised funds. To increase confidence in the token sale and project ZkCoin can create a Catallax Trust that pays out $50,000 of raised ETH each month for the first year. At the end of the year, they don’t know how much they are going to need so they assign ownership of the trust to a group of community member including members of the Ethereum Foundation. Once the trust matures these members will need to sign the withdraw function that pushes remaining funds into a new trust with an agreed upon monthly budget. If the price of ETH fluctuates wildly one of two things will happen:</p><ol><li>If the price of ETH goes up he the trust will pay out less ETH and at the end of the contract ZkCoin will get the remaining ETH back and it can be assigned to a new Trust with the agreement of the community.</li><li>If the price of ETH goes down, the trust will auto adjust the payout down so that the cash flows continue for the entire two years with funds equal to less than the desired $50,000.</li></ol><p>Using a trust for increasing confidence in your IC to a charity has a number of advantages:</p><ol><li>Investors know that a Token owner will only be able to get a set amount of ETH out of the trust per month and won’t be able to blow the full raised amount before proper learning in the marketplace has occurred.</li><li>Trust Ownership can be handed to other governing contracts like multi-sig contacts or other governance contracts like Aragon or Colony.</li><li>The trust owners can reassign the beneficiary of the trust if the project goes off the rails or dies, perhaps redirecting funds to the Ethereum Foundation.</li></ol><p>A Catallax Trust can also be used to help reduce the market manipulation risk for the issued ZkCoin by creating a ZkCoin to USD denominated Catallax Trust. Many ICOs hold back large amounts of coins to give to developers and investors in the project. By issuing these coins to a Catallax Trust that only allows a certain amount to be paid out per month the risk to investors is limited. For example, if 30% of the coins are held back to pay to developers a Catallax Trust could hold these coins and only let $10,000 worth be issued each month. As the market price of these new ZkCoins fluctuate the amount released will adjust each month and only $10,000 worth could be dumped on the market each month.</p><p>Creating the Trust and Assigning it to an ICO requires the following steps:</p><ol><li>ICO owner calls the Custodian.CreateTrust function to create a new Catallax Trust contract. This function takes a token(ETH or ERC20), a currency(USD, EUR, ect.), term(number of months), and fiat payout(amount of currency per term to pay out).</li><li>ICO Owner calls the Trust.ChangeBeneficiaryOwner function to set the beneficiary of the trust to their own address.</li><li>ICO Owner calls the Trust.ChangeOwner function and assigns ownership of the trust to a governance contract.</li><li>The ICO contract uses the trust address as the deposit location for funds raised during the token sale.</li><li>Optional: The ICO contract uses another trust address as the destination of generated developer and investor tokens.</li><li>The owning governance contract starts the trust after the crowd sale by calling the Trust.StarTrust function.</li><li>During the month the Custodian will be publishing the exchange rates between the token and the currency to the blockchain.</li><li>After one month the ICO can call the Trust.Withdraw function to get the exchange rate adjusted amount of ETH sent to their beneficiary address.</li></ol><p>If you are interested in using a Catallax Trust to manage your employment contracts please reach out to us so that we can make sure that we support the Token / Currency combinations that you would like to use.</p><p>Please head over to <a href="https://www.reddit.com/r/Catallax/comments/73spuw/discussion_catallax_trust_whitepaper_011pdf/">this thread on our Reddit</a> to pick the white paper apart and ask questions. You can <a href="https://drive.google.com/file/d/0B-hSYDUVwc9LVElWTnJfLUpoQm8/view?usp=sharing">download the Catallax Trust white paper here</a>.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/10/6/give-ico-investors-more-confidence-with-a-catallax-trust"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f459bb1df707" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevLog 10 — HarveyCoin — Decentralized Disaster Relief]]></title>
            <link>https://medium.com/@austinfatheree/devlog-10-harveycoin-decentralized-disaster-relief-ce50c4792050?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce50c4792050</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[hurricane-harvey]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[disaster-response]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Fri, 08 Sep 2017 16:33:53 GMT</pubDate>
            <atom:updated>2017-09-08T16:37:51.479Z</atom:updated>
            <content:encoded><![CDATA[<p>***Read Past the intro to hear about a set of Etherum contracts that let you donate your existing ETH today to people that need help and get it all back in the future as the disaster is mitigated.***</p><h3>Catchup:</h3><p>Another month has gone by since the last Catallax DevLog update and it has been a busy month. Work on project MCD continues and I’m still hoping to hit October 1st unless I get derailed by the project I’ll be discussing today. The most interesting news is that we participated in the dAppathon put on by BCG DV and Dvolution in LA. We launched a prototype for a service called Lannister (<a href="http://lannister.tech/">http://lannister.tech</a>) that lets you collateralize any existing or future ownable ethereum service. I’ll publish a dev log on this in the future but we have more important things to talk about today.</p><h3>Now for today’s news and request for help:</h3><p>I’m from Houston and I haven’t been home for 2 ½ weeks. I’ve seen pictures and I’ve heard stories. We’re headed back home now to a dry house with our shoulders filled with survivor’s guilt. I’m a computer programmer. I’m not a jump in a boat and pull people out of houses kind of guy. I know people like that and I’m amazed at their service. What can I do? How can I help?</p><p>I’ve started something and I need your help. One of Catallax’s core concepts is the idea that decaying money can be used to rapidly rebuild a crumbled economy. This was tried in Austria in the 1930s and was so successful that it threatened the central bank’s authority to issue currency and was shut down. <a href="http://www.lietaer.com/2010/03/the-worgl-experiment/">See the Worgl experiment</a>. Ethereum lets us try it again very easily.</p><p>We have very big plan on how to implement this in a global way that fundamentally realigns incentives in the economy. We are working on it, but we need help now. Houston is hurting and Irma is hurling toward Florida and about to create another disaster area.</p><p>So here is what I have so far. I call it <strong>HarveyCoin. </strong>Open to better names.</p><p><strong>HarveyCoin</strong> allows you to donate ETH to people who need it today and get it back over the course of the future in a guaranteed way. It is a glorified <a href="https://www.reddit.com/r/Bitcoin/comments/2b8t78/whats_hodl/">HODL</a> strategy that helps people get their homes back while you maintain your position in ETH that you plan on cashing in far in the future.</p><p>There are four use cases:</p><ol><li><strong>Donate</strong>. Donate your ETH today by creating a HarveyWallet and minting new <strong>HarveyCoin</strong>. There is a 1:1 relationship between <strong>HarveyCoin</strong> and ETH. Your ETH will be given out to people in need over the next 5 years and will decay back to you over that time. So if you donate 5 ETH today you’ll be able to reclaim 1 ETH in a year, 1 ETH the year after that, etc.</li><li><strong>Become a Service Provider</strong>. Create a HarveyWallet and begin accepting <strong>HarveyCoin</strong> for your services today. The ETH you make by selling your services will decay at a stiff ~20% rate, but per day this is fairly low if you work with your fellow vendors and employees to get them onto the system as well and can turn over your HarveyCoin quickly.</li><li><strong>Get help</strong>. Apply to the custodian to get disaster relief funds in the form of <strong>HarveyCoin</strong> in your HarveyWallet. You’ll be free to spend the <strong>HarveyCoin</strong> with any approved vendors or other citizen that has a HarveyWallet.</li><li><strong>Exchange ETH for HarveyCoin</strong>. Exchange cash or ETH to get more <strong>HarveyCoin</strong>. This lets people who are dead ends in the ecosystem get value out the system for their <strong>HarveyCoin</strong>. If the system is successful this should maintain as close of a 1:1 relationship between HarveyCoin and ETH as possible. This gives us a good barometer of the system’s success.</li></ol><p>If you have ETH today that you plan on holding for a long time your only downside is liquidity. <strong>HarveyCoin</strong> helps you resist fear, uncertainty, and doubt while building the utility case for Ethereum.</p><p>There is no profit built in for the custodian in the initial contracts. The custodian can issue itself some <strong>HarveyCoin</strong> for administrative purposes, but I’m hoping this can be kept to a bare minimum and will keep the custodian true to making sure that <strong>HarveyCoin</strong> is as valuable as possible as it is the only funds that the custodian will be able to get access to.</p><p>You can find the command center for this project on <a href="https://www.reddit.com/r/Catallax/comments/6yvwcn/devlog_10_harveycoin_decentralized_disaster_relief/">r/Catallax here</a>. Please hop over and find a way to help.</p><p>Things we need:</p><ol><li>The initial contracts need to be vetted and can be found <a href="https://github.com/skilesare/harveycoin/tree/master/contracts">here</a>. I’m hoping to build some truffle tests in the near future as real life allows. I wrote these quickly and they need some serious TLC before going live.</li><li>Wallets for iOS and Android that make it dead simple to trade <strong>HarveyCoin</strong>. I know react-native has some issues with implementing web3, but maybe there is a cordova/phonegap solution that can be put together quickly.</li><li>Suggestions for the governance structure. Right now the custodian just has an owner, but we can easily set that to a multisig wallet or some other governance structure. All suggestions welcome here. I don’t have the talent, training, or bandwidth to run a significant disaster recovery effort all by myself.</li><li>A web app that directs the 4 use cases to relevant web apps that can capture info needed to approve wallets.</li><li>Someone to write the exchange contracts.</li></ol><p>I’ll quickly go through the basics of the contract:</p><h3>HarveyCustodian</h3><h3>Members:</h3><p>uint drain — holds decayed funds available to be claimed by minters</p><p>address treasury — the treasury wallet that minted funds go into for dispersal. Also a HarveyWallet and subject to decay.</p><p>uint totalMinted — the total donated</p><p>uint totalDrained — the total reclaimed</p><p>address owner — owner of the custodian</p><p>mapping(address =&gt; bool) validWallets — allows the custodian to authorize HarveyWallets to participate in the system.</p><p>address[] wallets — a list of wallets that have participated with the system for iteration.</p><h3>Functions:</h3><p>setOwner — sets the owner of the custodian</p><p>setTreasury — sets the treasury wallet</p><p>mint — forwards funds to the treasury</p><p>unMint — allows minters to claim funds out of the drain</p><p>sendDecay — deposits decay with the custodian</p><p>setValidWallet — sets the validity of the wallet</p><p>calcVested — calcs the % vested over a 5 year period of a donation</p><p>availableToRedeem — calcs the amount available to be withdrawn given a minted amount, redeemed amount, and startTime</p><h3>HarveyWallet</h3><h3>Members:</h3><p>mapping(address =&gt; bool) owner — holds the owner status of the wallet. Allows for multiple owners</p><p>address custodian — the custodian overseeing the wallet</p><p>uint lastCatchup — records the last time the wallet paid the decay fee</p><p>uint mintStart — records the time the wallet minted(you can only mint once)</p><p>uint minted — amount minted</p><p>uint redeemed — amount redeemed already</p><h3>Functions:</h3><p>setOwner — sets the address and validity of an owner</p><p>pay — pays an amount to another valid HarveyWallet.</p><p>calcCatchup — calculates how much this wallet owes in decay fees.</p><p>catchup — pays the decay fee to the custodian.</p><p>mint — donates ETH to the treasury that can be claimed back as time moves forward.</p><p>unMint — claims back ETH from the drain</p><p>Please hop over to <a href="https://www.reddit.com/r/Catallax/">r/Catallax</a> to discuss more.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/9/8/devlog-10-harveycoin-decentralized-disaster-relief"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce50c4792050" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dev Log 9 — New OpCodes and Schedule Update]]></title>
            <link>https://medium.com/@austinfatheree/dev-log-9-new-opcodes-and-schedule-update-b85addbf2a79?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b85addbf2a79</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[metropolis]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Mon, 07 Aug 2017 15:14:45 GMT</pubDate>
            <atom:updated>2017-08-07T15:14:45.809Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been about a month since the last update and the reason is that I’ve been coding like crazy.</p><p>I’ve discovered some cool stuff coming in metropolis that will make Project Sigmund a much better and more useful project. The opCodes are returndatasize and returndatacopy. I’m going to have to start learning some assembly for this so if you have some good suggestions on where to gets started with assembly, let me know. I want to do something like this:</p><pre>bytes results;</pre><pre>bool testresult = aContract.call(sig, _1);</pre><pre>if(result == false) throw;</pre><pre>assembly {</pre><pre>// retrieve the size of the code, this needs assembly</pre><pre>let size := returndatasize()</pre><pre>returndatacopy(results,0, size)</pre><pre>}</pre><pre>return results;</pre><p>As a result of this discovery, I’m moving Project Sigmund Back to after Metropolis comes out. I’ve been very busy with Project MCD. As of today, I have the contracts feature complete and there is just a bit of refactoring to come. Then, on to the web app. I’m don’t think I’m going to hit my original August 15th deadline, and I now would like to have it mostly ready to go by August 24th when I’m heading out to LA to participate in the <a href="http://dappathon.com/">Dappathon</a>. If you are going to be there, please let me know. I’d love to sync up and I’m still looking for a team to participate with.</p><p>The coding on these contracts is giving more perspective and I’m pretty sure that Project BMP is a no go because they just take too long to build and I really like the direction I’m going for a full featured Catallaxian set of contracts in Project Wall-e so I may just jump into those after MCD goes live.</p><p>I’ve also got a good bit of legal advice on Project CANb. As you know the SEC ruled on the DAO and that is really steering me away from a token based project. We’ll see if there is a good solution or not, but i’m still hoping to get the basic white paper ready to shop around at DevCon. I may have to leave the idea on the cutting room floor, but hope remains.</p><p>Here is the updated schedule</p><ul><li>Project Sigmund — August 15th, 2017(delayed to after Metropolis)</li><li>Project MCD — October 1st, 2017(Expected August 24th)</li><li>Project BMP — November 1st, 2017 (DevCon3) (In jepordy of being cancled)</li><li>Project CANb — April 1st, 2018(Facing legal hurdles)</li><li>Project WALL-e — August 1st, 2018(May get moved up)</li></ul><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/8/7/dev-log-9-new-opcodes-and-schedule-update"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b85addbf2a79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Catallax — Dev Log 8 — Project Timeline]]></title>
            <link>https://medium.com/@austinfatheree/catallax-dev-log-8-project-timeline-7aff34e9072f?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aff34e9072f</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[ico]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Mon, 10 Jul 2017 13:51:50 GMT</pubDate>
            <atom:updated>2017-07-10T13:52:37.313Z</atom:updated>
            <content:encoded><![CDATA[<p>Today is a short update. The last week and a half have been pretty full of 3-hour feeding cycles trying to get my new son up from 6lbs. to 7lbs. We hit 7 this morning. Great Success. As a result, this week has been light on the coding side of things as the day job has been getting almost all available cycles.</p><p>The coding that I have been doing has been scoping out the framework for our first “real-world product.” Since it is all theoretical so far I’m not quite ready to show any of it off. What I have done is put together a very aggressive timeline of the Catallax project. I’ll offer it here without many details. Feel free to hold my feet to the fire. I’m sure we’ll see some slippage, but if I don’t set some hard goals I’ll just stay in the learning phase forever.</p><ul><li>Project Sigmund — August 15th, 2017</li><li>Project MCD — October 1st, 2017</li><li>Project BMP — November 1st, 2017 (DevCon3)</li><li>Project CANb — April 1st, 2018</li><li>Project WALL-e — August 1st, 2018</li></ul><p>This is a pretty aggressive schedule and has me building 3 production level dApps by DevCon. I kind of doubt the 3rd one will be ready, but I hope that the first two will be. Sigmund and MCD do not have any kind of ICO component. I’m hoping that they will be solid, real-world products that can provide some revenue for the remaining development.</p><p>Project BMP is a really exciting experiment in Catallaxian economics and I hope I can have some of it ready for DevCon.</p><p>CANb and WALL-e are big, epic projects that require a lot of jumping through regulation hoops and infrastructure creation. I’ve given them a little more runway.</p><p>Next week I hope to have some lessons learned from my development on Sigmund.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/7/10/dev-log-8-project-timeline"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aff34e9072f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loans and New Type of Capital]]></title>
            <link>https://medium.com/@austinfatheree/loans-and-new-type-of-capital-f94297e6db58?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94297e6db58</guid>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[erc20]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Mon, 03 Jul 2017 02:47:11 GMT</pubDate>
            <atom:updated>2017-07-03T02:47:11.657Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the fifth part in a five part series of posts that lay out the basics of what we are trying to build with Catallax. The series will follow the following schedule and I’ll update the list with links as the articles go live:</p><ol><li><a href="http://catallax.info/news/2017/6/4/get-to-know-catallax-demurrage-catch-up-and-pref-dividends">Demurrage, Catch Up, and Pref Dividends</a></li><li><a href="http://catallax.info/news/2017/6/9/get-to-know-catallax-passthroughs-legacy-and-folding-the-blockchain">Passthroughs, Legacy, and Folding the Blockchain</a></li><li><a href="http://catallax.info/news/2017/6/18/g9ftz7szajub8q0fmsb3akuqw6mku9">Privacy, Accounts, and Transparency</a></li><li><a href="http://catallax.info/news/2017/6/25/get-to-know-catallax-selective-citizenship-and-citizen-overridec">Voluntary Organization and Citizen Override</a></li><li><a href="http://catallax.info/news/2017/7/2/loans-and-new-type-of-capital">Loans and a new kind of Capitalist</a> (today)</li></ol><p>One way to offload the responsibility of paying a decay fee is to loan your cash to someone else so that they pay the fee instead. Loans under the Catallax system have some important properties that are important to discuss and that make apparent the power of this new economic system.</p><p>When a loan is made in the Catallax system it is done via a particular kind of loan smart contract. This contract has the unique ability to remove prefs from circulation when a borrower pays cash back to a lender. This is important because we don’t want symbiotic small circles forming in our economic ecosystems.</p><p>Lenders will lend a borrower cash and in return get prefs in that borrower’s account. They hold onto these prefs (as well as the loan amount) until payments start coming back the other way. When a borrower pays back some of the loan the prefs will be removed from the lender’s ledger. During the length of the loan the lender will benefit not only from the interest charged but from the pref payments coming from the borrower. If the borrower is using the the cash for building a business it may become prudent for the lender to forgive the loan balance to maintain a pref balance with the borrower.</p><p>This turns lenders into a new kind pseudo banker/venture capitalist. We believe that a large number of balances will be forgiven and that this will form a new, more personal, relationship between bankers and borrowers. Bankers now can find a long term benefit by helping their clients become more profitable and driving revenue to their accounts.</p><p>Another effect this should have is driving interest rates to very low levels. When people are wanting to loan out cash instead of having it decay the amount of capital available should increase and form a very competitive market for rates.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p>You can discuss this article and more at our reddit page <a href="http://reddit.com/r/Catallax">r/Catallax</a>.</p><p><em>Originally published at </em><a href="http://catallax.info/news/2017/7/2/loans-and-new-type-of-capital"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94297e6db58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storage Contracts, Mappings, and ETL — Dev Log 8]]></title>
            <link>https://medium.com/@austinfatheree/storage-contracts-mappings-and-etl-dev-log-8-94e87ccf4e23?source=rss-b4dc1d88fcbd------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e87ccf4e23</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Austin Fatheree]]></dc:creator>
            <pubDate>Fri, 30 Jun 2017 00:44:43 GMT</pubDate>
            <atom:updated>2017-06-30T00:45:42.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>Weekly Update</h3><ol><li>Did I mention I was a father again? Not a whole lot of coding this week as I’m trapped in the whirlpool of 3 hour feeding cycles. Never fear though we do explore something of value today.</li><li><a href="http://amzn.to/2up9OHF">My book Immortality</a> is up to #123 in the Kindle Store &gt; Kindle eBooks &gt; Nonfiction &gt; Politics &amp; Social Sciences &gt; Philosophy &gt; Metaphysics category on the kindle store. Watch out world.</li><li>I purchased my various tickets to <a href="https://ethereumfoundation.org/devcon3">DevCon3</a>. Look out Mexico, Here I come!</li></ol><h3>The Code</h3><p>Today’s post isn’t very long but I think it will help answer some questions for others who have been confused by the storage system in Ethereum.</p><p>There are a number of good pieces of info out there that talk about how you should handle storage for more complicated contracts. The basic idea is that you create a storage contract to hold all of your data so that if your master contract needs to be replaced you can just deploy a new contract and point the storage to a new place. Here are a few articles on how some of this works:</p><p><a href="https://blog.colony.io/writing-upgradeable-contracts-in-solidity-6743f0eecc88">https://blog.colony.io/writing-upgradeable-contracts-in-solidity-6743f0eecc88</a><br><a href="https://ethereum.stackexchange.com/questions/13167/are-there-well-solved-and-simple-storage-patterns-for-solidity">https://ethereum.stackexchange.com/questions/13167/are-there-well-solved-and-simple-storage-patterns-for-solidity</a><br><a href="https://ethereum.stackexchange.com/questions/15930/pushing-pulling-data-from-data-storage-contract">https://ethereum.stackexchange.com/questions/15930/pushing-pulling-data-from-data-storage-contract</a><br><a href="http://solidity.readthedocs.io/en/develop/miscellaneous.html">http://solidity.readthedocs.io/en/develop/miscellaneous.html</a></p><p>The colony article is really interesting and they end up setting a place for all different kinds of data. As it is difficult to predict what kinds of data you are going to have I thought it would be interesting to think about how to make this more generic. This gets especially difficult when you start doing mappings of mappings. This is going to be important for our <a href="https://catallax.info/news/2017/5/19/a-decaying-token-building-catallax-on-ethereum-week-3">decaying tokens</a> as we are going to need to keep track of transaction inputs in a mapping(address =&gt; mapping(address =&gt; amount)) such that we can get data you like prefs[reciver][payer]</p><p>My little example looks at allocating ERC20 allowances and how to store those:</p><pre>contract MapTest {<br>        <br>        //store approvals the old fasioned way<br>        mapping(address =&gt; mapping(address =&gt; uint256)) public approvals;<br>        <br>        //store allowences with a sha-3ish key of the combined address<br>        mapping(bytes32 =&gt; uint256) public approvalsKeccak256;<br>        <br>        //store allowences with a <br>        //sha3-ish key of variable type + comibed address<br>        mapping(bytes32 =&gt; uint256) public genericStore;<br>        <br>        function MapTest(){<br>    <br>        }<br>        <br>        function AddAllowanceMap(address sender, <br>                                address recipient, <br>                                uint256 amount){<br>            approvals[sender][recipient] = amount;<br>        }<br>        <br>        function AddAllowanceKeccak256(address sender, <br>                                        address recipient, <br>                                        uint256 amount){<br>            approvalsKeccak256[keccak256(sender,recipient)] = amount;<br>        }<br>        <br>        function AddAllowanceGeneric(address sender, <br>                                    address recipient, <br>                                    uint256 amount){<br>            genericStore[keccak256(&#39;allowance&#39;, sender, recipient)] = amount;<br>        }<br>        <br>    }</pre><p>If you load this up into Remix and run each function with “0x1”,”0x3&quot;,100 you will see that the gas cost is just about the same for each instance.</p><p>This is pretty powerful as we can now keep all of our mappings in one place. This violates all kinds of separations of concerns and may be a bad idea, but it will make the code in our stage contract much cleaner. So if we are going to violate the separation of concerns, let’s go all the way and build a generic storage contract that can be ETLed if we need to copy data.</p><p>Here is the basic generic storage contract.</p><pre>contract StorageTest {<br>        <br>        //keep track of if we have seen this key before or not<br>        mapping(bytes32 =&gt; bool) public genericStoreExists;<br>        <br>        //a place to put our data<br>        mapping(bytes32 =&gt; bytes32) public genericStore;<br>        <br>        //a place to keep track of our keys.  Out of order...but still, we<br>        //have them<br>        bytes32[] public genericIterator;<br>        <br>        //keep track of the number of keys we are storing<br>        uint256 public genericCount;<br>        <br>        function StorageTest(){<br>    <br>        }<br>        <br>        <br>        //store our data<br>        // We assume that your variable name has been convered to <br>        // bytes32.  You can do this via a keccak or converting string to bytes<br>        // We assume you have keccaked your variable path<br>        // We assume that all values are cast to bytes32<br>        function PutValue(bytes32 _dataGroup, bytes32 _kecKey, bytes32 _value){<br>            <br>            bytes32 key = keccak256(_dataGroup, _kecKey);<br>            return PutValueRaw(key, _value);<br>        }<br>        <br>        function PutValueRaw(bytes32 key, bytes32 _value){<br>            <br>            genericStore[key] = _value;<br>            if(genericStoreExists[key] == false){<br>                genericStoreExists[key] = true;<br>                genericIterator.push(key);<br>                genericCount = genericCount + 1;<br>            }<br>        }<br>    <br>        <br>        //get the raw bytes<br>        function getBytes(bytes32 _dataGroup, bytes32 _kecKey) constant returns(bytes32){<br>            bytes32 key = keccak256(_dataGroup, _kecKey);<br>            return genericStore[key];<br>        }<br>        <br>        //get integers<br>        function getInt(bytes32 _dataGroup, bytes32 _kecKey) constant returns(uint256){<br>            bytes32 key = keccak256(_dataGroup, _kecKey);<br>            return uint256(genericStore[key]);<br>        }<br>        <br>        //get addresses<br>        function getAddress(bytes32 _dataGroup, bytes32 _kecKey) constant returns(address){<br>            bytes32 key = keccak256(_dataGroup, _kecKey);<br>            return address(genericStore[key]);<br>        }<br>        <br>        //get bools<br>        function getBool(bytes32 _dataGroup, bytes32 _kecKey) constant returns(bool){<br>            bytes32 key = keccak256(_dataGroup, _kecKey);<br>            bytes32 value = genericStore[key];<br>            if(value == 0x0){<br>                return false;<br>            }<br>            else{<br>                return true;<br>            }<br>            <br>        }<br>        <br>        <br>        //not sure about arrays<br>        //not sure about enums<br>    }</pre><p>There is more work to do here, but the basics are here. Try putting in some data by creating a contract in remix and then submitting PutValue with “0x0000000000000000000000000000000000000000000000000000000000000001”,”0x0000000000000000000000000000000000000000000000000000000000000001&quot;,””0x0000000000000000000000000000000000000000000000000000000000000014&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVhv3W8MqcYzExQ0a56HPQ.png" /></figure><p>Once that is complete, call getInt with “0x0000000000000000000000000000000000000000000000000000000000000001”,”0x0000000000000000000000000000000000000000000000000000000000000001&quot; and you should get out 20. It works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IJoD4djXz_7j5XwuuZz2A.png" /></figure><p>We can also ETL(Extract, Transform, Load) this contract. Here I’ve built a small data copy contract that will move data from this storage to another storage contract of the same type:</p><pre>contract StorageCopy {<br>        <br>        StorageTest public Source;<br>        StorageTest public Target;<br>        uint256 public CurrentItem;<br>        <br>        <br>        function StorageCopy(address _source, address _target){<br>            Source = StorageTest(_source);<br>            Target = StorageTest(_target);<br>        }<br>        <br>        function DoCopy() returns (uint256){<br>            uint256 SourceCount = Source.genericCount();<br>            for(uint256 i = CurrentItem; i &lt; SourceCount; i++){<br>                Target.PutValueRaw(Source.genericIterator(i), Source.genericStore(Source.genericIterator(i)));<br>                //keep track of where we are in the process<br>                CurrentItem = i;<br>                //todo:  scheme to check remaining gas and bail if gas gets too low<br>                //next call will start with Current item<br>                <br>            }<br>        }<br>        <br>    }</pre><p>Create two StorageTest contracts in Remix. Call PutValue on the first contract with “0x1”,”0x1&quot;,”0x0000000000000000000000000000000000000000000000000000000000000001&quot; and “0x2”,”0x2&quot;,”0x0000000000000000000000000000000000000000000000000000000000000002&quot;. Now create a StorageCopy contract and pass in the addresses of your two created cotracts like this: “0x0971b5d216af52c411c9016bbc63665b4e6f2542”,”0xde6a66562c299052b1cfd24abc1dc639d429e1d6&quot; where the addresses are what Remix generated for you. Call the DoCopy Function and the data should copy over.</p><p>You should now be able to call getInt with “0x2”,”0x2&quot; on the second StorageTest contract and get out the 2 value you put in for that dataGroup / mapping address pair. It works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8sM8LwwXgsr8dssGI3_EmA.png" /></figure><p>There is a lot left undone here. You’d want to secure the data contract. You also are going to have to deal with gas limits as the comments in the comments say. There are some data types that I’m not sure how to handle yet. Arrays could be particularly difficult. You might be able to save a ton of gas by writing some native assembly in here as well. All in all, though, this is a decent footprint for a basic storage contract.</p><p>If this is interesting to you and you’d like to see where we are going with <a href="http://catallax.info/">Catallax</a>, please pick up my book <a href="http://amzn.to/2rndLie">Immortality</a> (Purchase of a physical or kindle copy helps support this project).</p><p>Donations always accepted at:</p><p>BTC: 1AAfkhg1NEQwGmwW36dwDZjSAvNLtKECas</p><p>ETH and Tokens: 0x148311c647ec8a584d896c04f6492b5d9cb3a9b0</p><p>If you would like more code articles like this please consider becoming a <a href="https://www.patreon.com/catallax">patron on patreon.</a></p><p><em>Originally published at </em><a href="https://catallax.info/news/2017/6/29/storage-contracts-mappings-and-etl-dev-log-8"><em>catallax.info</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e87ccf4e23" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>