<?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[Lumenauts - Medium]]></title>
        <description><![CDATA[Your unofficial Stellar guide. - Medium]]></description>
        <link>https://medium.com/lumenauts?source=rss----46f664cd58a6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Lumenauts - Medium</title>
            <link>https://medium.com/lumenauts?source=rss----46f664cd58a6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 12:19:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/lumenauts" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Better Stellar Fee Channels]]></title>
            <link>https://medium.com/lumenauts/better-stellar-fee-channels-b02a27c11cda?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/b02a27c11cda</guid>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Tyler van der Hoeven]]></dc:creator>
            <pubDate>Tue, 23 Oct 2018 16:20:03 GMT</pubDate>
            <atom:updated>2018-10-24T15:49:02.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJBI9GVIZQQQb3BDqRdmxA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/qMMzHPF3ajQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">chuttersnap</a> on <a href="https://unsplash.com/search/photos/channel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>A guide to using fee channels the right way</h4><p>If you’ve built a <a href="https://www.stellar.org/">Stellar</a> application which creates or manages Stellar accounts there’s one slightly grimy issue that pops up for every single Stellar transaction. <a href="https://www.stellar.org/developers/guides/concepts/fees.html">Fees</a>. Who’s responsible for them? Where do they come from? How do you explain them in a way that makes sense?</p><p>Imagine if every time you spent money your bank took out a small fee. Sure, it’s only a tiny fraction of a penny, but still. You had $10 but now you have $9.99999. You deserve $10, you earned $10, you aren’t paying the bank to take out fees, so why are you losing money every time you utilize their services?</p><p>Most Stellar apps will justify the fees by claiming they are super low or that it’s an incredibly small price to pay for their services. Still though, for me, at the end of the day if a user has $10 they should see $10.</p><p>The obvious solution to this issue is that someone else will have to pay for the fees, namely you. You’ll need to find an alternative to pulling the fees from their account to pulling from one of your own accounts. Within Stellar this concept already exists and is actually incredibly easy to implement and several applications are already doing this. It’s through the concept of the transaction’s<a href="https://www.stellar.org/developers/guides/concepts/transactions.html#source-account"> source account</a>.</p><p><a href="https://www.stellar.org/developers/guides/concepts/transactions.html">Transactions</a> are made up of <a href="https://www.stellar.org/developers/guides/concepts/operations.html">operations</a>. Those operations are bundled together in order and run from a sending account. What most developers aren’t considering though is that there are two “fees” being consumed each time a transaction is submitted to the network. The first obvious one is the fees for the operations. Operations each take 0.00001 XLM (100 stroops), those fees are paid for by the sending account of the entire transaction. The second less obvious fee is the <a href="https://www.stellar.org/developers/guides/concepts/transactions.html#sequence-number">sequence number</a> for the sending account. Knowing this will become essential very soon as we explore why the current method of utilizing a “fee <a href="https://www.stellar.org/developers/guides/channels.html">channel</a>” doesn’t work very well.</p><p>Fee channels are essentially allowing child accounts can issue operations but those operations will be bundled and sent from a singular “fee account” source which will consume any fees generated by the operations.</p><p>The issue with this is that if you don’t have control over the flow or timing of issuance for the transactions you’re going to very quickly run into issues with the sequence number for the fee account. If two child accounts both issue requests to the network at the same time they will both issue with the same sequence number but only one of those transactions will succeed as the sequence number, true to form, must progress sequentially. Controlling the flow of transaction issuance, while theoretically possible, is a fools errand as any successful implementation will greatly reduce the speed at which you can respond to requests. As your business succeeds you will be punished with slower and slower response times as requests have to be bundled and sent all from a single fee account.</p><p>These issues are not new and the way some are getting around this is by creating a fee account pair for each child account, but this has the obvious drawbacks that you’re potentially tying up loads of money into both fee and child accounts which could be used for just creating new child accounts. You also have to keep tabs on hundreds, thousands, (millions?) of fee accounts and ensure they stay topped up to meet the demands of your customers.</p><p>Fret not though, there is an incredibly simple solution which avoids all of these issues. The best of all the worlds with zero compromise on either the fee channel or the user side. Speedy, easy and affordable.</p><p>To explain my proposal I’m going to walk through performing all the actions on the <a href="https://www.stellar.org/laboratory/">Stellar Laboratory</a> so you can see exactly what I’m doing.</p><p>To begin we’ll need to create both a master and a child account. Since the master account will create the child account let’s start there. We tackle that by simply creating a new testnet account and funding it via the friendbot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jStDF7PmSLt7L51WQ-Bokw.png" /></figure><p>Perfect! GC…43 will be our master account. Make note of the public and private keys for this master account and then generate another keypair for the child.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ye3gEFw4DcD09WnKiHPWHw.png" /></figure><p>Nice! GD…FO it is. We won’t fund this child account via the friendbot though, for that we’ll head over to “Transaction Builder” and issue a “Create Account” operation sent from the master account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_bGtb2dC9S3atPPvp_SQQ.png" /></figure><p>Why a Starting Balance of 1.001 you ask? Well 1 XLM is the <a href="https://www.stellar.org/developers/guides/concepts/fees.html#minimum-account-balance">minimum account balance</a> to even open a new account and 0.001 is to cover a single transaction with the maximum of 100 operations. While the fees will be repaid as one of the operations in any given transaction we’ll need enough to cover the validation check before a transaction is allowed to be submitted to the network. The program knows it will cost {x} amount to submit but it doesn’t know you plan on paying the source back as one of the operations of the transaction /shrug. Alright, so now we just need to sign and submit that transaction with the master account’s secret key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvYRnJRH_w56bqvvYRI17A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9_GKJBvM1bpL1T4Z4Tu6w.png" /></figure><p>Great! Now account GD…FO is funded with the minimum account balance. Just for kicks let’s go and submit a single operation transaction just to show that fees are being taken out of the child account for now. A simple dummy Bump Sequence operation should be innocent enough.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJYh_bQ5Jpns2ygkuSGW_g.png" /></figure><p>Make sure to sign with the child account’s secret key this time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4dJS_BlAio3Eu161vUttA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3pb0qxj9-04OOghBldRvQ.png" /></figure><p>Finally let’s check the account balance to see that it’s sitting at 1.001 minus the 0.00001 fee. If my math is good it should be 1.00099.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35NwdvQjVGXVi63iN3W-uQ.png" /></figure><p>And so it is, the native asset_type balance in the balances array is 1.0009900. Perfect, just what we were expecting. From now on any transaction we push, as long as we use my proposed fee channel method, should never drop that balance below 1.0009900.</p><p>So how can we perform actions consuming this account’s sequence number without consuming fees from this account’s balance? Simple! Add a repayment operation from a fee account as an operation to every transaction. So for example considering our last transaction let’s add a repayment operation from the master account and see if we get the desired outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jdk4-37oe0Exv23LojOgGg.png" /></figure><p>Notice the Source Account for the Payment operation is the master account and the Destination is the child account. Also notice the Amount is 0.0000200 not 0.0000100. We have to repay 1 stoop (0.0000100 XLM) for every single operation in the transaction including the repayment operation itself. Very important.</p><p>Next we sign. Don’t forget to sign with both the child and master account secret keys as we are performing actions from both of those sources. If this becomes an issue you could add either account as a signer to the other account and only include the one signer but for our purposes and most use cases including both signers will be ideal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CMBJgpfA8_pigXwickTCRA.png" /></figure><p>After signing we simply submit the transaction and then check to ensure that the child account balance is still sitting pretty at that 1.0009900 while the sequence number should have bumped from 1040155179745281 to 1040155179745282.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQOo9IZvQLQYgAU_WTsZLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GodpKfNQPb1VUFHtQ5ZYDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pTiY_H2UBIDyArQbqsukeQ.png" /></figure><p>Score! That’s really all there is to it. Child accounts can be their own transaction issuers while not draining their own balance from fees. If you were to inspect the master account GC…43 you would find that its sequence number hasn’t budged since that initial account creation transaction. Awesome Mr. McPossum!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b02a27c11cda" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/better-stellar-fee-channels-b02a27c11cda">Better Stellar Fee Channels</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Another Crypto Wallet for Stellar based assets such as ETH, BTC or EURT?]]></title>
            <link>https://medium.com/lumenauts/another-crypto-wallet-for-stellar-based-assets-such-as-eth-btc-or-eurt-f508159be1b4?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/f508159be1b4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[stellar-lumens]]></category>
            <category><![CDATA[stellar]]></category>
            <dc:creator><![CDATA[Anthony BARKER]]></dc:creator>
            <pubDate>Thu, 19 Jul 2018 19:48:51 GMT</pubDate>
            <atom:updated>2018-07-19T19:48:51.331Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a ton of wallets available according to<a href="https://www.stellar.org/lumens/wallets/"> Stellar.org website</a>. However, none of them did exactly what I needed. So in the past I have used the ipython shell to create address, make trustlines, and send payments. I spent a Saturday and put together a tiny wallet.</p><blockquote>stcli— a repl command line crypto wallet for stellar that is simple and all in one file</blockquote><p>Why a new wallet?</p><ol><li>Super easy to read the code — You are trusting wallet providers with your funds and I wanted someone to be able to review the code in about 3 minutes to ensure nothing funny is going on under the covers. Currently it is less than 600 lines of code including comments and it all is in 1 file so you can move it around easily and securely.</li><li>Command line under Linux — I love the command line and specifically python’s REPL (Read–Eval–Print Loop )..</li><li>Python based wallet — all the other open source ones are in Javascript or go</li><li>Used for testing of Stellar remittance functions — No other wallets I could find fully allowed testing of federation, compliance, deposit, and withdrawal.</li><li>Shows 100% what it is doing behind the scenes — made for testing (or live)</li><li>Support all the basic functions that other wallets do from this list by Tim<br><a href="https://docs.google.com/spreadsheets/d/14hs18NkgKerF47YPI0NQDX0gN2ZAN98Z0LValHGYrZ8/edit#gid=987160927">https://docs.google.com/spreadsheets/d/14hs18NkgKerF47YPI0NQDX0gN2ZAN98Z0LValHGYrZ8/edit#gid=987160927</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KrbPjLJte80f5F4ICZ-eg.png" /></figure><p>Or this other one from Umbrel<br><a href="https://docs.google.com/spreadsheets/d/1DhjXMqKadHGjAV_hpMWS-ylIhv3l-zVNFjqmpeu2gGA/edit#gid=0">https://docs.google.com/spreadsheets/d/1DhjXMqKadHGjAV_hpMWS-ylIhv3l-zVNFjqmpeu2gGA/edit#gid=</a></p><p>Here are the 10 commands to get you started</p><ul><li><strong>key</strong> — allows you to set the private key for this session. Or you can store it AES zipped if you want.</li><li><strong>send<br></strong>send amount asset public_key memo<br>eg. send 1 XLM antb123*papayame.com or<br>send 685.60 EURT in*tempo.eu.com TEA439339205324</li><li><strong>b</strong> (balances)</li><li><strong>r</strong> (receive)</li><li><strong>trust </strong><br>trust tempo.eu.com eurt, trust mobius.network mobi, trust apay.io btc</li><li><strong>deposit/withdrawal — </strong>and will support the upcoming changes to deposit and withdrawl.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*EsHaZ4WTW2vn9I7yxqUhDA.png" /></figure><p>But here are some additional cool features</p><ul><li>VIM ! or Emacs key binding!</li><li>Shows output of calls and all URLs while it is working</li><li>Encrypts configuration file using AES zip (optional)</li><li>Keeps all settings in same directory. You can have multiple directories with different configs.</li><li>Integration into testnet funding!</li><li>Reverse and forward incremental search (hit CTRL + R or up arrow)</li><li>Runs on all Python versions from 2.6 up to 3.5.</li><li>Works well with Unicode double width characters. (Chinese input.)</li><li>use ! to do shell commands directly from the repl</li><li>Auto suggestions. (Like <a href="http://fishshell.com/">fish shell</a>.)</li></ul><p>To install follow the below readme:</p><p><a href="https://github.com/antb123/stcli">https://github.com/antb123/stcli</a></p><p>Are you a python dev ? Please contribute! There are a ton of things to add.</p><p>If any lumens are received from the build challenge they will all be shared equally and fairly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f508159be1b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/another-crypto-wallet-for-stellar-based-assets-such-as-eth-btc-or-eurt-f508159be1b4">Another Crypto Wallet for Stellar based assets such as ETH, BTC or EURT?</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stellar payments — thoughts on federation, QR Codes, URIs, and Point of Sale systems within the…]]></title>
            <link>https://medium.com/lumenauts/stellar-payments-thoughts-on-federation-qr-codes-uris-and-point-of-sale-systems-within-the-2c6fcdc3fa4d?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/2c6fcdc3fa4d</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[stellar-lumens]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Anthony BARKER]]></dc:creator>
            <pubDate>Fri, 13 Jul 2018 15:35:57 GMT</pubDate>
            <atom:updated>2020-06-09T21:04:59.180Z</atom:updated>
            <content:encoded><![CDATA[<h3>Stellar payments — thoughts on federation, QR Codes, URIs, and Point of Sale systems within the Stellar.org ecosystem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPWkiAzQLPbDXO5B_bICjg.jpeg" /></figure><p>Stellar, like almost all encryption systems and blockchain payments works with <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">Public-key cryptography</a>(1) that was invented in the 1970s where the public key is the address where you receive funds. Early on Stellar supported human style names that look like anthony*tempo.eu.com, +33123123*tempo.eu.com and jsmith@gmail.com*tempo.eu.com with a system called <a href="https://www.stellar.org/developers/guides/concepts/federation.html">federation</a>(2) which does a simple https get to pull information.</p><p>This is great as it easier to type and remember than the stellar public key which looks something like:</p><blockquote>GC2BQYBXFOVPRDH35D5HT2AFVCDGXJM5YVTAF5THFSAISYOWAJQKRESK</blockquote><p>Smart anchors such as flutterwave.com have used federation with the format account_number.swiftcode*flutterwave.com. When a wallet does a federation lookup flutterwave validates the bank account number and swift code. Quite cool and is much more simple and less expensive than ethereum’s lookup system called Ethereum ENS.</p><p>Bitcoin implemented bip 0021 in 2012 (3), which is used for payments. It looks a bit like a uri and can be used as one as was registered with iana.org (4). It can also be converted to a QR code.</p><pre>bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=20.3</pre><p>In the Stellar world the first few wallets also supported QR code conversion and with a bit of prodding Centaurus, Lobstr, Stargazer, Papaya all currently work well together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/111/1*C4FcP3jtwhuBoLLuaxDWGQ.png" /><figcaption>ABOVE as a QR code</figcaption></figure><p>As a barcode this would look quite long in 128 Encoding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_h9Ykrqihx-V2Rr_kSxOQ.gif" /></figure><p>With stellar most wallets just used public key with no additional data initially.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*VIf9TzdgWvJrk6pofShEqw.jpeg" /></figure><p>This was a good start but were are some missing items. The first is MEMO fields that are typically used by both exchanges and certain wallets. Other items are the amount and asset type.</p><p>One way wallets addressed this was to create a more complex qr code as defined in Stargazer wallet or as extended by sacarson (5).</p><pre>{<br>    &quot;stellar&quot;: {<br>        &quot;payment&quot;: {<br>            &quot;destination&quot;:  ACCOUNT_ID,<br>            &quot;network&quot;:      NETWORK_CODE, // (*)<br>            &quot;amount&quot;:       AMOUNT,<br>            &quot;asset&quot;: {      // (**)<br>                &quot;code&quot;:     ASSET_CODE,<br>                &quot;issuer&quot;:   ASSET_ISSER<br>            },<br>            &quot;memo&quot;: {       // (***)<br>                &quot;type&quot;:     MEMO_TYPE,<br>                &quot;value&quot;:    MEMO<br>            }<br>        }<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*zrLTvpdGESsbccxLk2dU_Q.png" /></figure><p>Another way might be to just use the federated address as a QR code. Shorter URIs makes QR decoding more stable. A camera with a scratched lens or low resolution may run into problems scanning huge QR codes.</p><pre>payto://stellar/orderid*store.tempo.eu.com?amount=EURT:200.0</pre><p>Using <a href="https://www.gregorystrike.com/2011/01/26/how-to-use-google-charts-api-to-generate-your-own-qr-code/">google</a> to create the qr code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*ZAzffGJaiaIx2TBkjdQXVA.png" /></figure><p>In this case the details of the asset (key, decimals,image) are listed in the stellar.toml on the website. This has a lot less characters and leverages this <a href="https://tools.ietf.org/html/draft-dold-payto-01">payto IETF proposal</a>(6) from earlier this year. Stellar wallets would need to use a <a href="https://www.stellar.org/developers/horizon/reference/endpoints/path-finding.html">path payment</a> in the event that the person does not trust or hold the asset that needs to be submitted.</p><p>I believe it looks more elegant than Bitcoin’s <a href="https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki">BIP-072</a>’s payment format:</p><pre>bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&amp;r=https://merchant.com/pay.php?h%3D2a8628fc2fbe</pre><p>URIs could also be registered with Android as an intent (9) or on Iphone as a URL Schema or an app extension so that when a user clicks on the link in an email or chat it would open a crypto wallet with the required information.</p><p>The first issue with this is we need to get wallets to all support a new standard. If we see what happened with Ethereum there have been years of debates on EIP 67 and 681(8). Also as a URI it doesn’t help with <a href="https://en.wikipedia.org/wiki/Confused_deputy_problem">confused deputy</a> problems such as CSRF attacks (if you use it as a URL not QR code), man in the middle attacks, underpayment issues or network fees (if stellar fees became substantial).</p><p>Mike Hearn and Gavin Andresson came up with the Bitcoin Payment Protocol specification BIP-0070 to deal with these issues. It consists really of just 3 calls: PaymentRequest, Payment, and PaymentACK. However some wallets found the implementation hard as as they relied on non bitcoin style x.509 certificates to verify companies and protocol buffers for data serialisation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*ylf-uHHFr6rZYR4r.png" /></figure><p>Bitpay rewrote the Bitcoin Payment Protocol specification and released it in February (9) this year, simplifying it by moving to the JSON format instead of protocol buffers and using pgp for validation of the merchant. They claim to have seen a <a href="https://blog.bitpay.com/payment-protocol-results/"><em>20 fold reduction</em></a><em> in payment errors</em>(10) since pushing wallets to support BIP-0070 earlier in the year.</p><p>In the Stellar universe we already have the XDR format which is an old great standard. This article from Scott Locklin outlines why this was a good choice.</p><p><a href="https://scottlocklin.wordpress.com/2017/04/02/please-stop-writing-new-serialization-protocols/">Please stop writing new serialization protocols</a></p><h3>Along comes Stellar standard SEP-007</h3><p>In May 2018, lightyear proposed the new <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md">Stellar SEP-007</a> (11) “URI Scheme to facilitate delegated signing” which on first read through looks to be made to help delegated signing of transactions. This would help decentralised applications to process transactions without having access to a users private key (applications like the upcoming StellarX) or the stellarport.io trading app. However it also contains a payment URI scheme:</p><pre>web+stellar:pay?destination=GCALNQQBXAPZ2WIRSDDBMSTAKCUH5SG6U76YBFLQLIXJTF7FE5AX7AOO&amp;amount=100.123&amp;asset_code=EURT&amp;asset_issuer=GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S&amp;memo=tempo&amp;callback=url%3Ahttps%3A%2F%2FsomeSigningService.com%2Fhasysda987fs%3Fasset%3DUSD</pre><p>On closer analysis the specification contains much of the components of the Bitcoin Payment Protocol (BIP-0070) and putting together an extended and comparable specification should be fairly easy. Such a specification should include stellar federation, the PaymentACK callback function, refund addresses, decimals, network fees, and the handling of merchant orderids.</p><p>What about the W3C payments spec? The World Wide Web consortium has a draft Payment Request API (12) which was released a month ago. Reading through this large set of documentation you can see that it is primarily targeted at shipping of physical products and credit card handling. Basically their goal is to make entering address information easier for online merchants. It does not really support URI/QR codes at all. From my perspective the Bitcoin payment protocol looks far more simple.</p><p>A final way as a Stellar “hack” you could do is to generate public keys for each transaction and then merge them into the main key once the funds were received. In effect this is how exchanges like Shapeshift handle transactions and would work with all stellar wallets now.</p><h3><strong>POS — Point of Sale</strong></h3><p>China is the king of Mobile payment systems and typically for non card based mobile payments systems they use QR Codes and integrate in one of 3 ways. As this is a closed system many of the security concerns related to web based of open payments are reduced.</p><ol><li><strong>Merchant scanning:</strong> where the client shows a qr code to the merchant and a random transaction number is displayed. Advantages are that the mobile app need not have internet access as long as it generates a random qr code and there is a “pull style” transaction where the merchant can pull from the person’s account. This would not be easy to do on Stellar currently but may be with SEP-007 and and an online wallet.</li><li><strong>Customer Scan</strong>: Customers scans the merchant public key QR code and then input the amount to make the payment. The merchant’s system then gets notification of the payment. This works right now with merchant integration.</li><li><strong>Dynamic QR Customer Scan:</strong> For this the app generates a dynamically produced QR code to represent a transaction. The customer doesn’t need to input the transaction amount, but scans the generated QR code to complete the payment. This works right now. In the stellar world this could be done using the QR code spec from dzham or SEP-007.</li></ol><p>Retail is very important in last mile of the payments ecosystem. Stellar.org blockchain supports 3–5 second settlement times and 1000s of tx per second which could work right now for global retail payments without having to resort to layer 2 systems such as the lightening network.</p><p>TEMPO, a EU based Stellar Anchor is launching a coin event shortly to drive out further value in the crypto-payments space. Visit <a href="https://tempocrypto.com/">https://tempocrypto.com</a> for more information.</p><p>(1) <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">https://en.wikipedia.org/wiki/Public-key_cryptography</a></p><p>(2) <a href="https://www.stellar.org/developers/guides/concepts/federation.html">https://www.stellar.org/developers/guides/concepts/federation.html</a></p><p>(3)<a href="https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki">https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki</a></p><p>(4) <a href="https://www.iana.org/assignments/uri-schemes/prov/bitcoin">https://www.iana.org/assignments/uri-schemes/prov/bitcoin</a></p><p>(5) <a href="https://github.com/future-tense/stargazer/blob/master/docs/qr-codes.md">https://github.com/future-tense/stargazer/blob/master/docs/qr-codes.md</a></p><p><a href="https://github.com/sacarlson/sacarlson.github.io/blob/master/qr-code_extention.md">https://github.com/sacarlson/sacarlson.github.io/blob/master/qr-code_extention.md</a></p><p>(6) <a href="https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki">https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki</a></p><p>(7) <a href="https://tools.ietf.org/html/draft-dold-payto-01">https://tools.ietf.org/html/draft-dold-payto-01</a></p><p>(8) <a href="https://github.com/ethereum/EIPs/pull/681">https://github.com/ethereum/EIPs/pull/681</a></p><p>(9) <a href="http://www.vogella.com/tutorials/AndroidIntent/article.html">http://www.vogella.com/tutorials/AndroidIntent/article.html</a></p><p>(10) <a href="https://blog.bitpay.com/payment-protocol-results/">https://blog.bitpay.com/payment-protocol-results/</a><br><a href="https://github.com/bitpay/jsonPaymentProtocol">https://github.com/bitpay/jsonPaymentProtocol</a></p><p>(11) <a href="https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md">https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0007.md</a></p><p>(12) <a href="https://www.w3.org/TR/2018/CR-payment-request-20180607/">https://www.w3.org/TR/2018/CR-payment-request-20180607/</a></p><p>Reference:</p><p>QR Codes:<br><a href="http://www.nacs.org/LinkClick.aspx?fileticket=D1FpVAvvJuo%3D&amp;tabid=1426&amp;mid=4802">http://www.nacs.org/LinkClick.aspx?fileticket=D1FpVAvvJuo%3D&amp;tabid=1426&amp;mid=4802</a></p><p>Lightning Network:<br><a href="https://lightning.network/lightning-network-paper.pdf">https://lightning.network/lightning-network-paper.pdf</a></p><p>General:<br><a href="https://arxiv.org/abs/1212.3257">https://arxiv.org/abs/1212.3257</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c6fcdc3fa4d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/stellar-payments-thoughts-on-federation-qr-codes-uris-and-point-of-sale-systems-within-the-2c6fcdc3fa4d">Stellar payments — thoughts on federation, QR Codes, URIs, and Point of Sale systems within the…</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sending Secret and Anonymous Memos with Stellar]]></title>
            <link>https://medium.com/lumenauts/sending-secret-and-anonymous-memos-with-stellar-8914479e949b?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/8914479e949b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[stellar-lumens]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[StellarGuard]]></dc:creator>
            <pubDate>Thu, 05 Jul 2018 14:08:40 GMT</pubDate>
            <atom:updated>2018-07-05T14:08:40.323Z</atom:updated>
            <content:encoded><![CDATA[<p>One great thing about decentralized ledgers/blockchains is that the data you put there is immutable, public, and able to be seen/verified by anyone. One bad thing about decentralized ledgers/blockchains is that the data you put there is immutable, public, and able to be seen/verified by anyone.</p><p>On the Stellar network, one common place you’ll see data stored is in the memo field of a transaction, which allows you to store a very small bit of information (max 32 bytes) along with the transaction. The memo field is often used when sending to Stellar accounts that are shared by many users, such as exchange deposit addresses, so that the exchange can link your deposit to your actual exchange account. To do this they typically tell you to enter a memo with containing your exchange user id.</p><p>The problem with this approach is that it leaks data and hurts your privacy. If you have multiple Stellar accounts and make a deposit from each of them to your exchange account, someone doing analysis on Stellar transactions can see that multiple transactions share the same memo and probably infer that your two accounts are related in some way, even though you have not directly send transactions between them.</p><p>StellarGuard is committed to keeping you safe and secure while using Stellar, and that includes finding ways to improve privacy. I set out to find out a way to send memos using Stellar that meet the following requirements:</p><ol><li>The memo must be able to encode arbitrary text, not just ids</li><li>The memos must be able to be decoded back to the original text, but only if you know some additional secret key</li><li>The generated secret memo must fit in a single transaction (Stellar has limits on the size of a memo)</li><li>The generated secret memo must be different every time it is created even if it is run multiple times with the same input</li><li>The solution must require no additional storage per entry (one solution to the exchange problem would be to store a new id per deposit into a centralized database that maps back to the original user id)</li></ol><p>Enter Stellar Secret Memos.</p><p>To solve the first two requirements, it was natural to look at encryption algorithms. Any of the commonly used encryption algorithms out there are able to encode text so that only those who know the secret key used to encrypt it are able to decrypt it. The last three requirements (randomization, no external storage, and memo size) are the interesting bits of the solution.</p><p>First I went looking for an encryption algorithm that doesn’t bloat the final memo size and that could support randomization. I didn’t have to look very far, because one of the most common algorithms, AES-256 in CTR mode, is a perfect fit. The final length of the encrypted data scales well with the size of the input, it is incredibly resistant to attack, and it can be used with a random initialization vector so that the encrypted data changes every time.</p><p>So with the encryption algorithm chosen, I set out to implement it, trying to fit as much space as possible in the memo. My first attempt was just to use “text” type Stellar memos, which normally can fit 28 characters of data, and encrypt the data into that. However, the encryption scheme would use up 8 characters of that space in the memo to encode the randomized initialization vector that makes it so the data changes every time it run, leaving you with only 20 characters left.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ab61209693afd9857f1770f0b837f15/href">https://medium.com/media/0ab61209693afd9857f1770f0b837f15/href</a></iframe><p>While 20 characters seems reasonable, I knew I could do better. Stellar has a different memo type, “hash” memos, which contain exactly 32 bytes of hexadecimal characters. If we encoded the memo into hex, I could potentially add up to 4 more characters of maximum storage (we would still need to use 8 of them for the randomization aspect). Here was my first attempt:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab54c90e5d9beb1d9fb014d784030558/href">https://medium.com/media/ab54c90e5d9beb1d9fb014d784030558/href</a></iframe><p>&gt; Error, “hash” type memo must be 32 bytes of hexadecimal characters</p><p>So while we could indeed fit more data into a hash memo, it would only work if the data size was exactly 24 characters, enough to make the final hash have exactly 32 bytes.</p><p>To solve that problem, I could pad the data with extra random bytes until it fit the required size. However doing that causes another problem: we won’t know which bits of the memo were additional randomized padding and which bits of the memo was the original data. To solve that we just need to store the size of the padding inside the memo itself so when we decrypt it we can pull the padding off the end and get back the original data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6ea5426ae70ed50bb3f601ee46b2457/href">https://medium.com/media/e6ea5426ae70ed50bb3f601ee46b2457/href</a></iframe><p>We’ve done it! At the end of the day were were able to squeeze out an additional 3 characters of space by using hash type memos (lost 1 potential byte so that we could store the padding size).</p><p>All that was left was to package it up into a reusable library: I’ve published version 1 of @stellarguard/secret-memo which is available as a <a href="https://www.npmjs.com/package/@stellarguard/secret-memo">JavaScript/TypeScript library on NPM</a> and the <a href="https://github.com/stellarguard/secret-memo">code is available on Github</a>.</p><p>Here’s how code that uses it might look.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87c1c36d62d1ba551e74a3acf45a18a1/href">https://medium.com/media/87c1c36d62d1ba551e74a3acf45a18a1/href</a></iframe><p>I look forward to the days when exchanges can leverage this code or ideas to keep their customers data more private and secure. When combined with Stellar’s federation servers, exchanges should be able to automatically generate these secret memos without having to have their users copying and pasting anything.</p><p>If you’ve got ideas for how to fit even more characters into the memo or other improvements, let me know here <a href="https://github.com/stellarguard/secret-memo/issues">or file an issue</a>.</p><p>Update: <a href="https://www.reddit.com/r/Stellar/comments/8vjmr8/sending_secret_and_anonymous_memos_with_stellar/e1sk790/">/u/H_M_X_ on Reddit</a> let me know that there is a similar general-purpose message transmission algorithm named <a href="https://hmatejx.github.io/Interstellar-Whisper/">Interstellar Whisper</a>. It supports an arbitrary sized message by breaking it into chunks and several other clever optimizations. It is an incredibly informative and easy to understand algorithm, so please give it a read!</p><p>If you’re interested in security and privacy when using the Stellar network, please try out <a href="https://stellarguard.me/">StellarGuard</a>. Every day more and more users are signing up to protect their XLM and other Stellar assets from hackers and thieves. <a href="https://stellarguard.me/faq">Check out the FAQ </a>to learn more about how StellarGuard can keep you safe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8914479e949b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/sending-secret-and-anonymous-memos-with-stellar-8914479e949b">Sending Secret and Anonymous Memos with Stellar</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Multisig with the Stellar Account Viewer]]></title>
            <link>https://medium.com/lumenauts/using-multisig-with-the-stellar-account-viewer-37ea60c202d3?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/37ea60c202d3</guid>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[stellar-lumens]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[StellarGuard]]></dc:creator>
            <pubDate>Fri, 11 May 2018 15:55:24 GMT</pubDate>
            <atom:updated>2018-05-11T15:55:24.226Z</atom:updated>
            <content:encoded><![CDATA[<p>For a quick refresher of what multisig is, read <a href="https://medium.com/@stellarguard/securing-your-stellar-lumens-with-multisig-and-stellarguard-103385c671e3">https://medium.com/@stellarguard/securing-your-stellar-lumens-with-multisig-and-stellarguard-103385c671e3</a></p><p>The official Stellar.org Account Viewer recently merged a pull request that StellarGuard submitted to add basic support for multisig accounts. Here is how you can use it. Note: the account viewer only supports basic payment operations.</p><ol><li>Go to <a href="https://www.stellar.org/account-viewer/#!/">https://www.stellar.org/account-viewer</a>, which is the website of the official Account Viewer.</li></ol><p>2. Enter your Secret key to sign in (you may also use a Ledger to sign in).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*FpsYAGB0u3vv4IzMytsnBw.png" /></figure><p>3. Enter the public key or federation address of the account you are sending to, and the amount you want to send.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*qti1XC3Xv8RWlPmYyYUwKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*KoANbIT4MInYzzvhCX1VmA.png" /></figure><p>4. Click “add memo” to add an optional memo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*VP45npxG8l1S0AbhqlJnLA.png" /></figure><p>5. Click “Send lumens” to be taken to a confirmation page. Verify that the payment information is correct and click “Submit transaction”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*uHJrv7b6R86RkkMNvyPBjg.png" /></figure><p>6. If your account has multisig enabled, instead of submitting the transaction, you will be taken to page that displays the signed transaction XDR (encoded transaction details). You can then copy this XDR and send it to someone else to sign it in their tool of choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*bfNRaqwCZadgGBxx1-M_og.png" /></figure><p>7. If you are using <a href="https://stellarguard.me/">StellarGuard</a> to protect your account, you may go to <a href="https://stellarguard.me/transactions/new">https://stellarguard.me/transactions/new</a> and paste the transaction XDR and press “Submit”. You will then receive an email with instructions about how to authorize the transaction (a code sent in the email, or 2 factor auth code from an authenticator app).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*j5T84rVq3_QV6HslbzVhAg.png" /></figure><p>That’s it! Multisig transactions in the official Stellar Account Viewer!</p><p>If you’d like to see StellarGuard integrated directly into the Account Viewer so that accounts protected by StellarGuard will have their transactions submitted directly to StellarGuard, give a +1 at <a href="https://github.com/stellar/account-viewer/pull/68">https://github.com/stellar/account-viewer/pull/68</a>.</p><p>This tutorial is available at: <a href="https://stellarguard.me/help/new-transaction-account-viewer">https://stellarguard.me/help/new-transaction-account-viewer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37ea60c202d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/using-multisig-with-the-stellar-account-viewer-37ea60c202d3">Using Multisig with the Stellar Account Viewer</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dealing with Crypto on the Client Side]]></title>
            <link>https://medium.com/lumenauts/dealing-with-crypto-on-the-client-side-2a79209eb8b5?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/2a79209eb8b5</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Tyler van der Hoeven]]></dc:creator>
            <pubDate>Fri, 11 May 2018 14:43:33 GMT</pubDate>
            <atom:updated>2019-06-10T17:23:42.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eDuyL7l8N39gsDb-KFLtog.jpeg" /></figure><h4>Utilize <a href="https://auth0.com/">Auth0</a> and <a href="https://webtask.io/">Webtask</a> for account creation and transaction signing so we can enjoy a fully secured yet fully flexible client side crypto experience.</h4><h3>The Problem</h3><p>My journey into crypto began from an outside and frontend experience. I’m a farmer turned photographer turned designer turned frontend engineer turned fullstack engineer. I’m also a serial entrepreneur always dreaming up my next big thing and trying to explain its glorious ins and outs to my less interested friends and family.</p><p>Bridging the gap between the technical and the usable, the doable and the needed has become my full time job in all the other small tasks I find myself busy about day to day.</p><p>Nowhere else have I found the contrast as strong as in crypto. I adore this space, it’s energy and potential, the fire around the ideas and the dangers lurking around every corner. Yet too nowhere else have I found such a tremendous gulf between where I work and find my interest and where normal everyday people live. Often it’s a seemingly hopeless divide where conversations most often end abruptly with myself being written off as a risky money hungry idealist probably contributing to an apocalyptic one-world-order and myself frustrated with the amount of stubbornness, misinformation and arrogance around a topic they are truly uninformed in.</p><p>My battleground for this divide though has most often and strongly been side project applications, and most specifically <a href="https://www.stellar.org/">Stellar</a> application entries in their <a href="https://www.stellar.org/lumens/build/">build challenges</a>. Here I’ve found my place to explain the ins and outs of the technology and use case through services like <a href="https://billingfox.com/">BillingFox</a>, games like <a href="https://colorglyph.io/">Colorglyph</a> or even low level tools like the a <a href="https://galactictalk.org/d/885-graphql-interface-for-core-and-horizon-databases">GraphQL interface</a> for Stellar’s Core and Horizon PostgreSQL databases.</p><p>All of this work, problem solving, explaining and shipping has greatly helped in my ability to both understand the concepts myself but also to explain them to others. However for me there remained one large obstacle. Onboarding. Getting users, moms and dads, sisters and brothers, friends and family connected with their own Stellar accounts able to really consume crypto services in a much more intimate way. This is a huge problem for crypto right now, it’s in a very infant, low level stage where access to the network requires a lot of due diligence that frankly very few people are qualified or competent to handle. The sad thing though is that there really aren’t many options for us, it’s very much a “too bad so sad” atmosphere out there. Good luck and hope you don’t screw up. Fear and poor practices abound and the unsuspecting user is just so incredibly likely to get it wrong at one point or another.</p><p>And that’s just for the average Joe Shmoe on the street. App developers don’t have it much better. Do you ask users to bring their own accounts and be responsible to store their own secrets safely? Do you yourself create, maintain and manage an ever increasing number of accounts only too mess up one day perhaps even through no fault of your own? Negligence abounds and especially for the solopreneur or small team mistakes are bound to happen. However the data you’re dealing in must be treated better. There are lots of ideas, solutions and proposals out there for how best to handle these problems and I too have given it a lot of thought and energy. Today I’m happy to reveal a collection of code which I will be implementing into an upcoming revision and rebuild of Colorglyph which aims to elegantly and definitively solve the problem of onboarding my users directly into the Stellar platform.</p><h3>The Solution</h3><p>My answer is really quite simple. Offload each responsibility in question to whomever is most qualified to handle it. This shifts the whole problem then from ensuring those parties which are not qualified to not get things wrong to clearly identifying responsibilities and then appropriately assigning them to the most qualified parties.</p><p>This idea is nothing new, in fact you’re already implementing a lot of this logic into both your daily lives and any applications you already maintain. I don’t grow much of my own food or own a coffee plantation, I offload that responsibility to those qualified like farmers, Starbucks and Aldi. Neither do we expect our users to process their own credit card payments nor do we often directly do that ourselves. We use services like Stripe or PayPal who are far more qualified to deal with that complex problem.</p><p>My proposal is simply to follow suit and offload the responsibility of crypto account management to a service qualified to do so. For me that would be <a href="https://auth0.com/">Auth0</a>, my goto solution for all things identity and security. I already use them exclusively for application onboarding through their Lock service, why not simply extend that functionality to encompass Stellar account creation, maintenance and management. Seems obvious enough but as there are no off the shelf solutions for such an addon service one had to be concocted from scratch.</p><h3>Introducing StellarAuth</h3><p><a href="https://create.stellarauth.com/">https://create.stellarauth.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*MIaLS8tGDTgw8IAD4T8ANw.gif" /><figcaption>From page load to safely spending XLM from a new secured account in less than 40 seconds</figcaption></figure><p>At first blush this may not seem super special but believe me, this is huge. Allow me to explain.</p><h4>TL;DR</h4><ul><li><a href="https://github.com/TinyAnvil/stellarauth-webpack">https://github.com/TinyAnvil/stellarauth-webpack</a></li><li><a href="https://github.com/TinyAnvil/stellarauth-webtask">https://github.com/TinyAnvil/stellarauth-webtask</a></li></ul><ol><li>User authenticates via Auth0</li><li>Login triggers a Webtask to generate a Stellar account and assign it to the authenticated Auth0 user</li><li>User action (Clicking “Verify Account”) triggers another Webtask in which a Stellar account creation transaction is posted which will create and fund the new account</li><li>User is now free to send transaction XDRs (limited to medium threshold operations) from the client to another Webtask which will verify account ownership, sign and submit the XDR to Stellar. Notice there is an additional Authy 2FA step to submit transactions. This step isn’t strictly necessary as the account is fully secured but as an extra measure and good practice for this example it is enforced.</li></ol><h4>TS;WM</h4><p>There are a lot of smaller details within both the client and server side of this solution which are very much worth noting and which I will write about at length in a part 2 of this article in the coming weeks. For example how is it I’m able to manage seeming fee-less transactions from the client account? Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a79209eb8b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/dealing-with-crypto-on-the-client-side-2a79209eb8b5">Dealing with Crypto on the Client Side</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Trustless Workers with Stellar]]></title>
            <link>https://medium.com/lumenauts/distributed-trustless-workers-with-stellar-e197fd1b77f6?source=rss----46f664cd58a6---4</link>
            <guid isPermaLink="false">https://medium.com/p/e197fd1b77f6</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[stellar]]></category>
            <dc:creator><![CDATA[Zulu Crypto]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 13:37:12 GMT</pubDate>
            <atom:updated>2018-04-19T13:37:11.927Z</atom:updated>
            <content:encoded><![CDATA[<p>This article describes something you can do with cryptocurrency besides speculating on the price: pay a distributed network of untrusted workers to create something for you.</p><p>Read on for an in-depth look at how <a href="https://stellar.org/">Stellar</a>’s advanced features can be used to create a “smart contract” between a customer and an anonymous and untrusted worker.</p><h3>Finding something to create</h3><p>Bitcoin and Stellar are both built around the concept of an “address” that is used to send payments. An example Stellar address is: GABFWOKKMDRIDRTUBI6M5SNMABX6XGRPYBYMJ24IIFCDYYZRCKTSKCXZ</p><p>Since that series of random letters and numbers isn’t very user friendly, it’s nicer to have a recognizable address that starts or ends with an english word. For example, if the last four letters were ZULU then it would be much easier to recognize this address and verify a payment was going to the right place.</p><p>Custom addresses like this are known as “vanity addresses” and need to be generated by randomly creating addresses until one is found. Generating a series of four characters would go quickly, but generating ZULUCRYPTO would take much longer. This is a perfect problem for a distributed group of workers!</p><h3>Process Overview</h3><p>There are two actors involved in this transaction:</p><ul><li>The Customer who wants a vanity address generated. I’ll abbreviate their Stellar account as GCUSTOMER (Stellar addresses always start with G). They start with 500 XLM and want to pay 100 XLM for a vanity address.</li><li>The Worker who generates the vanity address: GWORKER. The Worker is willing to accept 100 XLM to generate a vanity address.</li></ul><p>I’ll refer to the vanity address that gets generated as GVANITY.</p><p>Here’s how things look at the beginning:</p><pre>Account: GCUSTOMER<br>Balance: 500 XLM</pre><pre>Account: GWORKER<br>Balance: 1600 XLM</pre><h3>Customer Advertises their Request</h3><p>In order to get work started, the Customer has to solve a few problems:</p><ol><li>How to advertise to the network that there is work to be done?</li><li>How to prove to a Worker that the worker will get paid?</li></ol><h4>Advertising the request</h4><p>First, the Customer has to figure out a way to advertise what vanity keypair they want. This is done by setting a <a href="https://www.stellar.org/developers/guides/concepts/ledger.html#data-entry">Data Entry</a> on an account. Each data entry is a key/value pair, so as long as the Customer and Worker can agree on a standard, this is a way to broadcast something to the entire network.</p><p>In this case, we’ll set the key request:generateVanityAddress to value G*ZULU . Now, the Worker can scan the blockchain for any accounts with the request:generateVanityAddress data and then examine the value to see what vanity address is requested. In this case, it’s anything that starts with “G” and ends in “ZULU”.</p><h4>Proving that a Worker will get paid</h4><p>This can be solved through the use of an Escrow account (that the Customer creates) which we’ll refer to as GESCROW. In order for an escrow account to be effective, the Worker needs to know that the Customer has the funds available to pay them and that the Worker will be able to access those funds when the vanity address has been generated.</p><p>The Customer also needs some way to reclaim their funds if a Worker never completes their task.</p><p>We’ll go in reverse and come up with a way for the Customer to retrieve their funds by creating a pre-authorized transaction that’s not valid until 30 days have passed:</p><pre>Transaction Name: txReclaimAccount<br>    Submitted By: GESCROW<br>      Timebounds: Valid starting 30 days from now</pre><pre>Operations:<br>  1. Merge GESCROW into GCUSTOMER</pre><p><strong>Timebounds</strong> are a Stellar feature that allows you to create a transaction that’s only valid during a specific time range. For more details on transactions, see: <a href="https://www.stellar.org/developers/guides/concepts/transactions.html">https://www.stellar.org/developers/guides/concepts/transactions.html</a></p><p>The <strong>Merge</strong> operation destroys an account and sends all funds to a destination account. The operation above will destroy GESCROW freeing up its resources and sending the balance back to GCUSTOMER.</p><p>The customer now saves this transaction somewhere and can submit it to the network after 30 days have passed.</p><p>Now it’s time to prove to the Worker that the Customer no longer has access to the escrow account for these 30 days. To solve this problem, we use Stellar’s <a href="https://www.stellar.org/developers/guides/concepts/multi-sig.html">multisignature features</a>.</p><p>As the Customer, we immediately submit this transaction to the network:</p><pre>Transaction Name: txShareAccount<br>    Submitted By: GESCROW</pre><pre>Operations:<br>  1. Add GWORKER as a signer with weight 1<br>  2. Add GCUSTOMER as a signer with weight 1<br>  3. Require a weight of 2 to perform any actions on the account<br>  4. Set the weight of the master key (GESCROW) to 0</pre><p>After this transaction is submitted, a weight of 2 is required to do anything with this account. Since the GESCROW master key now has a weight of 0, the only way for anything to happen is if GCUSTOMER and GWORKER agree on a transaction and both sign it.</p><p>The one exception to this is the pre-authorized txReclaimAccount transaction, but since it’s not valid for 30 days, the Worker is guaranteed 30 days to work on generating the vanity address.</p><p>At this point, we have the following accounts:</p><pre>Account: GCUSTOMER<br>Balance: 400 XLM (100 transferred to GESCROW)</pre><pre>Account: GWORKER<br>Balance: 1600 XLM</pre><pre>Account: GESCROW<br>Balance: 100 XLM (100 from GCUSTOMER)<br>Signers:<br>  1. GCUSTOMER (weight 1)<br>  2. GWORKER (weight 1)<br>  3. Master key can no longer sign<br>  4. Pre-authorized transaction (valid starting 30 days from now)</pre><p>To keep things organized, GESCROW is also the account that the request:generateVanityAddress data entry mentioned above is attached to.</p><h3>Worker begins work</h3><p>We’ll switch over to the Worker’s perspective now. By scanning the blockchain, we’ve discovered that someone has requested an address that ends in “ZULU”.</p><p>Since this request is attached to the Escrow account, we can see that the price is reasonable (100 XLM) and that the escrow account is locked and cannot be reclaimed by the Customer while we’re working on it.</p><p>The actual algorithm for generating a vanity address involves repeatedly generating random keys until we find one that matches the Customer’s desired pattern.</p><p>At some point, we’ll find a matching address and then we have to begin the process of communicating it to the Customer.</p><h3>Worker proves that they found a keypair</h3><p>After finding a keypair, the Worker’s challenge is to prove to the Customer that they’ve generated it. There also needs to be a way for the Customer to pay the Worker by transferring the escrow account.</p><p>This process will again rely on account data entries. In this case, they will be attached to the Worker account.</p><p>First: set a data entry with key:value GCUSTOMER_result:GVANITY . This allows the Customer to examine the data entries on GWORKER to check if the Worker is done.</p><p>Then, we need a way to prove to the Customer that the Worker controls the private key for GVANITY without revealing what that private key is. This process should sound familiar since that’s how cryptocurrencies work! When you’re submitting a transaction to the network you’re using your secret key to sign a transaction. In this case, we’ll sign a text string and write the signature to our account as the following key:value pair: GCUSTOMER_proof:&lt;ed25519 signature&gt;. The text being signed doesn’t matter as long as GCUSTOMER and GWORKER both know what it is.</p><p>The final thing the Worker needs to take care of is generating signatures for the transfer transaction.</p><h3>The transfer transaction</h3><p>This transaction is the critical part of the process and allows the Customer and Worker to exchange payment and data in a single operation. Due to the properties of the Stellar Consensus Protocol, all operations in a transaction will either succeed or fail. There’s no way for the transaction to be partially completed.</p><p>This transaction will look like the following:</p><pre>Transaction Name: txTransfer<br>    Submitted By: GCUSTOMER (see the next step)<br>  Source Account: GCUSTOMER</pre><pre>Operations:<br>  1. GVANITY: Add GCUSTOMER as a signer with weight 1<br>  2. GVANITY: Set all thresholds to 1<br>  3. GVANITY: Set master key weight to 0<br>  4. GESCROW: Merge to GWORKER</pre><p>The first three operations take care of giving control of GVANITY to GCUSTOMER. After the above transaction runs, the secret key to GVANITY (only known by GWORKER) will no longer be able to perform any operations on the account since its weight will be 0 and all operations have a threshold of 1.</p><p>The last operation is how GWORKER receives payment: GESCROW is merged to GWORKER which transfers all XLM in the account.</p><p>Since this transaction involves three accounts (GCUSTOMER, GVANITY, and GESCROW) it will require three signatures:</p><ul><li>GWORKER to provide 1 of 2 necessary weights to mergeGESCROW</li><li>GCUSTOMER since they are the source account (which means they are paying all fees) and are 1 of 2 necessary weights to merge GESCROW</li><li>GVANITY because we’re altering the thresholds and master key weights of GVANITY</li></ul><p>Since the Worker knows the private keys for GWORKER and GVANITY it can provide these signatures and write them as data entries on the GWORKER account.</p><p>Note that the Worker is not submitting the above transaction! They only generate the signatures for it. It will be the Customer’s responsibility to provide the final signature and submit to the network.</p><h3>Customer verifies vanity keypair and submits transfer transaction</h3><p>The Customer checks the data entries on GWORKER and sees the following:</p><pre>     Account: GWORKER<br>Data Entries:<br>  GCUSTOMER_result: GVANITY<br>  GCUSTOMER_proof: &lt;ed25519 signature&gt;<br>  GCUSTOMER_sigW: &lt;worker stellar signature for txTransfer&gt;<br>  GCUSTOMER_sigV: &lt;vanity keypair stellar signature for txTransfer&gt;</pre><p>The Customer now takes the following steps:</p><ol><li>Verify that the data in GCUSTOMER_proof is a valid signature. This is how we know that GVANITY was really generated.</li><li>Build txTransfer . The Customer and Worker both independently build this transaction. All that needs to be exchanged are the signatures.</li><li>Add a signature from GCUSTOMER to txTransfer</li><li>Add the _sigW and _sigV signatures that were read from the GWORKER data entries</li><li>Submit txTransfer to the Stellar network now that the Customer has all of the necessary signatures</li></ol><p>As soon as txTransfer is submitted and confirmed then the process is complete!</p><h3>Customer uses vanity address</h3><p>The Customer is now in control of the vanity address, but you’ll note they never received the secret key.</p><p>Instead, Stellar’s multisig features are used to allow GCUSTOMER to sign for GVANITY.</p><p>For example, to pay 50 XLM toGMERCHANT, the following transaction would be generated:</p><pre>Transaction Name: txExamplePayment<br>    Submitted By: GCUSTOMER</pre><pre>Operations:<br>  1. From GVANITY: Pay 50 XLM to GMERCHANT</pre><p>GCUSTOMER would then sign this transaction with their own secret key. Even though the payment is coming from GVANITY, GCUSTOMER can provide a weight of 1 with their signature which is enough to perform any operation.</p><h3>Real-world Implementation</h3><p>A working implementation of this would require that Customers and Workers agreed on some standards. It would also require additional data entries for better communication between the two parties.</p><p>Source code implementing a test version of this smart contract is available at: <a href="https://github.com/zulucrypto/stellar-smart-contracts/blob/master/distributed-worker/README.md">https://github.com/zulucrypto/stellar-smart-contracts/blob/master/distributed-worker/README.md</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e197fd1b77f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lumenauts/distributed-trustless-workers-with-stellar-e197fd1b77f6">Distributed Trustless Workers with Stellar</a> was originally published in <a href="https://medium.com/lumenauts">Lumenauts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>