<?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[Multis - Medium]]></title>
        <description><![CDATA[Stories from the humans who buidl Multis - Medium]]></description>
        <link>https://medium.com/multis?source=rss----309cb9d1dee4---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Multis - Medium</title>
            <link>https://medium.com/multis?source=rss----309cb9d1dee4---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:59:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/multis" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making DeFi Beautiful: The Multis App Revamp]]></title>
            <link>https://medium.com/multis/making-defi-beautiful-the-multis-app-revamp-6d5f72cb2b?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/6d5f72cb2b</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Samantha Fields]]></dc:creator>
            <pubDate>Mon, 22 Jun 2020 08:58:38 GMT</pubDate>
            <atom:updated>2020-06-23T12:03:46.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HBVWo8mFTFFs-sJ3FSMZHQ.png" /></figure><p>We got a makeover and we think you’ll love it. Why? Because even though blockchain and decentralized finance offers some of the most revolutionary services around for businesses wanting to make the most of their crypto, the user experience is often lacking.</p><p>It’s been said many times that <a href="https://www.smeweb.com/2019/07/16/blockchain-design-problem/?cli_action=1591978809.095">blockchain has a UX problem</a>. When most people think of crypto banking, they might imagine a <a href="https://cointelegraph.com/ethereum-for-beginners/how-to-mine-ethereum-guide-for-beginners">warehouse full of ASIC</a> mining rigs or long lines of code. When the focus is squarely on the tech, we neglect a <a href="https://medium.com/multis/multis-creating-value-for-entrepreneurs-10ddb05a0862">larger conversation</a> around economic empowerment that blockchain and decentralized finance can bring to all of us- especially to SMBs.</p><p>This is why at Multis, from the beginning, user interface and UX have been a priority. An elegant user interface is a gateway to the DeFi protocols that can empower millions of small businesses. When we started, our banking interface got lots of<a href="https://bankless.substack.com/p/how-to-bank-your-business-without"> praise for its UX</a> but we knew we could go further, and we’re pleased to announce that we have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9oGbAX6-dLypKnvPpxyDjg.gif" /><figcaption>We love our new dashboard, it looks even more like a neobank 🤩</figcaption></figure><p>Our revamped app is more visual, more holistic, and even stronger than its first iteration. We’re especially proud of our dashboard which provides a consolidated overview of funds and transactions for an even more neobank-like experience. Speaking of neobanks, actors like Revolut or Mercury offer beautiful interfaces, but behind an attractive UX is the same traditional banking structures who notoriously underserve small businesses. Our revamp isn’t just cosmetic- it’s also internal: we’ve strengthened and streamlined our “transactions” and “counterparties” sections for a more reliable experience. For more on this, we’ll be getting in to the technical details of this revamp and our amazing partnership with <a href="https://thegraph.com/">TheGraph</a> later on in the month, so stay tuned!</p><p>Of course, writing about UI is like dancing about architecture. The best thing to do is experience this revamp for yourself and <a href="http://app.multis.co/">login to your account</a>. If you don’t have an account, get on our waiting list for a <a href="http://multis.co/">1 month free trial</a>. We know that seeing is believing. When entrepreneurs see that there is a better, easier way to make the most of their crypto — to pay salaries, <a href="https://medium.com/multis/our-new-compound-integration-lets-your-company-earn-interest-on-crypto-80e7f4379b7d">earn high interest</a> on their treasury, and <a href="https://medium.com/multis/introducing-direct-transfers-a-new-way-to-streamline-crypto-spending-with-your-team-ab44945e5a5e">streamline business spending</a>- then the choice is easy to make. We believe that economic freedom is the first step towards empowerment and we know that this revolution will not be ugly.</p><p>You can get on our waiting list for an account and <a href="http://www.multis.co/">get 1 month free here</a>. Are you interested in building the future of banking? <a href="https://www.welcometothejungle.com/en/companies/multis">We’re hiring.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d5f72cb2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/making-defi-beautiful-the-multis-app-revamp-6d5f72cb2b">Making DeFi Beautiful: The Multis App Revamp</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gasless MULTISig]]></title>
            <link>https://medium.com/multis/gasless-multisig-1effc4700aad?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/1effc4700aad</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[multisig]]></category>
            <category><![CDATA[transaction-fees]]></category>
            <dc:creator><![CDATA[Nizar]]></dc:creator>
            <pubDate>Thu, 16 Jan 2020 09:20:26 GMT</pubDate>
            <atom:updated>2020-01-16T09:20:26.214Z</atom:updated>
            <content:encoded><![CDATA[<h4>Multis and the Gas Station Network</h4><h3><strong>Introduction</strong></h3><p>Today, in order to use their Multis’ account (send a transaction, change account parameters on the blockchain, etc.), users must pay a network fee called gas, payable only in ETH. Given the nature of Multis’s multisignature smart contracts (an account is managed by a team), account owners need to have enough funds in their <strong><em>personal</em></strong> wallets in order to use their <strong><em>shared</em></strong> Multis account.</p><p>You can already see the pain: companies need to either fund their owners personal accounts as needed, to cover for network fees in anticipation, or owners can keep track of their personal expenses and frequently submit refund requests. This causes a lot of confusion, but also a lot of friction when it comes to UX.</p><p>This post is an overview of the work Multis has been doing to tackle this challenge.</p><h3><strong>Enter the Gas Station Network (GSN)</strong></h3><p>The <a href="https://gasstation.network/">Gas Station Network</a> is an effort lead by <a href="https://gsn.openzeppelin.com/">OpenZeppelin</a>, <a href="https://www.tabookey.com/">Tabookey</a> and <a href="https://portis.io/">Portis</a> to solve this problem, by allowing users of a smart contract to send transactions without needing to pay for gas themselves. Sounds like magic? Let’s dive in.</p><h4><strong>GSN in a nutshell</strong></h4><p>Signing Ethereum transactions is free, broadcasting them to the blockchain on the other hand is what costs gas. In a GSN configuration, owners only sign transactions and then request that they be broadcasted by a relayer. This relayer is going to be the one effectively broadcasting the signed transaction and paying for the gas.</p><h4><strong>Gas Funding</strong></h4><p>In order for the relay to pay for gas on behalf of users, companies need to deposit funds for the relay to use. When funds run out for a specific company, owners will be invited to pay gas fees as usual, abstracting away the GSN machinery. Furthermore, the process of funding the relay and paying for gas fees happens autonomously by the use of smart contracts, effectively removing the need for a trusted third party.</p><h4>Autonomous Network</h4><p>The network is orchestrated by a single smart contract instance called the <strong><em>RelayHub</em></strong>, which keeps track of off-chain relayers, handles relayed transactions, and ensures all parties are honest, removing the need to trust any single relayer.</p><p>Relayers are thus part of a trustless P2P network, where anyone can participate by running a relayer (and earn money by charging contracts for pushing transactions into the Ethereum blockchain).</p><h3><strong>Upgrading smart contracts</strong></h3><p>In order to participate in the Gas Station Network, a smart contract needs to be GSN-capable, that is, to implement a function responsible for receiving relayed calls (discussed later), but under the hood, Multis uses the Gnosis Multisig smart contracts, which were written before GSN and thus are not GSN-capable. Multis is forking Gnosis to implement GSN-capable multisignature smart contracts.</p><h4><strong>Extending Gnosis Multisigs</strong></h4><p>Multis is <a href="https://github.com/multis/multisig">forking</a> the <a href="https://github.com/gnosis/MultiSigWallet">Gnosis Multisig</a> in order to do the following:</p><ol><li>Allow for <strong>free account creation</strong>: today, opening a Multis account means deploying an instance of the Gnosis Multisig, the gas fees for such an operation need to be paid by the user deploying the contract. By making the Gnosis factory GSN-capable, Multis is going to be capable to offer its users free account creation, by paying gas on their behalf.</li><li>Once an account created through Multis, allow companies to <strong>pay for gas on behalf of their own users</strong>. This means forking the actual deployable multisignature Gnosis smart contract and making it a valid GSN Recipient.</li></ol><p>For this work, Multis is using <a href="https://openzeppelin.com/sdk/">OpenZeppelin SDKs</a>.</p><h4>Accepting relayed calls via GSN</h4><p>In order to be a valid GSN Recipient, a smart contract needs to implement a function called acceptRelayedCall. This function’s responsibility is to instruct the relay hub to either go ahead and execute a transaction or to reject it. Payment strategies, if any (eg. who gets free gas and who doesn’t), need to be implemented here.</p><h4>Payment strategies</h4><p>There are multiple payment strategies, that is, to accept or reject a relayed call via the Gas Station Network (GSN), you can, for example, have a white list of trusted users, only allow relayed calls for a subset of functions or even delegate your logic off-chain.</p><p>What got our attention however was the possibility to charge users in tokens (issued by Multis, as we will discuss later), automatically getting free gas simply by holding them.</p><p>It’s also important to note that relayed call requests can be rejected at no cost to the recipient.</p><h4>Writing GSN-capable smart contracts</h4><p>As discussed earlier, there are two aspects to a <strong>Multis account</strong>, first its <strong>creation</strong>, technically deploying your own instance of the multisignature smart contract and second, its <strong>usage</strong>, which happens out of your own self-custodian instance managed only by owners you included in the creation step, or added to your account later on.</p><p>Let’s discuss how gasless transactions happen at each of these levels.</p><h4><strong>Account creation</strong></h4><p>Account creation happens through the Multisig Factory managed by Multis. Paying gas fees on behalf of users for the creation phase means funding the Factory by depositing ETH to the GSN Relay hub. This way, anyone trying to create an account throught Multis will not have to pay for gas.</p><p><strong>Protection from spam</strong></p><p>Since Multis is going to be paying for account creation gas, we needed a way to protect ourselves from a malicious attacker draining the factory funds by creating multiple accounts.</p><p>This is where we want to introduce the <strong><em>CryptoDreamers Token</em></strong>.</p><h4><strong><em>CryptoDreamers Token</em></strong></h4><p>The CryptoDreamers Token (CDT) is a token issued by Multis, simply holding it allows you to pay for gas in the process of creating a Multis account, with a 1:1 ratio to ETH.</p><p>CDT is deployed at the following addresses:</p><ul><li>mainnet - <a href="https://etherscan.io/token/0x1c4d5ca50419f94fc952a20dddcdc4182ef77cdf">0x1c4d5ca50419f94fc952a20dddcdc4182ef77cdf</a></li><li>rinkeby - <a href="https://rinkeby.etherscan.io/token/0xfabeb0a74538575ce58de2d54ddef4fe2cec4698">0xfabeb0a74538575ce58de2d54ddef4fe2cec4698</a></li></ul><p><strong>GSNRecipientERC20Fee</strong></p><p>Technically, CDT is an implementation of the GSNRecipientERC20Fee interface, this is a rather complex payment strategy, but since it comes built-in with OpenZeppelin SDKs, integrating it was straight forward, since it boils down to extending your contract with both a GSNRecipientERC20Fee and a MinterRole so you can issue tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*6QnRCtcwocn4oijhMQsINQ.png" /><figcaption>Multis Factory</figcaption></figure><p>All you have to do next is implement your minting strategies, and most importantly, only accept relayed calls for users holding your token. Below is how Multis is doing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nQcGoakYSdIzQb5gkXfaw.png" /></figure><p>It’s important to note that CDT is to be seen as a kind of a reward, or fidelity points, it has no “coin” ambitions outside of allowing us to offer free gas to select users.</p><p>It’s also worth noting that the process is going to be transparent for the user: Multis is going to automatically check if a user holds CDT and offer free account creation accordingly, without any action required from users.</p><p><strong>Account usage</strong></p><p>Paying gas fees on behalf of users for daily account usage is different, it’s not a one time operation like account creation, and since Multis accounts are self-custody, we can’t operate a CDT fee mechanism. The only way to offer free gas for this scenario is through directly funding accounts, or what we like to call it: top-ups.</p><p>As of writing, Multis has decided to pay for gas fees for all accounts (create yours now to take advantage of this offer)</p><p><strong>Now, let’s talk architecture</strong></p><p>Being part of the Gas Station Network means providing a whole new infrastructure for how your accounts work, from relaying calls to how you automate account funding, so let’s get a glimpse of what Multis has achieved.</p><h4>Top-ups architecture</h4><p>Once you have a Multis GSN-capable account, we made it super easy for you to take advantage of gasless transactions: a simple top-up button.</p><p>By using the top-up button, Multis will deposit funds for you at the relay hub, and all your owners will get instant free gas for all transactions, without any more actions or coordination from your side.</p><p>Under the hood, Multis is using a serverless architecture to dispatch requests and do the funding. You can read more about our <a href="https://medium.com/multis/serverless-email-notifications-with-google-cloud-functions-and-clojurescript-fc58dfea067">serverless architecture here</a>.</p><h4><strong>Web3 on nodejs</strong></h4><p>In order to fund accounts, we need to call the GSN RelayHub’s smart contract depositFor method, this happens every time a user calls our topup HTTP endpoint, which in turn triggers a cloud function that handles topup requests.</p><p>Unlike web DApps where your web3 instance is associated with an Ethereum account (that you get from MetaMask or Portis, or any other wallet the user happens to be using), when a topup request is accepted (after a fair-use check), our web3 instance is being created on a nodejs serverless setting, so we have no account associated with our web3 instance.</p><p>But thanks to the <a href="https://web3js.readthedocs.io/">web3.js</a> library (Ethereum’s most used JavaScript API) we can sign and broadcast transactions in nodejs by directly using an account’s private key. This is how our deposit function looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wvsg9MYxWjYvsLmLhLGGdw.png" /><figcaption>Signing and sending transactions in nodejs</figcaption></figure><p>We start by encoding transaction data related to the smart contract method call, that we use to construct a transaction object. We then <a href="https://web3js.readthedocs.io/en/v1.2.1/web3-eth-accounts.html#signtransaction">sign it</a> using our account’s private key (an Ethereum account dedicated to topups).</p><p>Finally, we <a href="https://web3js.readthedocs.io/en/v1.2.1/web3-eth.html#eth-sendsignedtransaction">broadcast</a> the signed transaction’s raw representation. The gas fees in this case are going to be paid by the account which private key was used to sign the transaction.</p><h3>Security</h3><p>The GSN-enabled smart contracts have been audited by <a href="https://quantstamp.com/">Quantstamp</a> and approved to contain no critical risks. The full report can be found <a href="https://certificate.quantstamp.com/view/multis">here</a>.</p><h3>TL;DR</h3><ol><li>Multis sponsors the creation of MULTISigs: request access <a href="https://app.multis.co/create-nofee">here</a> to enjoy a free and frictionless deployment of your MULTISig smart contract.</li><li>Once deployed, Multis allows companies to pay for gas fees on behalf of their users, with a click of a button, so users can enjoy a gasless experience. Multis is currently covering this cost as well on the basis of a fair-use, limited time offer. We call these <em>fee credits.</em></li><li>You should open an account.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*OKMyTU27n1FlrNKq5yR4Sw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1effc4700aad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/gasless-multisig-1effc4700aad">Gasless MULTISig</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How was YC?]]></title>
            <link>https://medium.com/multis/how-was-yc-1954b509c645?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/1954b509c645</guid>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[efounders]]></category>
            <category><![CDATA[ycombinator]]></category>
            <dc:creator><![CDATA[Théophile Villard]]></dc:creator>
            <pubDate>Mon, 04 Nov 2019 10:18:56 GMT</pubDate>
            <atom:updated>2019-09-22T12:20:19.987Z</atom:updated>
            <content:encoded><![CDATA[<p>This past summer <a href="https://multis.co/">Multis</a> participated in <a href="https://www.ycombinator.com/">Y Combinator</a>. The batch is now over and having added the mandatory “<em>YC S19</em>” label to our profiles we’re now (almost) back in Europe.</p><p>After four months away from the old (and probably best) continent it’s been good to catch up with friends and family. Inevitably, I’ve been getting the “<em>How was YC? / Alors YC c’était comment ?!</em>” many, <em>many</em> times. It’s given me the opportunity to refine my answer. This is the short-ish version.</p><blockquote>So, how was YC?</blockquote><h3>A bit of context 📗</h3><h4>Q2—2018</h4><p>I started working with <a href="http://efounders.com/">eFounders</a> on a project dubbed<em> WalletX</em>. The idea was to imagine what would be a crypto-wallet for companies. Kudos to <a href="https://twitter.com/tiboel">titi</a> (also know as “<em>le Jean Dujardin de la tech</em>”) for having the guts to start a crypto project in the bear market of 2018.</p><h4>Q3/Q4—2018</h4><p>The project <em>WalletX</em> started to look like something people could want. We gave it the name <em>Multis</em> (as in multi-signature) and we brought my business co-founder <a href="https://medium.com/u/46be38fb3cc4">Thibaut Sahaghian</a> on board.</p><h4>Q1—2019</h4><p>In the most violent bear market, the product was basic but working: a slick interface on top of a multi-signature wallet so you can manage your crypto as a company. We <a href="https://www.producthunt.com/posts/multis-2">launched on Product Hunt</a> to start acquiring our first alpha users. <strong>And we applied to YC.</strong></p><p><em>Note: eFounders had already sent 4 companies to YC. Which was both encouraging but also created a lot of pressure: you don’t want to be that company that couldn’t make it in. It turns out that one of the most successful startups out of eFounders had been turned down from YC… You never know!</em></p><h3>Getting into YC 🤞</h3><h4>Q2—2019</h4><p>We received an email from YC saying they’d like to chat via video. We were thrilled, but didn’t get our hopes up just yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhK_AskYkN1WRSMgns7cGw.png" /></figure><p>On a Sunday evening in Paris, we did a Skype call with <a href="https://twitter.com/daltonc">a YC partner</a> (the one who speaks the fastest). He asked many questions, and it was over before we felt we’d really gotten a chance to make a positive impression. <em>#ChampagneSunday</em> anyway!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*tSf7Sw5yZjrdIDS50KKeUg.png" /></figure><p>On April 17 at 7am, we received an email saying they’d like to meet in person: the infamous YC interview!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W36voW0j-vZNsv0YTKTViA.png" /></figure><p>On May 29 at 2:45pm Pacific Time, we entered a room inside one of the YC warehouses in Mountain View, California. There was four people interviewing us but only one partner seemed interested and asked questions around fiat and crypto interoperability. After the interview, we felt our odds of being accepted were low since crypto appeared not to be a topic of interest.</p><p>On May 29 at 7pm PT on Castro Street in Mountain View, my phone rang. Skype call. SKYPE CALL. On the other end was <a href="https://blog.ycombinator.com/author/aaron-harris/">Aaron Harris</a>, the same partner who’d been so curious about Multis in our interview (and probably YC’s strongest advocate for crypto), telling me they’d like to fund us. <em>BOOM</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EEz0Xc7DQOgypSLSpzcNdQ.png" /></figure><blockquote>PUTAIN MEC ON VA FAIRE YC !!!</blockquote><h3>During YC 🏡</h3><p>After being accepted into YC we had 5 days to find the house where we would be spending the summer. Obviously we couldn’t find one but a kind batch-mate named <a href="https://twitter.com/JoParisot">Jonathan</a> offered to let us crash at their house in Palo Alto. We spent the first 10 days of YC living with the <a href="https://actiondesk.io/">Actiondesk</a> team and it was terrific — thanks again guys!</p><p>On June 14 we moved in what would become “The cryptohouse / La zonzon”. As you can see <a href="https://zeusliving.com/homes/2964-benton-street-santa-clara-ca-usa">rent was not cheap</a>… But we had the luxury to have desks as well as a nearby park. The sunsets were ridiculous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zYWOYlVBEIZNBkVHiqHsA.png" /><figcaption>Santa Clara, California</figcaption></figure><p>In this house we did only three things:</p><ul><li>Build the product (<a href="https://twitter.com/natewave">cryptozar</a> + <a href="https://twitter.com/teawaterwire">cryptophile</a>)</li><li>Sell the product (<a href="https://twitter.com/fujisaha">cryptobaut</a>)</li><li>sleep + <a href="https://www.beyondmeat.com/products/the-beyond-burger/">eat</a> + drink coffee</li></ul><p>As the tech founder I did zero meetings, no conferences, and I only took two business-related calls. The rest of the time was just about <strong>drawing stuff on the whiteboard and shipping ClojureScript code</strong>.</p><p>This YC “remove all distractions” advice turned out to work wonders for us. Here’s a (non-exhaustive) list of what we shipped:</p><h3>Multis (YC S19) on Twitter</h3><p>📣 Introducing Token Swap: making it easier than ever for companies to build, hedge and invest in crypto. Built with our friends @KyberNetwork: https://t.co/NyM3C5L3W0</p><h3>Multis (YC S19) on Twitter</h3><p>📣 Introducing Custom Contract Calls: making it easier than ever for companies to call custom smart contract methods from the comfort of their Multis account.</p><h3>Multis (YC S19) on Twitter</h3><p>We put together a quick primer on how we deliver a secure, non-custodial solution to manage your company&#39;s crypto 🧐 Spoiler: you won&#39;t have to trust us too much... https://t.co/sxkV9isldT</p><h3>Multis (YC S19) on Twitter</h3><p>This is it folks: we integrated @compoundfinance to our multisignature wallet! Companies can now earn interest on idle crypto. Effortlessly. Yeehaw 🤠 https://t.co/ftifQP9u4H</p><h3>Multis (YC S19) on Twitter</h3><p>🌕💳 Introducing @MoonpayHQ&#39;s integration: - buy crypto - for your company - from Multis - with a credit card Happy on-ramping! (Available for residents of Europe, UK, Canada and South Korea)</p><h3>Multis (YC S19) on Twitter</h3><p>⚠️ Let&#39;s talk about an uncomfortable truth about allowances: How many times did you have to confirm this kind of transaction before using a dapp? Do you remember all the contracts/addresses you gave permission to spend up to a NOVEMDECILLION dollars of your crypto?</p><h3>Multis (YC S19) on Twitter</h3><p>🙃 Introducing reverse swaps: Companies on Multis can now change their erc20 tokens for ETH. (Composing 🧱 Multisig, Allowances and @KyberNetwork)</p><h3>Multis (YC S19) on Twitter</h3><p>Introducing Direct Transfers: a new way to streamline business spending from a multisignature wallet. Team members can now make petty expenses without requiring confirmations. NO MORE FRICTION to get your @efdevcon tickets 🇯🇵🤩 https://t.co/dn6GTf3SGm</p><h3>Multis (YC S19) on Twitter</h3><p>We&#39;re glad to finally support @ensdomains 🤗</p><h3>Multis (YC S19) on Twitter</h3><p>Introducing our integration with @NexusMutual 🐢: Cover your company&#39;s crypto against bugs in the multisig contract code. Current rate is ~1.3% p.a. We think it&#39;s the final nail in the coffin of custodian solutions. Decentralized Peace of Mind FTW. https://t.co/TqTmqH7A5O</p><h3>Multis (YC S19) on Twitter</h3><p>Demo Day is cool, but what about &quot;Serverless Email Notifications with Google Cloud Functions and ClojureScript&quot; at Multis? @natewave&#39;s got your back 🤓 https://t.co/OrqvKjrkZA</p><p>Toward the end we started to all go a bit crazy because of the same repetitive routine every single day. But YC dinners were a weekly highlight where we could chat with fellow founders/gladiators and be entertained by the guest speakers—Airbnb’s cofounders missed out on a great standup career!</p><h3>Demo Day 🎙</h3><p>On August 20 in the morning, we arrived at Pier 48 in San Francisco. The goal of Demo Day is simple: every startup gets 2 minutes (TWO MINUTES) to convince investors they cannot ignore them.</p><p>It’s a great day and these are 120 seconds of immense leverage. That’s why it takes more than a week to prepare and rehearse pitches. And that’s when you realize the unfair advantage YC is giving your startup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*jVhcInK1ianoDSfow2S6Og.png" /><figcaption>Backstage!</figcaption></figure><p>As we were waiting backstage I took a moment to appreciate that the innocent kid who had been born and raised <a href="https://en.wikipedia.org/wiki/Sallanches">in the French Alps</a> was about to stand on stage in SF next to his co-founder pitching their cryptobank in front of 3000 investors. <em>The feels!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E4y4zT4laoAsdXi_" /><figcaption>Onstage!</figcaption></figure><p>Thibaut did a great a job and we then chatted with many investors. A truly memorable — albeit exhausting — experience.</p><blockquote>On a les droits !</blockquote><h3>After YC 🚀</h3><p>First, we took the YC “don’t spend your money” advice at heart and sold all the things we could on Facebook’s marketplace. And in the most “Silicon Valley” moments of all we ended up handing out the cryptohouse’s whiteboard to a young AI startup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*W4c-7YFB3FLAxfuGWFnZHA.png" /></figure><p>Y Combinator has launched Multis into space, now <strong>our job is to fly that rocket while being cheap on gas</strong>!</p><ul><li>On the tech side, we wanted the month after YC to be dedicated to hardening the platform, so we are ready for the next wave of exciting things coming to Multis.</li><li>On the business side, Thibaut is finishing up the tiring/time-consuming fundraising process and will be back to “sell the product” mode soon.</li></ul><p>We’re thinking of regularly doing “micro YCs / CRYPTOFF”: a week or two somewhere in Europe where we can live and ship like we did in sunny/boring Santa Clara in the summer of the delicious year of 2019.</p><h3>Complaints 🇫🇷</h3><p>As <a href="https://twitter.com/paulg">PG</a> said, people need stuff to complain about. Here we go:</p><ul><li>Travelling to Cali just for a 10 minute interview is crazy (ok now the interviews are in Paris for European startups — better!)</li><li>Finding a house when you’re in the last interview slot is virtually impossible. YC could buy a campus and host companies there, like they do at “The Institute for Advanced Study” ;)</li><li>We had some group office hours in SF—that’s more than an hour commute from Santa Clara. Not so great for “no distractions”. Also, it’s too cold in SF!</li><li>Coffee at YC was nasty. Let’s sell some Stripe shares and buy a good coffee machine with freshly roasted beans. Come on!</li></ul><h3>Summary paragraph 😜</h3><p>(Always end with a summary slide, they said)</p><ul><li>We’re Multis, the Cryptobank for companies</li><li>We did Y Combinator</li><li><strong>YC was INTENSE</strong></li><li>You should do YC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*R7FSlhy6HDDeZwEgVW9zpw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1954b509c645" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/how-was-yc-1954b509c645">How was YC?</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Email Notifications with Google Cloud Functions and ClojureScript]]></title>
            <link>https://medium.com/multis/serverless-email-notifications-with-google-cloud-functions-and-clojurescript-fc58dfea067?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc58dfea067</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[clojurescript]]></category>
            <dc:creator><![CDATA[Nizar]]></dc:creator>
            <pubDate>Thu, 22 Aug 2019 18:25:47 GMT</pubDate>
            <atom:updated>2019-08-22T18:25:47.653Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>At <a href="https://multis.co/">Multis</a>, we use <a href="https://cloud.google.com/firestore/">Google Cloud Firestore</a> as our main database, this allows us to distribute multis as a <a href="https://en.wikipedia.org/wiki/Single-page_application">SPA</a> without having to write or deploy any backend code.</p><p>However, in order to send email notifications in response to user interactions (guest invitations, transaction requests, etc.), we needed a way to be able to run backend code, but we wanted it to be decoupled from the rest in order to keep distributing the app as a static website, without having to manage a backend server.</p><h3>Enter Cloud Functions</h3><p>Cloud functions allow you to run code in response to events. Your code runs in a managed Google Cloud environment and events can come from a variety of Firebase and Google Cloud services, including Firestore.</p><h3>How does it work?</h3><h4>Step 1: Writing your function</h4><p>In order to take advantage of cloud functions, you write your function as normal JavaScript code (or technically any language that transpiles back to JavaScript, in our case it was <a href="https://clojurescript.org/">ClojureScript</a>).</p><p>The only difference is that you now have access to one of the Google/Firebase event providers, which help you define the conditions under which your function should execute.</p><p>For Firestore, triggers are any changes to your database, so you can listen for document writes, updates, deletions, or creation, and execute code accordingly.</p><h4>Step 2: Testing</h4><p>Firebase provides a local emulator that lets you do pretty much all sorts of testing, but it’s not the main topic of this article. You can learn more about the emulator <a href="https://firebase.google.com/docs/functions/local-emulator">here</a>.</p><h4>Step 3: Deploy &amp; Monitor</h4><p>Firebase provides a CLI that allows you to deploy or delete one or more functions in a single command. Once deployed, your function will wait for event triggers and execute any code that matches.</p><p>Google will manage your function so you don’t have to worry about scaling, if your function is idle, instances are freed, under huge loads, Google creates more instances to handle the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*xxyk5xKdDSNw0f58R5Gj6g.png" /></figure><h3>Sending emails</h3><h4>Initial solution</h4><p>Our solution has been to build simple functions that would react to database changes. This meant writing and monitoring multiple functions, one function per use case, each function would wait for a database triggers and react accordingly in order to send emails.</p><p>For example, we had a function tracking Ethereum transactions and sending confirmation requests to wallet owners by email, another one tracking guest additions to a company account to send email invitations, and many more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvXMGzm6vvQwLbhmKNwjjw.png" /></figure><p>The handle-update method is then responsible for implementing the business logic required to know what to do with a given change, and finally, send the email if a route is found in the business logic tree.</p><p>Here’s an example of how an implementation for handling transaction updates might look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lVrmSugIY-UEGjZuA6PKbQ.png" /></figure><p><strong>Limitations of this approach</strong></p><p>When your function is listening for a specific event trigger, it gets called with a snapshot of the new and old data as input, your function is then responsible for making sense of what changed and what actions need to be done.</p><p>This has many drawbacks</p><ol><li><strong>Complexity</strong>: making decisions based on data changes is hard to reason about. Your function is now overloaded with lots of business logic.</li><li><strong>Reliability</strong>: directly listening for db changes to make decisions on what action to execute makes reliability harder to achieve. What if you missed a certain case? Intensive QA testing is needed and can never be enough.</li><li><strong>Scalability</strong>: handling new use cases is complex and requires implementing, deploying and monitoring a new cloud function, even for a simple use case. Probably making you even duplicate your frontend business logic inside of your cloud function.</li></ol><h3>One function to rule them all</h3><p>After evaluating different possible solutions, we ended up implementing an actually rather simple one.</p><p>We now have one cloud function responsible for handling all email requests, and its role is even smaller: it now only acts as a dispatcher.</p><p>The rest of the architecture is as follows:</p><ul><li>only one firestore collection is now being used to queue emails to be sent, apps that want to send emails simply write to this collection.</li><li>a simple base format has been defined to represent all emails.</li><li>each email has an action field which tells exactly how it needs to be dispatched.</li></ul><p><strong>Why is this cool?</strong></p><p>We can now implement any new use case by simply implementing the necessary action, without even needing to deploy a new cloud function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*0aBExvcS2ayk7rANk3aIiA.gif" /></figure><p>Polymorphism is implemented using ClojureScript multimethods, which we will discuss later on in this article.</p><h3>A note on security</h3><p>Unlike classical APIs where database access and security is managed by a backend server, firebase offers a path-matching configuration style that sits outside of your app and allows you to define your security rules. Along with conditional statements, one can define complex rules, with refined granularity levels to manage who can write, read or update any piece of information.</p><pre>service &lt;&lt;name&gt;&gt; {</pre><pre>// Match the resource path.</pre><pre> match &lt;&lt;path&gt;&gt; {</pre><pre>  // Allow the request if the following conditions are true.</pre><pre>  allow &lt;&lt;methods&gt;&gt; : if &lt;&lt;condition&gt;&gt;</pre><pre> }</pre><pre>}</pre><p>This was essential to prevent any malicious users from writing to the emails queue or to corrupt existing data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgDOlOkxtib4XE1dQb6rYg.png" /><figcaption>An example Firebase rule for securing a resource</figcaption></figure><h3>Show me the code</h3><p>So now that we’re done with the theory, let’s dive in into some code to show you how it’s done.</p><p>Assuming we have an email collection already created in firestore, we will be listening for changes to that collection in order to process emails, more specifically, we will be watching firestore onCreated triggers; we’re only interested in processing newly created requests, handling failures is not covered in this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qWghNIOqzv7SO86Bnw8h6g.png" /><figcaption>Main function for listening to newly created documents in the queue</figcaption></figure><p>Remember, our cloud function now only dispatches email data, the logic of how to handle each case is defined in a polymorphic way using C<a href="https://clojure.org/reference/multimethods">lojure multimethods</a>.</p><h4>Dispatching emails</h4><p>Our dispatcher uses simple Clojure multimethods to implement polymorphism. With multimethods, we can associate our dispatch function with multiple implementations, the method to be called will depend on the dispatched value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cIYZYwHr_mEPy7O_.png" /></figure><p>This means that dispatching depends on the value of :action inside of our email data, so we can implement new functionality by simply defining new actions, like in the example below, for handling guest invitations or pending confirmations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jws0Tl_ZrScx2JlN7pm0-A.png" /></figure><h4>JavaScript transpilation</h4><p>Now that we have an idea about how to define a cloud function in ClojureScript, let’s make it ready for deployment.</p><p>We start by defining an export value, which is simply a Clojure map of all the functions we’d like to export so that we could use them from JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IfnlKFvM6umoCo1e.png" /></figure><p>After compiling our ClojureScript (more on that shortly), we can require it in our main JavaScript file like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gTGZHM54y6IIO5-W.png" /></figure><h4>Deploying cloud functions</h4><p>After testing using the emulator, we can deploy the function to Google Cloud in a single command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*947HhcumD7u9yyYk.png" /></figure><p>And that’s it. Your function can now be monitored in the Google Cloud console.</p><h4>A word on shadow-cljs</h4><p>We can’t end this article without talking about <a href="https://shadow-cljs.github.io/">shadow-cljs</a>, our ClojureScript build tool.</p><p>shadow-cljs allows you to define multiple build targets in the same project. For example, you can have a build for your main frontend app and another one dedicated to building your cloud functions, which is how we do it here at multis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*d7SqAn-x_zQ41TAp.png" /></figure><p>Our exports definition will be compiled by shadow-cljs and output in functions/index-cljs.js, the multis.index/exports map keys are your function names, so you can require them from the main JavaScript file like we saw earlier.</p><h4>shadow-cljs goodies</h4><p>shadow-cljs comes with plenty of build commands, one of them is watch, which monitors your source files for changes and re-compiles your project accordingly.</p><p>This is great for when you’re in development mode, you can open your firebase emulator, change your code and see it re-loaded automatically, so you can keep testing without restarting the firebase shell.</p><p>Combined with REPL-driven development, it makes for incredibly fast feedback cycles that can improve your developer experience.</p><h3>Conclusion</h3><p>In this article, we tried to show you how serverless architectures are turning out to be convenient, we demonstrated how you can write Google Cloud Functions in ClojureScript, and showed that a simpler architecture turned out to be more robust, easy to scale, and more importantly, it’s now allowing us to move faster.</p><p>Our golden rule at <a href="https://multis.co/">Multis</a>: <strong>Keep It Simple</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc58dfea067" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/serverless-email-notifications-with-google-cloud-functions-and-clojurescript-fc58dfea067">Serverless Email Notifications with Google Cloud Functions and ClojureScript</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the Cryptobank]]></title>
            <link>https://medium.com/multis/introducing-the-cryptobank-9dc5f0c8e43e?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/9dc5f0c8e43e</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Thibaut Sahaghian]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 13:27:19 GMT</pubDate>
            <atom:updated>2020-07-24T08:56:18.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U7VyapgHr_3kzFGW.jpeg" /></figure><p>The cryptoeconomy is the future of banking. But traditional banks aren’t embracing it. In fact, their historical model makes it impossible for them to act as the gateway to the decentralized financial services that matter most to their customers. A new breed of banks is emerging to fill that void — I call them “Cryptobanks” — here’s how they came about, and where they are headed:</p><h3>Modern banking: anatomy of a failure</h3><p>Modern banks came out of a need born in the booming principalities of medieval Italy. Banks were able to offer services that were desperately needed: the ability to secure savings, to facilitate trade, to insure investments, and to finance the emergence of a flourishing merchant class. And from the start, bankruptcy was part of the model. In fact, the term bank and bankruptcy both originate from Italian, and both appear in the 12th Century.</p><p>But enough with the history lesson: the reason why the modern banking as it emerged then is still alive today is that it supports the present-day economy by offering financing (credit) and underwriting (insurance) services for businesses. Banks have now grown increasingly complex, intermediated, and their main vulnerability has remained consistent across centuries: they are highly centralized organizations, which means they all have a “single point of failure”. Banks handle everything: from data to transiting information to the customer-facing apps that render their services accessible. It makes them very hard to replace. But it also makes downtime all the more likely to happen, hindering businesses that rely on them in an overly bankarized world. Over time, banks have become better at guarding their Achille’s heel but have never been fully able to cure it. The systemic banking crisis of ’08 is a painful reminder and still echoes today.</p><h3>The rise of the Cryptobank</h3><p>Cryptobanks build on the shortcomings of traditional banks. They improve existing services, and open access to new ones to better cater companies needs. And their blockchain-based architecture corrects their traditional counterparts’ major flaw: they are decentralized.</p><p><strong>Why do companies need decentralized financial services?</strong> For starters, they eliminate modern banking’s “single point of failure” and, in so doing, increase reliability in the services they provide — i.e. say goodbye to downtime on your banking app. Second, they don’t hold funds — they merely enable users to access them in a simple, convenient way. Third, they’re transparent. Not just because they don’t charge any hidden fees, but because the protocols they use are open source and can be audited externally by anyone, anywhere — you can also kiss goodbye to crises like subprime where toxicity lies hidden away from regulators deep in pages of legalese and untraceable intermediaries. Lastly, they are censorship-resistant: transactions can’t be canceled, modified, re-routed, or in any way altered.</p><p><strong>Isn’t a Cryptobank just going to help tech-minded people?</strong> The answer is unequivocally “no”. What makes neobanks — think Revolut and N26 — an attractive alternative to traditional banks today is their glimmering UX/UI layer that makes financial services easy and accessible. They don’t reinvent the model, but they do improve the user experience and reduce friction. Cryptobanks, on the other hand, are the new innovative class of a century-long history of banking evolution. They replicate the strongest attributes of past generations, and build resistance to vulnerabilities. A user-friendly interface allowing all users — especially non-technical ones — from all companies to access the financial services they need is vital to the Cryptobank’s mission: to democratize access to the cryptoeconomy.</p><p><strong>So, what services does the cryptoeconomy offer that aren’t accessible via traditional banking?</strong> It’s not all new. Cryptobanks offer services that are very similar to traditional banking, but applied to crypto. Storing funds. Earning interest. Managing outgoing payments to staff and partners. Wiring money abroad. Exchanging currency, whether crypto to crypto or crypto to fiat ($,€, £, etc). After all, the beating heart of a business sounds the same regardless of what is being pumped through it. But, because they are disintermediated, Cryptobanks add value where traditional banking could not: they generate less costs, they are accessible anytime, anywhere, and they deliver services like lending almost instantly.</p><p><strong>Also, they open up a world of possibilities.</strong> Crypto is the dawn of a new era and, like previous eras, the new ground it will cover is unpredictable. Who would have thought that the credit card would have become the default method of payment before it was introduced? Who could have imagined that this same credit card would even be used online and even potentially replaced by smartphones? And, going further in a different space: who would have predicted that 2 billion people would log in each day to a website called thefacebook.com to spend time with their friends? By opening access to the budding cryptoeconomy, Cryptobank’s make it anyone’s guess what the services they offer will look like in a decade. The brightest minds are already hard at work to reinvent the financial system, but it’s foundations are strong, because they are based on a handful of principles that are easy-to-understand, and — just as importantly — easy-to-verify.</p><h3>Introducing Multis, the Cryptobank for companies</h3><p>We’re building <a href="http://multis.co/">Multis</a>, the first Cryptobank for companies and entrepreneurs. Today, we allow companies to:</p><ul><li>Buy crypto and store funds securely</li><li>Manage multi-access to funds and set spending limits for team</li><li>Earn interest on idle treasury</li><li>Run payroll and recurring payments in any cryptocurrency they want</li><li>Get paid, pay providers and reward their community in crypto</li><li>Exchange tokens natively, from ETH to DAI</li></ul><p>And our vision reaches much further. Beyond what we’ve called our “Minimum Viable Cryptobank” and is what we’re currently building, we’ve laid out a few principles to guide us into the future of banking:</p><p>We believe companies should be empowered through finance. We want to remove unnecessary intermediaries in legacy corporate financial services. We want to provide a simpler way for organizations to access the resources and services they need to thrive. We want to enable access to new, yet-to-be-imagined, decentralized financial services so that they can go even further.</p><p>We believe in an open world governed by a new set of rules. We will build on existing, open source code to offer an easy to understand and easy to audit set of services. We will charge for our service based on the value we create for our customers, and following pricing that is clear for them from Day 1. We will enable access to funds, but never hold them on your behalf.</p><p>In short, we believe in building the gateway for companies to access the emerging cryptoeconomy. We know it’s still early days for crypto, but we believe there is tremendous value for companies and that owning crypto will become obvious. And when it does, we will be ready for it.</p><h3>Join the movement</h3><p>We launched our service this summer. If you want to be the first on board for the next generation of corporate banking services, sign up via <a href="https://multis.co/">our site</a> or send us an email at hello<a href="/service/mailto:thibaut@multis.co">@multis.co</a>.</p><p>We’re also hiring in multiple positions (growth/design/engineering): if you’re keen to join a growing team of happy and passionate crypto enthusiasts and contribute to our mission to democratize access to cryptos, send us an email at <a href="/service/mailto:team@multis.co">join@multis.co</a>.</p><p>Last but not least, we need all the feedback we can get: a clap, comment, or DM is more than welcome! Especially if you disagree ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dc5f0c8e43e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/introducing-the-cryptobank-9dc5f0c8e43e">Introducing the Cryptobank</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to ship a highly dynamic webapp as a static website]]></title>
            <link>https://medium.com/multis/imagining-a-leaner-way-how-to-ship-a-highly-dynamic-webapp-as-a-static-website-5088f83c3813?source=rss----309cb9d1dee4---4</link>
            <guid isPermaLink="false">https://medium.com/p/5088f83c3813</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[clojurescript]]></category>
            <dc:creator><![CDATA[Théophile Villard]]></dc:creator>
            <pubDate>Tue, 11 Dec 2018 10:25:08 GMT</pubDate>
            <atom:updated>2018-12-13T10:21:21.870Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKry9iTLbMxpTjlKmpLrsg@2x.png" /><figcaption><strong>© </strong><a href="https://twitter.com/MeghanRegior">MeghanRegior</a></figcaption></figure><h4>Imagining a leaner way</h4><p>In early April I was given three months to ship a rough prototype of a crypto wallet for companies. Building decentralized web applications (dApp) — or web3 apps — was still a new domain, and could get quite tricky because of the paradigm shift introduced by blockchains.</p><p>I needed to focus as much as possible on these new challenges to build this complex webapp, and scrap as many mundane web development tasks as I could. From a security standpoint, given the stakes (cryptocurrencies) the <a href="https://en.wikipedia.org/wiki/Attack_surface">attack surface</a> had to be reduced. Finally, fast iteration was a must.</p><p><strong>Being lean starts with removing things</strong>. I decided to challenge every piece of the standard architecture:</p><ul><li>What if I could use a more powerful language allowing for more expressivity and a better interactive development experience?</li><li>What if I could do without a backend?</li><li>What if I could do without a server?</li><li>What if I could reduce the release process to under 30 seconds?</li><li>What if I could pay for no more than what I’m really using?</li></ul><p>My answer: the <a href="https://app.multis.co/">Multis</a> tech stack.</p><p>Here’s a quick tour to give you an idea of how we’re trying to get lean.</p><h3>Multis is a static website</h3><p>Yep, you heard correctly.</p><p>Is it <a href="https://en.wikipedia.org/wiki/Yahoo!_GeoCities">1999</a> all over again?? Not so fast, web1.0 is not back yet!</p><p><strong>Multis is just a folder</strong> containing an html file and the usual static assets (js, css, images and the json files under contracts)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*WoOpOem9vqBtKbfg.png" /><figcaption>the folder</figcaption></figure><p>Simple right?</p><p>We then make <a href="https://app.multis.co/">app.multis.co</a> point to that html. It’s simple, it’s static: all end users get the same version of the html, hence statically served.</p><p>Want to hear more? Good.</p><h3>Deploying a folder</h3><p>Well we could just put the folder in Dropbox and make <a href="https://app.multis.co/">app.multis.co</a> point to the public url of that folder thanks to a service like Duet.to — That would work, but feels a bit amateur. What do we do instead? Check out the extract of our Cloudflare DNS records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ootj5JV-7z1zP5sS.png" /><figcaption>app.multis.co</figcaption></figure><p>Where do we get these IP address from? Firebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OiMSqaIwomjK5RDI.png" /></figure><p>That’s the first important point: <strong>we’re using Firebase Hosting.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W3WGKnrGzCb5qFp1.png" /></figure><p>Firebase Hosting is similar to services like GitHub Pages, <a href="https://www.netlify.com/">Netlify</a> or <a href="https://surge.sh/">Surge</a>. It’s basically like our Dropbox with some added benefits:</p><ul><li>everything served over https (allowing Full+Strict SSL on Cloudflare) “so content is always delivered securely”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rerSk1tbdPZq5l_S.png" /><figcaption>Firebase Hosting proxied thru Cloudflare</figcaption></figure><ul><li>“Each file that you upload is cached on SSDs at CDN edges around the world. No matter where your users are, the content is delivered fast.”</li><li>Deploying is as simple as doing firebase deploy --only hosting</li><li>“Firebase Hosting provides full versioning and release management with one-click rollbacks.”</li></ul><p>The last point is actually a lie: it takes TWO steps to rollback!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWzzh2NCyVN1MmaG3Dw5RA.gif" /><figcaption>new versions immediately available worldwide!</figcaption></figure><p>Html, css, and images don’t change often so rolling back is about changing the JavaScript file.</p><p>I hear you. You’re impatient to know how this js file representing the whole app code is written. Brilliant question! Let’s talk about it.</p><h3>Writing code</h3><p>Let’s get this clear: I’m definitely not writing this js file directly — I told you it’s not 1999 again 🤣</p><p>Nothing too fancy here, I’m writing code in different files that’s then compiled into one file. You know the drill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*DJobgtr5SpoHKCxI.png" /></figure><p><strong>Notice the </strong><strong>.cljs ?</strong> <br>These are ClojureScript files. You might have heard of this language but here’s an elegant definition:</p><blockquote><em>ClojureScript is a modern, functional &amp; immutable data-oriented language with a great standard library that compiles down to self-contained &amp; compact JavaScript bundles. Based on Clojure, it brings Lisp’s elegance and meta-programming to the JavaScript ecosystem.</em></blockquote><p>Why would anyone want to choose this language?</p><blockquote><em>ClojureScript combines the reach of the JavaScript platform, the flexibility and interactive development of Clojure, and the whole-program optimization of Google Closure to provide the most powerful language for programming the web.</em></blockquote><p>This would warrant another article, but writing ClojureScript abstracting React makes developing dynamic web applications truly enjoyable. And by truly I mean really f*cking awesome.</p><p>Of all these files, only one function gets exported to the global window object:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ACfB3B5JNiCdmhdl.png" /><figcaption>notice the ^:export — that’s metadata in Clojure</figcaption></figure><p>The humble init function triggers the “data flow” with rf/dispatch-sync (see <a href="https://github.com/Day8/re-frame">re-frame</a>, think Redux on steroids) and the mount! function is mounting the main view component on the #app DOM element (see <a href="http://reagent-project.github.io/">Reagent</a>, think React on steroids).</p><p>What’s next?</p><p>We just need to call this init function in the html to trigger the rendering and the data flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/0*zHJlHvWevdgaaeqR.png" /></figure><p>That body part is not extremely complex 😉</p><p>The shrewd readers might think the tool used to build that final JavaScript file is Webpack. But they’re wrong.</p><h3>Compiling ClojureScript</h3><p>There’s a tool in ClojureScript land called <a href="http://shadow-cljs.org/">shadow-cljs</a>, and it basically handles dependencies (npm) and builds (webpack) with the distinct advantage of being concise — see for yourself its config file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cFUiQIdvy9XJfvLQ.png" /><figcaption>shadow-cljs.edn</figcaption></figure><p>That’s all you need.</p><h4>Dev environment</h4><p>The command shadow-cljs watch app will trigger an initial build followed by incremental compilations (taking less than 1 second) on every code change. You also get the <a href="https://clojure.org/about/dynamic">interactive development experience</a> unique to Lisp languages — think React hot reload but on mega steroids!</p><h4>Prod environment</h4><p>The command shadow-cljs release app will compile the production build (taking less than 30 seconds) using optimisations. You&#39;ll get a JavaScript file of the form core.723222C8EF.js thanks to :module-hash-names 10 — we&#39;ll touch on why this is important in a second.</p><p>For every release we use a custom bash script to insert that file name in the final folder’s html (see beginning of article):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/0*yyBoeOziOKSdeYOU.png" /></figure><p>THEN WE SHIP IT, cache gets invalidated automatically because of the hash in the file name (html files are not cached) — <strong>a new version of the webapp is live!</strong></p><p>All done?</p><p>Not quite yet. You might be thinking “ok, they’re shipping a static website, They have the frontend, but where’s the backend??”</p><p>Glad you asked.</p><h3>Backend as a service (BaaS)</h3><p>Firebase comes with other services providing us with solutions for authentication, user-generated storage, and databases.</p><p>On the client side, their JavaScript library is polling these services through web-sockets allowing us to <strong>go realtime in the blink of an eye</strong>.</p><p>Their first version of their database “Realtime Database” was great but was missing some important features regarding scalability. They’ve now release their new database “FireStore” and it’s fair to say that the force is strong with this one 😉</p><p><strong>Firebase plays almost too well with the single application state</strong> enforced by re-frame. It boils down to one big unified data flow:</p><ol><li>An event — like a click — triggers an event handler (<em>dispatch</em>)</li><li>This handler triggers a side effect writing to the remote db (<em>Firestore write effect</em>)</li><li>Changes in the remote db are pushed on the client and triggers a side effect writing to the local db (<em>Firestore read effect</em>)</li><li>Views → Virtual DOM → DOM : displays materialized views of the local db (<em>subscriptions</em>)</li><li>Go to 1.</li></ol><p>After recovering from the initial dizziness of this infinite looping, you might still be wondering:</p><blockquote><em>oh so you’re doing everything on the frontend. What happens when you need to use a service with a private key or if you want to run a compute-intensive task? You can’t just do that in the browser!</em></blockquote><p>Indeed, in the first example that would expose my key for everyone (and as we know <em>we can’t trust everyone)</em> and in the second example that would put a lot of stress on the user’s browser: What if it’s a mobile browser? What if the tasks take some time to complete?</p><p>Hummmmm, you’re gonna like this 👇</p><h3>Functions as a service (FaaS)</h3><p>There’s a service called <em>Firebase Cloud Functions</em> (think AWS lambda) where you write and store functions that will be triggered upon certain events:</p><ul><li>Any http request</li><li>Firebase authentication (ex: new signup)</li><li>Firebase database (ex: write under a specific path)</li></ul><p>These functions live “in the backend” — <strong>their code is never exposed to the end user</strong>, you can make use of any private key or run compute-intensive tasks. The simplest use case for us is a tiny integration with Slack to receive a notification in a private channel when a user signs up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9rZSTKUntgAmfqV5.png" /><figcaption>make sure the hook posts in a private channel</figcaption></figure><p>Sweet huh? 😀</p><p>Cloud Functions can be much more complicated as well, for instance we have a big one for our “import wallet” feature.</p><p>By the way, you’re not hallucinating (yet): the snippet above is pure JavaScript. That’s the compelling feature of shadow-cljs in its ability to use JavaScript within ClojureScript (and vice versa) — in that particular case we create another build with {:target :node} instead of :browser !</p><p>Deploying these functions is also a one-liner:</p><p>firebase deploy --only functions</p><p>😉</p><p>Soooooooo, what’s the icing on the cake?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*7Bo6DB59E_d8ROv7.png" /></figure><h3>Connecting to the Ethereum blockchain</h3><p>How can one feel complete without a connection to this always available and uncensored world computer?!</p><p>It’s got similarities with a BaaS:</p><ul><li>individual wallets or contract accounts (user authentication)</li><li>contract state (database)</li><li>access from a JavaScript library on the client side</li></ul><p>But also key differences:</p><ul><li><strong>decentralized</strong> (anyone can join participate and secure the network)</li><li><strong>money protocol</strong> (value transfer as a native feature)</li></ul><p>Funnily enough, there’s a growing list of companies in the blockchain industry using ClojureScript. The obvious reason? Immutability 🤓</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UDZHJnaQDy3_BKs7.png" /><figcaption>thanks!</figcaption></figure><p>How does this Ethereum connection work? Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VMPtPEUpnxakbdIG.png" /></figure><p>Providing an instance of web3 — boils down to connecting it to an Ethereum provider (could be one injected by <a href="https://metamask.io/">Metamask</a>, one running on your machine or a remote one like the nodes provided by <a href="https://infura.io/">Infura</a>).</p><p>With re-frame-web3-fx library you watch the balance of an address so that ::coinbase-balance is always up to date in your global state (we then merge that data source into the unified data flow — see BaaS).</p><p>Maybe you’re feeling a bit overwhelmed, let’s try to get an overall picture:</p><h3>10000-foot view of Multis’ architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYkBOX-udKCXM24uH8IB0w@2x.png" /><figcaption><strong>© </strong><a href="https://twitter.com/MeghanRegior">MeghanRegior</a></figcaption></figure><h3>Monies</h3><p>Not that I’m not willing to pay for services, but <strong>it feels more elegant to pay only for the service you’re using</strong> — and the freemium model works well to get you started and then grow (and pay) with the tools you first used.</p><p>As of today, we’re under the free tier for <a href="https://firebase.google.com/pricing/">Firebase</a> and <a href="https://www.cloudflare.com/plans/">Cloudflare</a>. Meaning that our only expense so far has been for buying the different domain names. Not too ashamed of that 😋</p><h3>What about you?</h3><p>That’s it for now, hope you got intrigued by this static website architecture.</p><p>If that sounds too exciting for you, please <a href="https://twitter.com/teawaterwire">hit me up on Twitter</a>, we’re looking to hire <strong><em>Engineer Numero Uno</em></strong> for Multis.</p><p>💪 👩‍💻 👨‍💻 💪 #remoteok</p><p>Bisous</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5088f83c3813" width="1" height="1" alt=""><hr><p><a href="https://medium.com/multis/imagining-a-leaner-way-how-to-ship-a-highly-dynamic-webapp-as-a-static-website-5088f83c3813">How to ship a highly dynamic webapp as a static website</a> was originally published in <a href="https://medium.com/multis">Multis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>