<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mandel duck on Medium]]></title>
        <description><![CDATA[Stories by Mandel duck on Medium]]></description>
        <link>https://medium.com/@mandelduck?source=rss-b4ceaa3ea5ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wBR-SCqvEMgez5PFkQ-x3w.png</url>
            <title>Stories by Mandel duck on Medium</title>
            <link>https://medium.com/@mandelduck?source=rss-b4ceaa3ea5ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:59:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mandelduck/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Confessions of an OP_RETURN eater]]></title>
            <link>https://mandelduck.medium.com/confessions-of-an-op-return-eater-4aecaab6b8e0?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aecaab6b8e0</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[spam]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[ordinal]]></category>
            <category><![CDATA[op-return]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Thu, 01 May 2025 15:49:45 GMT</pubDate>
            <atom:updated>2025-05-02T08:23:32.473Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rFScd4vJ-cd9_GMm" /></figure><p>I sit here drinking my third, fourth, fifth cup of digital Laudanum, reading the comments from conservative, progressive, puritan, and outright virtue-signaling avatars on X, and I can’t help but think — we’ve been here before. <em>I</em> have been here before.<br> For I was an OP_RETURN junkie.<br> Yes, I spent my fair share of time filling up blocks with the digital equivalent of Duchamp’s toilet — blatants act of vandalism — painting the blocks green with Pepe the Frog absurdities.</p><p>But as corruptible as I once was, there’s one thing I can say I never did:<br> I never pissed in the UTXO set.</p><p>Ah yes, I experimented with 80 bytes’ worth of sin.<br> I dabbled with hashes like they were hashish.<br> But I can honestly, hand on heart, say I never misused, abused, or mistreated a public key.</p><p>Why did I not do such a thing?<br> What does it mean to mistreat a public key?<br> And can you even smoke a hash — and where does one get some? (Asking for a friend.)</p><p>Let me first give a brief explanation of the ways people can “store” data on the blockchain, and the difference between storing data in the blockchain versus the UTXO set.</p><p>First off the bat, we aren’t concerned about data being stored in the blockchain. Why? Because storage is cheap. The size the blockchain can grow is limited by the block size, and to be fully sovereign, we don’t need to store the whole blockchain once we’ve verified it to generate the UTXO set.</p><p>The UTXO set is the real problem — because it has no limit, is more expensive to store in memory, and if used incorrectly, it becomes impossible to prune.</p><p>Back in 2015, I was heavily involved with the Counterparty protocol, which let people issue tokens on the Bitcoin blockchain. Most notably, the RAREPEPE movement used this to issue PEPE NFTs (although the term “NFT” hadn’t been coined yet).</p><p>This was mainly done using the OP_RETURN flag in a Bitcoin transaction, which allowed you to store 80 bytes of data—enough to store the token’s name and a link or hash of the image.</p><p>Generally, developers and node runners alike preferred that people use OP_RETURN to store data. Why? Because it was provably not money—i.e., not a transaction that sent, spent, or hodled Bitcoin. So, as a node runner, I could safely remove it from the UTXO set and still fully validate all the Bitcoin in the world. At the time most people in counterparty werent bothered about storing image data in the chain. Since it wasn’t important to store the image on-chain — as people rightly point out, you can copy and paste an image — it was acceptable for the image to live off-chain. A token, on the other hand, can’t be copied and pasted in the same way.</p><p>However, those damn OP_RETURN eaters were still hungry. The 80 bytes of data wasn’t enough for them! There was a certain aesthetic about storing the whole image in the chain, and that could not be done with OP_RETURN</p><p>So they went down dark alleys, turned left at the clinic that sold methadone, and went straight for the good stuff—top-quality opioids that let them store more than 80 bytes, allowing full JPEGs to be encoded into the blockchain.</p><p>This was mainly done using inscriptions, adding the data to the witness.<br> I won’t make this a technical article, but the important thing to note is that this is still (mostly) prunable. That is, the image data is not in the UTXO set — so once verified, it doesn’t live there permanently.</p><p>However, down a darker alley still, there is a taint of death — a flavor of mortality — where lie the real degenerates, using the fentanyl equivalent of arbitrary data storage: <strong>fake public keys</strong>.</p><p>Fake public keys are impossible to remove from the UTXO set because you can’t distinguish them from real ones. They’re basically public keys that have no corresponding private key and thus can never be spent.</p><p>I believe well-meaning folks think that by limiting OP_RETURN, they’ll reduce spam.<br> However, in reality, limiting it has pushed spam into more insidious and harder-to-remove forms.</p><p>With an unlimited OP_RETURN, we have the best chance of spam being out in the open—where we can see it and keep it out of our UTXO set.</p><p>With a restricted OP_RETURN, it becomes harder to run a node, as more and more spam seeks refuge in (fake) public keys—living alongside genuine transactions like a kind of Bitcoin replicant.</p><p>However, one thing still keeps me up at night. While I was sipping my laudanum and hanging out in the opium dens, it dawned on me — the fentanyl crowd. Even though they had access to the methadone that was OP_RETURN and the opium that was witness data—even if you told them OP_RETURN would be unlimited, and we might even give them the same discount as witness data—they preferred pubkeys. That is, they had a thirst to store data in a way that was harmful, purely for the sake of harm. Because they could. Because it hurt people.</p><p>It’s a kind of punk rock — but not the genuine kind. Real punk rockers are usually nice guys who genuinely love music. This is more akin to today’s Spotify Top 10: “artists” who seem to make music only to harm music itself, or purely for financial gain. These cretins just want to add data in the most damaging way possible, and that somehow gives their NFTs value.</p><p>The only way to fight this is to stop talking about it. Don’t give them the airtime. Ignore it. No Barbara Streisand effect. Don’t even write articles about …</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aecaab6b8e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Counterparty vs RGB vs TARO]]></title>
            <link>https://mandelduck.medium.com/counterparty-vs-rgb-vs-taro-8cd707d544f7?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cd707d544f7</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[counterparty]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[rgb]]></category>
            <category><![CDATA[taro]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Mon, 31 Oct 2022 10:07:35 GMT</pubDate>
            <atom:updated>2022-10-31T10:07:35.095Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently attended a Historical NFT festival, what are Historical (or Vintage) NFTs? in layman&#39;s terms they are the NFTs that were around before NFTs became “cool”. At this festival the Counterparty protocol seemed to be the main area of focus as arguably it was really the first NFT platform on bitcoin back in 2014 (there were other protocols but Counterparty was the first used to mint what we now call NFT art rather than utility or financial tokens).</p><p>Fast forward to 2022 and we have two new protocols launching on the bitcoin network namely RGB and a similar protocol called TARO.</p><p>RGB and TARO are largely the same (TARO was previously called CMYK as a kind of tease to RGB) and they are not my area of expertise so I won’t contrast them in too much detail, however I would like to compare Counterparty to these new Bitcoin token 2.0 protocols and ask why make something new?</p><h3>Counterparty Summary</h3><p>Launched in 2014, Counterparty emerged amongst other token protocols such as colored coins and Mastercoin (now known as omni).<br>Colored coins seemed to be created with ideas such as “tokenizing shares of gold on the blockchain” in mind. Mastercoin was quite corporate and not easy to use without collaboration from the company behind it. Counterparty launched as an open standard with an easy to use wallet that everybody had access to making it ripe for adoption amongst casual bitcoins in the community.</p><p>The original founders designed it with financial services in mind, such as using tokens to represent shares in a company, however there were several legal issues and complications around doing this so they ultimately left the project to form a more corporate structure (symbiont.io). This left the protocol in the hands of the community who started to use it for “community” projects such as RAREPEPE, collectibles art, etc.</p><p><strong>How did Counterparty work?</strong></p><p>Unlike colored coins which tracked Satoshis, Counterparty is a data layer on top of bitcoin.</p><p>Another way to explain it is with colored coins you would say “this satoshi represents this bar of gold” then in order to transfer that bar of gold from Alice to Bob you would just send that Satoshi from Alice to Bob. (technically not this simple but its good enough for a medium post)</p><p>However if you wanted to buy a coffee and accidentally sent that same Satoshi to Charlie the barista, then Charlie would then have that gold. (or at least Satoshi representing it)</p><p>This meant one had to be careful using colored coins as it was easy to accidentally send a token to a receive who was not expecting it, could not see it nor could return it.</p><p>Conversely in Counterparty you would have to make a special Counterparty transaction to transfer ownership of a token. The counterparty node would then parse this transaction data out of the blockchain and update a ledger/database that lived in the Counterparty node.</p><p>This was done using OP_RETURN a way to store arbitrary data in a bitcoin transaction and thus into the bitcoin blockchain.</p><p>The OP_RETURN data would say something like</p><p><em>SEND 1 RAREPEPE to ADDRESS X</em></p><p>You would put this OP_RETURN data into a bitcoin transaction and as long as you signed that transaction with they key of the address that currently held the RAREPEPE the token would be transferred to the new address stated in the OP_RETURN data.</p><p>An advantage of using OP_RETURN is that it mean full nodes not interested in Counterparty would not need to store nor validate this data and could prune it out of their node.</p><p><strong>Why create RGB/TARO if we have Counterparty?</strong></p><p>This is a fair question, as of today Counterparty seems to have more features than RGB and TARO and has been running since 2014, so why make a new protocol?</p><p>I think there are several reason why a developer would prefer to make a new protocol from scratch rather than build on top of an existing one.</p><p><strong>Motivation</strong><br>I think a big reason is just that developers like to create their own project and have their own “baby”. It’s more motivating to work on your own idea rather than maintain and improve an existing project.</p><p><strong>Technical</strong><br>Starting a new codebase lets you create good code using the latest learnings and technology, it can be messy shoe horning new paradigms into an existing codebase. There were also many developers who looked at the Counterparty code base and just though it was poor. Especially given todays standards and new technologies in cryptography.</p><p><strong>Scalability</strong><br>As RGB/TARO uses client side validation (explained later) it inherently scales better as each user does not need to store the history of all tokens.</p><p><strong>Ignorance</strong><br>Many developers either didn’t know about Counterparty or thought that it was dead</p><p><strong>Counterparty Token</strong><br>I think this is an important factor. Bitcoiner’s in general don’t want to work on a protocol that has its own Token, which Counterparty did called XCP. I feel this forever tainted the project and in hindsight I think it would have been best to never have issued it.</p><p>However I would argue it’s not quite the same as other protocol tokens as</p><p><strong>a) You don’t actually need it</strong><br>You can make Counterparty transactions, issue assets, use the decentralised exchange without ever touching XCP and just using BTC</p><p><strong>b) It was fairly sold</strong><br>Unlike other protocols that did an ICO enriching the founders, XCP was distributed via <em>proof of burn</em>, meaning you had to burn bitcoin to get XCP. This meant the founders had to spend their own bitcoin to get XCP and thus could not just enrich themselves with a pre issuance.</p><p><strong>What was XCP used for?</strong><br>Although you don’t need XCP to use Counterparty it is required to issue assets with custom names. Counterparty asset names are unique, similar to URLs, so you have the same issue as URL squatting i.e. an entity will pre buy up <em>INSERT_POPULAR_NOUN.com</em><br>In order to mitigate this in Counterparty you had to have XCP inorder to issue custom asset names, such as SATOSHI coin or FREEDOM coin.</p><p>Another small requirement for XCP was to use the Counterparty DeX (decentralized exchange). The DeX allowed p2p non custodial trading of Counterparty assets. i.e. I could make a sell order trading 1 RAREPEPE for 1 SATOSHICARD and simply broadcast that order to the bitcoin blockchain, if some one made a sell order trasing 1 SATOSHICARD for 1 RAREPEPE the order would automatically be fulfilled and the assets transferred.</p><p>Thus in the case where a user wanted to trade a token for another token, XCP was not required, however trades often do better when assets are not bartered 1 for 1 but rather bought and sold for a liquid base currency. Ideally this would be BTC but technically it was not really possible as bitcoin doesn’t exist on the Counterparty protocol layer only Counterparty assets do hence the idea was that people could trade assets for XCP and then sell that XCP on an exchange for BTC. (Ultimately the base asset ended up being PEPECASE and not XCP!)</p><h4>Why is RGB/TARO better than Counterparty?</h4><p>Apart from the fact that it doesn’t have its own token giving it a “clean” image there are many technical innovations that make RGB/TARO compelling.</p><p>I believe the main technical merit is the way <strong>data is stored.</strong></p><p>As mentioned before Counterparty uses OP_RETURN to save Counterparty messages updating its ledger/state in the bitcoin blockchain. As it uses OP_RETURN regular bitcoin nodes need not parse nor store this data however if you run a Counterparty node you do have to store a large ledger containing the state of all Counterparty transactions.</p><p>RGB/TARO use <strong>client side validation.</strong></p><p>This means the ledger or state of the network is not stored in the bitcoin blockchain rather each user needs to store this data for themselves off chain in their own database.</p><p>A hash/proof of this database is stored in the bitcoin blockchain and via a clever use of <strong>Merkle Trees</strong> you only have to store the data of tokens you wish to interact with.</p><p>For example in Counterparty if I am Alice and I send Bob 1 RAREPEPE, then Charlie sends David 1 SATOSHICARD, I have to store record of Charlie and Davids state even though it has nothing to do with my transaction to Bob. Charlie and David also see my transaction to Bob making it less private.</p><p>In RGB/TARO I could ignore any data regarding Charlie’s transaction to David. If David then sent the SATOSHICARD to me Alice I would only need to store and validate the data at that point.</p><p>This ultimately makes RGB/TARO more private as 3rd parties will not know about my transaction until I include them in it. It also means I need to store less data. This hash/proof is effectively indistinguishable from a regular bitcoin signature when it is included in the tapscript, meaning that RGB/TARO transactions look like regular bitcoin transactions. Counterparty transactions are transparent as they use OP_RETURN and thus can be (and have been) censored by nodes and miners.</p><p>(note: it seems that RGB also lets you use OP_RETURN to store the hash instead of tapscript, however it is just a generic hash and cannot be differentiated from other OP_RETURN hash based protocols such as open timestamps)</p><p>RGB/TARO being new projects (with VC backing) may also be able to excite and fund more developers to work on the protocol ultimately making better tools, slicker wallets etc</p><p>Many companies funding and building out Counterparty since 2014 have since gone bankrupt or moved onto chains such as Ethereum leaving the development pace slow with the ecosystem largely relying on community donations. <br>(However the recent 2021 NFT bubble did see some money find its way back into Counterparty development with several devs going “full time” on the project and new companies building on top of it)</p><p><strong>Why is Counterparty better than RGB/TARO</strong></p><p>One downside of the client side validation in RGB/TARO is if I lose my data and nobody else has a copy of it I lose the ability to make any further transactions and would effectively lose my assets.</p><p>With Counterparty the state can be re-parsed and computed from the bitcoin blockchain at any point.</p><p>Subjectively I would also argue that the asset names being unique make Counterparty more compelling for “collectibles/NFTs”</p><p>Feature wise the Counterparty protocol is ahead of RGB/TARO allowing users to issue, send, receive, trade on a DeX, do dividends, batch send, create dispensers and many more etc</p><p>Counterparty also has an existing eco system and community which has built up over the years.</p><p><strong>Why do RGB, TARO and Counterparty all suck?</strong></p><p>Personally the problem with all these proctcols is they require an onchain transaction to transfer ownership of non fugible or illiquid assets.<br>You can technically make lightning networks with the fungible tokens a built on top of them (such as stable coins). However as far as NFTs are concerned I don’t think the kind of uses cases that people imagine being useful will be possible. One example is using NFTs for gaming. Popular games do thousands if not hundreds or even millions of transactions a second, if each transaction requires an on chain bitcoin transaction this would not scale and would lead to the relatively few users who could use them having to pay large fees. Personally I saw this happen in 2017 when I had games using Counterparty with players having to pay $10 in fees to trade a $1 game item and waiting days for it to confirm.</p><p>Not much has fundamentally changed with RGB and TARO in this respect, yet, RGB does allow batching (Counterparty as well) but I am hopeful that these protocols may find better homes in future possible bitcoin side chains projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cd707d544f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SaruTobi Lightning]]></title>
            <link>https://mandelduck.medium.com/sarutobi-lightning-554d026ead70?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/554d026ead70</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[lightning]]></category>
            <category><![CDATA[sarutobi]]></category>
            <category><![CDATA[zebedee]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 20:03:53 GMT</pubDate>
            <atom:updated>2020-11-26T20:07:08.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*2ybMaIwfQbHcI0mytEOi8w.png" /></figure><p>I am pleased to announce the re-launch of SaruTobi using the lightning network<br>To try it out please join the SaruTobi channel on the MintGox Discord <br><a href="https://discord.gg/sdsTv8uD">https://discord.gg/sdsTv8uD</a> where links will be provided</p><p><strong>What is SaruTobi?</strong></p><p>SaruTobi is a game I developed back in 2014, it is a simple casual style game that involves tapping the screen to build up momentum and swing a monkey (SaruTobi is Japanese for Monkey Fly!), the aim of the game is to use a combination of power ups and skill to see how far you can make the monkey fly.</p><p>Back in 2014 I had success incorporating bitcoin into the game via small tips that were sent to the player.</p><p><a href="https://www.coindesk.com/apple-approves-ios-game-tips-players-bitcoin">https://www.coindesk.com/apple-approves-ios-game-tips-players-bitcoin</a></p><p>However as bitcoin hit scaling issues this model no longer became feasible and I shelved the game until a better bitcoin protocol was ready for such applications. Fast forward to today and we have the lightning network allowing me to send low value tips with close to zero fees, instantly!</p><p>Here is a demo of a player collecting a 100 sat tip and cashing out instantly via the ZEBEDEE wallet.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbUnwcSGHor8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbUnwcSGHor8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbUnwcSGHor8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dca424522c21f925227086a14db3bee2/href">https://medium.com/media/dca424522c21f925227086a14db3bee2/href</a></iframe><p><strong>Where does the bitcoin come from?</strong><br>The game is currently available on Android and iOS in open beta testing mode. The bitcoin is provided from advertising revenue, if you are interested in advertising or donating bitcoin you can reach out to me on twitter <a href="http://twitter.com/mandelduck">@mandelduck</a></p><p><strong>How do I get bitcoin?</strong><br>The aim of the game is to swing the monkey as far as you can, however scattered through out the game are coins and bananas, if you get a coin you will be able to grab a bitcoin tip.</p><p><strong>How can I make a bitcoin game?<br></strong>If you are interested in developing bitcoin games I recommend heading over to the <a href="https://discord.com/invite/pY2n8KB">ZEBEDEE</a> discord<strong> </strong>where you can chat with like minded people and also get started with the their lightning SDK. I also recommend <a href="https://btcpayserver.org/"><strong>BTC Pay server</strong></a><strong>.</strong></p><p><strong>Enjoy!</strong><br>One of my initial my aims with SaruTobi was to show how easy it can be as a new user to experience bitcoin and I hope this re-release can pick up where the previous game left off, so if you have any friends or family wanting to play around with bitcoin they can download the app, grab a lightning wallet and in a few mins they should receive there first sum of bitcoin and some digital bananas to boot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=554d026ead70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Bitcoin In Gaming Make Sense?]]></title>
            <link>https://medium.com/zebedee-engineering/does-bitcoin-in-gaming-make-sense-6e22b5fcb2e2?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e22b5fcb2e2</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[zebedee]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[lightning]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Thu, 07 Nov 2019 22:59:58 GMT</pubDate>
            <atom:updated>2019-11-08T12:54:07.643Z</atom:updated>
            <content:encoded><![CDATA[<h4>The history of value transfer in games</h4><blockquote>There is a strong historical precedent to argue that value transfer has always been an integral part of what makes games fun to play. But, whereas games have evolved into the digital age, the medium of value transfer between players has not. This leaves an enormous hole in the modern gaming experience.</blockquote><p>Let us take you back to 1549 when the missionary Francis Xavier arrived in Japan. Xavier is cited as the first westerner to introduce playing cards to the Japanese population. Like today, cards were predominantly used in gambling activities, and this was no different in ancient Japan. Eventually, all card games became outlawed by the Japanese <a href="https://en.wikipedia.org/wiki/Sh%C5%8Dgun">Shōgun</a> in order to curb the rise of gambling addiction. To get around these restrictions a new type of playing card was created —<em>HanaFuda</em> cards. <em>HanaFuda</em> cards, also known as “Flower Cards”, initially appeared to have no obvious rules or value, and seemed to only be used for decorative purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dQIYZVxvI-EiLmOT" /><figcaption>Flower Cards | HanaFuda</figcaption></figure><p>With time, these cards became a dominant medium for illegal gambling activities in ancient Japan and can occasionally still be seen in use today. One of the most successful gaming companies in the world started off as a producer of these cards — Nintendo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/0*rbZzk552lCiEDBq8" /><figcaption>Nintendo Card Co.</figcaption></figure><p>With the introduction of personal consumer electronic devices and computers, games entered the digital sphere. Nintendo quickly moved into this space releasing the enormously successful Family Computer known as the NES in the US.</p><p>Another big change was that traditional games often involved a medium of value transfer between players as an integral part of what made them fun — whether it be HanaFuda, Chess, Poker or simple Dice, these games were often played using cash as wagers between players. <strong>But whilst we had peer to peer physical cash for games in the physical world we now had no way to transfer value digitally in the same manner.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HWuhGsAzI-zVr5ib" /></figure><p>In the transition to digital media, this legacy of playing games to transfer value was still fairly strong and in early games we still saw this concept persist. However, as it was no longer possible to transfer actual value between players this notion was represented by valueless in-game tokens such as Mario coins or Sonic rings.</p><p>Eventually, the merit of collecting these valueless tokens wore off and games for the biggest part obfuscated the mechanics of just collecting coins and focused on different gameplay scenarios such as “leveling” up your characters or completing complex quests.</p><p>Then as the internet evolved, particularly through mobile platforms and digital payments, it became possible to transfer value in games once again. Though, value transfer was still not possible peer-to-peer, between players, mainly due to the centralized nature of early digital payments. <strong>Value transfer was therefore limited to in-app purchases, loot boxes, in game ads etc which arguably had a detrimental effect on gameplay.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*WTQzRAL1F8g24NJz.jpg" /></figure><p>Even before Bitcoin, there were attempts at creating open digital markets that would enable players to transfer value between themselves; one example is Second Life’s Linden dollars. Another example would be players trading Counter Strike skins on illegal markets. However, these attempts were either shutdown, short lived and/or faced regulatory hurdles.</p><p>The other major limitation to these attempts at creating peer to peer currencies or tradeable assets in games is the fact they were all game-specific. They had no value or use outside of the game in which they were acquired, and so a player’s resources and effort spent within a game were generally always trapped in that game.</p><p><strong>With Bitcoin and the Lightning Network we now have a global currency that is both peer-to-peer and interoperable between games — analogous to the usage of gold or silver in early gambling and games.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*NP8BnsiMBa8WnBsC.jpg" /></figure><p>So should we be integrating Bitcoin into all games!? Well maybe not…</p><p>It is important to remember that whilst early games were often used as a way to transfer value between players and to facilitate gambling, this was always an optional feature. Pretty much all gambling and non-gambling games can be and are enjoyed without any monetary transfer at all. That said, if the players wish to, they can enhance the experience by placing some bets/making some wagers between themselves.</p><p>For example, players can battle each other freely in a Street Fighter-style fighting game or a Fortnite-style battle and just enjoy the gameplay for what it is. But now, for the first time, they are also able to enhance their experience by streaming Satoshis between themselves!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uL4u5O815-T9h4qTIVrvTw.png" /><figcaption>Raiki Gameplay | ZEBEDEE</figcaption></figure><p>This is not to say Bitcoin cannot be integrated into games that enable entirely new forms of player interaction and gameplay mechanics — games empowered by Bitcoin.</p><p>We believe the future of value transfer in games powered by Bitcoin is very bright. Expect more updates on our experiments in this space in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e22b5fcb2e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/zebedee-engineering/does-bitcoin-in-gaming-make-sense-6e22b5fcb2e2">Does Bitcoin In Gaming Make Sense?</a> was originally published in <a href="https://medium.com/zebedee-engineering">ZEBEDEE Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a LND along side bitcoind on android]]></title>
            <link>https://medium.com/nayuta-en/running-a-lnd-along-side-bitcoind-on-android-779dcf4e16bb?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/779dcf4e16bb</guid>
            <category><![CDATA[full-node]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Wed, 30 Oct 2019 11:36:59 GMT</pubDate>
            <atom:updated>2021-07-20T00:41:54.093Z</atom:updated>
            <content:encoded><![CDATA[<p>Last Updated: 20 Jul 2021</p><p>20 Jul 2021:<br>The development of Nayuta Wallet is in suspension.</p><p>TLDR: Using a java wrapper around bitcoind and LND with gomobile you can run a fully validating bitcoin node on your android device</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDrmWJdFNzdE%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDrmWJdFNzdE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDrmWJdFNzdE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/41f64f915ae43f68a64511d9d4c7767d/href">https://medium.com/media/41f64f915ae43f68a64511d9d4c7767d/href</a></iframe><h3>Abstract</h3><p>The purpose of this article is to demonstrate how it is possible for a user to run their own Bitcoin and Lightning full node on their consumer Android OS device such as their smart phone or smart TV. This has been realised recently by the Japanese lightning company Nayuta, and the wallet implementing this is available for public beta test now by clicking here <a href="https://nayuta.co/wallet">https://nayuta.co/wallet</a></p><h3>Components</h3><p>The three main components used are stated below however recognition should be awarded to the developers of these components allowing us to “put the pieces together” to create the final application.</p><h3>ABCore</h3><p>The foundational app used in this setup is <a href="https://github.com/greenaddress/abcore">ABCore</a> developed by the Green Address team at Blockstream, ABCore is an Android wrapper for bitcoind allowing bitcoind to be run on Android OS. We did make changes to the Java wrapper around ABCore in order for it to work with LND and the latest Android OS features (such as Job Scheduler), however a lot of the code base is still based on ABCore.</p><h3>LND</h3><p>The lightning implementation I chose to use along side ABCore is LND, the reason being that LND is written in golang and golang has a very useful module called <a href="https://godoc.org/golang.org/x/mobile/cmd/gomobile">gomobile</a> which lets you compile a golang app into an iOS or Android library.</p><h3>gRPC</h3><p>The LND api communicates using <a href="https://grpc.io/">gRPC</a> which is an RPC framework allowing a native Android Java app to communicate with the LND lncli.</p><h3>Putting it all together</h3><p>We created a Java library for bitcoind using Android Studio, this library is based on ABCore and can be found here<br><a href="https://github.com/mandelmonkey/AndroidModules/tree/master/androidcore">https://github.com/mandelmonkey/AndroidModules/tree/master/androidcore</a></p><h3>Creating bitcoind library</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*_XfL5-ITIKhj8IqC6QOKVg.png" /></figure><p>This library is made up of several classes but the most important classes are</p><p><em>MainController</em></p><p>This class checks if bitcoind has been downloaded and if not it downloads the latest build for Android devices from the following repo <a href="https://github.com/greenaddress/bitcoin_ndk/releases/download/">https://github.com/greenaddress/bitcoin_ndk/releases</a><br>note: In the future it is planned to include the bitcoind binary in the app bundle itself rather than downloading it on app launch.</p><p><em>ABCoreService</em></p><p>This class runs the downloaded bitcoind binary using the Android <em>ProcessBuilder</em>. It also has the ability to run the app as a service which allows bitcoind to run in the background even when the parent app is closed.</p><p><em>RPCIntentService</em></p><p>This is an RPC service which allows the app to connect to bitcoind and create RPC calls such as <em>GetBlockchainInfo. </em>Currently this is needed as bitcoind runs in a separate process to the main app. bitcoind is running on local host behind a password, the RPCIntetentService connects to bitcoind over local host using the password specified in bitcoin.conf. For the purposes of our app the bitcoin.conf is generated by the parent app.</p><p><em>SyncJobService</em></p><p>This class allows us to make use of Android Oreo’s JobScheduler. The JobScheduler is a useful feature that allow us to schedule code to run under certain conditions when the OS decides. For example we can add restrictions that bitcoind only runs when charging and connected to wifi, this would have the effect of letting the OS try to sync the blockchain whenever it seems possible assuming the user is connected to wifi and is charging.</p><p>For the purpose of Nayuta app we exported this module as an .aar library.</p><h3>Creating LND library</h3><p>LND can easily be built as an android library using the <em>make android </em>command. This produces an <em>lndmobile.jar </em>file. This file is not enough in its self to run LND we also need to use android gRPC in order to pass RPC commands to LND. We created a couple of libraries to do this.</p><p>This first is a library that allows us to create and parse gRPC requests and responses, found here</p><p><a href="https://github.com/mandelmonkey/android_lngrpc">https://github.com/mandelmonkey/android_lngrpc</a></p><p>The second is a simple wrapper allowing us to send and receive the generated gRPC requests and response to the lndmobile library, found here<br><a href="https://github.com/mandelmonkey/AndroidModules/tree/master/lndmobilewrapper">https://github.com/mandelmonkey/AndroidModules/tree/master/lndmobilewrapper</a></p><p>It should be possible to combine these libraries into one library that both creates/parses and sends/receives gRPC requests, (however there seemed to be issues when doing this initially hence splitting these two features into separate libraries allowed us to continue development).</p><h3>Importing into our app</h3><p>Now we have the following android libraries</p><p>lndmobile.jar</p><p><a href="https://github.com/mandelmonkey/android_lngrpc">android_lngrpc</a>.jar</p><p><a href="https://github.com/mandelmonkey/AndroidModules/tree/master/lndmobilewrapper">lndmobilewrapper</a>.aar</p><p>androidcore.aar</p><p>Our app is developed using a cross platform framework called Appcelerator which is similar to React Native. Appcelerator allows the usage of native code as well as importing native modules.</p><p>We imported our generated libraries into our Appcelerator app, however to allow lnd to use bitcoind as backend we need to setup our configuration files for LND and bitcoind respectively.</p><p>It is fairly simply to do this and all that is required is to make sure both the lnd.conf and the bitcoin.conf have the same RPC uri and credentials as well as setting up ZMQs for bitcoind over local host.</p><p>Example config files can be seen below</p><h4>lnd.conf</h4><blockquote>[Application Options] <br>maxbackoff=2s<br>debuglevel=info<br>nolisten=sync-freelist=0<br>no-macaroons=1 <br>maxpendingchannels=2</blockquote><blockquote>[Bitcoin]<br>bitcoin.active=1<br>bitcoin.defaultchanconfs=1<br>bitcoin.node=bitcoind</blockquote><blockquote>[bitcoind]<br>bitcoind.rpchost=localhost <br>bitcoind.rpcpass=password<br>bitcoind.rpcuser=bitcoinrpc<br>bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332<br>bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333</blockquote><h4>bitcoin.conf</h4><blockquote>listen=1<br>disablewallet=1 <br>prune=550<br>upnp=0<br>blocksonly=1<br>rpcpassword=password<br>rpcuser=bitcoinrpc<br>server=1<br>zmqpubrawblock=tcp://127.0.0.1:28332<br>zmqpubrawtx=tcp://127.0.0.1:28333</blockquote><p>note that in the bitcoin.conf there are a few params which are designed to optimize the performance for mobile.</p><ol><li>prune: this is set to 550 to run the app in pruned node so we don’t store the whole blockchain as it is not needed for LND to function.</li><li>blocksonly: this disables the mempool so the mobile only needs to have the bandwidth to download blocks and not rely transactions.</li><li>disablewallet: we do not need the wallet as LND has its own internal wallet.</li></ol><p>With the configuration files saved in the correct app directory for lndmobile and bitcoind it is now possible to first run bitcoind, let it synchronise and then run LND which should connect to bitcoind over rpc and zmqs and use it as its backend.</p><h3>Conclusion</h3><p>By creating android libraries and wrappers around LND and bitcoind as well as correctly generating the necessary .conf files we can import these libraries into a cross platform or native android app project and run LND with a bitcoind backend. This is implemented in the Nayuta wallet which will be made open source soon so you will be able to look at the implementation in more detail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=779dcf4e16bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nayuta-en/running-a-lnd-along-side-bitcoind-on-android-779dcf4e16bb">Running a LND along side bitcoind on android</a> was originally published in <a href="https://medium.com/nayuta-en">Nayuta Blog (English)</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mandel Duck Update]]></title>
            <link>https://mandelduck.medium.com/mandel-duck-update-5f4b5a16c645?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f4b5a16c645</guid>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Wed, 24 Jul 2019 12:59:13 GMT</pubDate>
            <atom:updated>2019-07-24T12:59:13.594Z</atom:updated>
            <content:encoded><![CDATA[<p>Just wanted to give an update on the various projects i’ve been teasing about on twitter as I have been getting a few DMs asking about them.</p><h4>Lightning Games</h4><p>The three lightning games I developed as part of the bitcoin2019 hackathon attracted some interest from investors I can’t say much at this point in time but hopefully I will be able to get the extra resources need to develop these into professional games which I would love to demo at the lightning conference.</p><h4>Android Full Node Lightning App</h4><p>I recently did a crowdfunding campaign to help fund development of a full node bitcoin and lightning wallet that would be downloadable as an android app for use on Android TVs and other android devices such as smartphones etc. <br>Although I appreciated the people who donated the target was not met, however before the crowdfunding started I stated that I would develop the app regardless using the funds to help where possible. As the target was not met work on it needed to take low priority as had to do other paid work. Soon after I found a sponsor to allow me to work on the Pebble mobile app and develop this into the Android Full Node Lightning app, however it seems that this sponsor is unable to continue hence the Pebble project will exist as something I support and work on in my own time. Luckily I was contacted by another lightning company (lets call them company X) who wanted to develop a lightning mobile wallet and agreed to incorporate the full node functionality into it. Therefor wether it is with Pebble or the wallet I am helping company X develop the full node android app will be realized in the next few months.</p><h4>Mobile BTCPay Tor wallet</h4><p>I recently showed it was possible to connect to LND running on BTCPay over TOR, similar to the full node functionality I plan to incorporate this into pebble and the wallet being develop by company X.</p><p>All work on all wallets will be open source so I look forward to other wallets also implementing these features.</p><h4><strong>SaruTobi and SaruTobi Island</strong></h4><p>I hope to also develop the Sarutobi games further and incorporate more use of lightning over the next few months, this will be when time permits as due to the potential funding and partnership opportunities the 3 lightning games from the hackathon will take priority. I would also love to work on some more Counterparty integration however currently Counterparty is on chain and I feel that for games an off chain solution is needed. It seems later this year/next year there may be some funding to help the Counterparty devs develop an off chain solution using sidechain technology and possibly even state chains a bit later if they become a reality.</p><h4><strong>Takara</strong></h4><p>I no longer own the rights to takara and have not for a while so I am currently not able to develop it further, however I would be interested in developing an off chain geocaching game in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f4b5a16c645" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lightning Quick Draw Game With HOLD Invoices]]></title>
            <link>https://mandelduck.medium.com/lightning-quick-draw-game-with-hold-invoices-8a3f0fd9ec04?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a3f0fd9ec04</guid>
            <category><![CDATA[games]]></category>
            <category><![CDATA[lnd]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[lightning]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Sat, 08 Jun 2019 09:28:26 GMT</pubDate>
            <atom:updated>2019-06-08T14:09:52.747Z</atom:updated>
            <content:encoded><![CDATA[<p>HOLD invoices are a great addition to the LND lightning implementation stack and open up a range of new use cases.<br>In a nutshell HOLD invoices allow a payer to make a payment to an invoice in which the payee can withheld the final state/completion of the payment until they decide to cancel or settle the payment. If they cancel the payment the amount is returned back to the payer, if they settle they complete the payment and receive the funds. It seems the initial use case for HOLD invoice is in a merchant situation. <br>For example using a typical lightning invoice if a user makes a payment for a hat and after the payment has completed the merchant realizes the hat is out of stock, in this scenario the merchant needs to contact the user ask them to create an invoice and then return the funds. With hold invoices the merchant can simply cancel the payment if the item is out of stock or settle the payment if the item is in stock and after the item has shipped.</p><h4>How HOLD invoices work</h4><p>HOLD invoices work by allowing the user to first create a pre image (a random 32byte hexadecimal number) and pass it’s hash when creating an invoice. After the invoice has been created and paid the user must then reveal the pre image in order to settle/sweep the payment.</p><p>If we don’t allow the user to decide the pre image but let a 3rd party that is not the payee nor the payer we can create a simple betting type game, or in this case a Western Style Quick Draw for mobile!</p><h4>Example Quick Draw Game</h4><p>Player 1 “Rattle Snake Alice” and Player 2 “Buffalo Bob” download the “Western Quick Draw” game onto their mobile device, their mobile device also has a lightning wallet.</p><p>The game then links the players via bluetooth and creates the pre image which it keeps secret from the players. The game then hashes the pre image and passes the hash to the players. The players use this hash to create a hold invoice for $1. They then pass their invoices to each other and pay each others invoices.</p><p>At this point each player has paid the $1 and cannot revoke the payment, however neither payer is able to settle the funds as only the game knows the pre image. Effectively the game is escrowing the payments by holding the pre image however it is not holding the actual funds and if the game were to error or go offline the funds could be returned to the players after the invoices expire (Lightning Invoices have an expiry parameter).</p><p>Once the game has determined that both players have paid each other’s invoice it starts the dual. The user who fires first wins and the game only releases the pre image to the winning player allowing them to sweep the funds paid by the loser. It is also considered good sport if the loser cancels their invoice so the winner can receive their withheld paid funds without needing to wait for the loser’s invoice to expire. Because of this a short expiry time is recommended.</p><p>A video of the game being played can be seen below</p><p><a href="https://youtu.be/TeeQgWOom3A">https://youtu.be/TeeQgWOom3A</a></p><h3><strong>Development (warning! boring technical details ahead)</strong></h3><h4><strong>Game</strong></h4><p>The game was created using Unity 3D</p><h4>Wallet</h4><p>As the game is mobile it was required to have a mobile wallet that could interact with it. I used the Pebble Wallet as a base, pebble wallet is an open source mobile wallet built on top of LND. However Pebble wallet did not have <br>HOLD invoices implemented so it was necessary to add it.</p><p>In order to add HOLD invoice I had build LND for mobile using gomobile with the make flag</p><pre>make tags=&quot;invoicesrpc&quot;</pre><p>After LND is built with this tag according to the HOLD invoice <a href="https://github.com/lightningnetwork/lnd/pull/2022">documentation</a> it is possible to create/cancel and settle HODL invoices using the following commands</p><pre>lncli addholdinvoice &lt;hash&gt; --amt &lt;amt&gt;<br>lncli cancelinvoice &lt;hash&gt;<br>lncli settleinvoice &lt;preimage&gt;</pre><p>The status of a HOLD invoice can be determined using either the SubscribeSingleInvoice call which will return events as the status of the invoice changes or can be checked using polling and</p><pre>lncli lookupinvoice &lt;hash&gt;</pre><p>However we cannot use lncli as our LND is running in a mobile wallet therefore it is required to use GRPC (a protobuf api used by LND) to make requests. Unfortunately LND running in mobile does not use just GRPC to communicate with the LND rpc, this is because such a connection would likely be terminated by the mobile OS when the app enters the background, furthermore using GRPC would result in LNDs rpcserver running on the mobile devices localhost which is not desirable. Hence LND running on mobile actually creates native bindings from the protobufs to allow a mobile app to directly communicate with the rpc server using memory buffer sockets. More info on this can be seen <a href="https://youtu.be/IIxCYrRiP78?t=7737">here</a> in a talk by <a href="https://twitter.com/johanth">Johan Torås Halseth</a> of Lightning Labs.</p><p>Moving on I had to create the mobile bindings for the HOLD invoices my self in a special branch of LND I created <a href="https://github.com/mandelmonkey/lnd/tree/hold_experiment/mobile">here</a>, from this I could build a native LNDMobile library which I could import into pebble wallet.</p><p>Finally in pebble wallet I had to write some connectivity logic to allow a the mobile Unity 3D game to communicate with the mobile LND wallet in order to request and create invoices. The specific details of interest can be found on the repo <a href="https://github.com/mandelmonkey/pebblewallet/tree/hackathon">here</a></p><h4>Game</h4><p>The game was developed using UNITY 3D and its repo can be found <a href="https://github.com/mandelmonkey/quickdraw">here</a>, it uses a bluetooth module to let the two devices connect to each other and pass various requests such as their invoices, hashes, when a player shot etc<br>The game also uses android intents to allow it to connect with the wallet which handles the lightning payments and invoice creation.</p><p>It was also required to use some cryptography in order to generate the pre image and its hash for the hold invoice</p><pre>void createInvoice()<br>     {<br>         using (RandomNumberGenerator rng = new RNGCryptoServiceProvider())<br>         {<br>             byte[] preimage = new byte[32];<br>             rng.GetBytes(preimage);<br> <br> <br>             myPreimage = BitConverter.ToString(preimage).Replace(&quot;-&quot;, string.Empty);<br>             // Create a SHA256   <br>             using (SHA256 sha256Hash = SHA256.Create())<br>             {<br>                 // ComputeHash - returns byte array  <br>                 byte[] bytes = sha256Hash.ComputeHash(preimage);<br> <br>                 // Convert byte array to a string   <br>                 StringBuilder builder = new StringBuilder();<br>                 for (int i = 0; i &lt; bytes.Length; i++)<br>                 {<br>                     builder.Append(bytes[i].ToString(&quot;x2&quot;));<br>                 }<br>                 myHash = builder.ToString();<br>                 Debug.Log(&quot;hash is &quot;+ myHash);<br> <br>             shouldCheckIntent = true;<br>             var req = &quot;lightning:addholdinvoice?hash=&quot; + myHash + &quot;&amp;amt=&quot; + myBet + &quot;&amp;expiry=3600&amp;message=&quot; + myBet + &quot;%20sat%20claimed%20by%20the%20Quick%20Draw%21&amp;package=&quot; + Application.identifier + &quot;&amp;allow_pay=&quot; + myBet;<br> <br>             try<br>             {<br>                 AndroidJavaClass unityPlayer = new AndroidJavaClass(&quot;com.unity3d.player.UnityPlayer&quot;);<br>                 AndroidJavaObject currentActivity = unityPlayer.GetStatic&lt;AndroidJavaObject&gt;(&quot;currentActivity&quot;);<br>                 AndroidJavaObject packageManager = currentActivity.Call&lt;AndroidJavaObject&gt;(&quot;getPackageManager&quot;);<br> <br>                 AndroidJavaClass uriClass = new AndroidJavaClass(&quot;android.net.Uri&quot;);<br>                 AndroidJavaObject uriData = uriClass.CallStatic&lt;AndroidJavaObject&gt;(&quot;parse&quot;, req);<br> <br>                 AndroidJavaObject i = packageManager.Call&lt;AndroidJavaObject&gt;(&quot;getLaunchIntentForPackage&quot;, &quot;com.indiesquare.pebble&quot;);<br> <br>                 i.Call&lt;AndroidJavaObject&gt;(&quot;setAction&quot;, &quot;android.intent.action.VIEW&quot;);<br>                 i.Call&lt;AndroidJavaObject&gt;(&quot;setData&quot;, uriData);<br> <br>                 currentActivity.Call(&quot;startActivity&quot;, i);<br> <br> <br> <br>             }<br>             catch (System.Exception e)<br>             {<br>                 Debug.Log(e);<br>             }<br>             }<br>         }<br> <br> <br>     }</pre><h3>Caveats</h3><p>The main caveat is that this game requires a custom lightning mobile wallet, this wallet did not exists so I had to develop it with pebble wallet. Pebble allows a user to connect to their LND node on their server or at their home however in this case it is required that the user has rebuilt LND with the</p><pre>make tags=&quot;invoicesrpc&quot;</pre><p>in order for it to be able to create and monitor HOLD invoices.</p><p>As this a barrier to entry pebble also has the ability to run LND locally via neutrino, however at current time of writing there are some small stability issues with this option such as syncing times channel graph mapping etc that hurt the user experience.</p><h3>Moving Forward</h3><p>My short term focus for the game is to improve stability with pebble and the local running wallet to make it possible for any user to download the game and pebble wallet without having to worry about rebuilding their hosted LND node at home or on their server.</p><p>After this is done I will focus on iOS however it is likely that Apple may not approve of this betting app.</p><p>I would also like to make a VR version but my main focus is mobile.</p><p>Ideally I envision the game to be a social app and therefore to be used in person between bitcoiners at bitcoin meet ups, conferences and events.</p><h4>How To Try The App</h4><p>If you would like to try the app and until pebble with the local wallet feature is released the best way to do it is to have an LND which is built with make tags=’invoicesrpc’ and can be accessed remotely. You can then download the pebble android beta version and the QuickDraw beta apk from this <a href="http://mandelduck.io/hackathondemos">link</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a3f0fd9ec04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lightning Full Node on your TV!?]]></title>
            <link>https://mandelduck.medium.com/lightning-full-node-on-your-tv-977da90de5e6?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/977da90de5e6</guid>
            <category><![CDATA[full-node]]></category>
            <category><![CDATA[lightning]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[lnd]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Mon, 15 Apr 2019 11:03:49 GMT</pubDate>
            <atom:updated>2019-06-06T16:05:18.408Z</atom:updated>
            <content:encoded><![CDATA[<p>TLDR: Full bitcoin and lightning node running on Android os, video example below!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDrmWJdFNzdE%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDrmWJdFNzdE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDrmWJdFNzdE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/41f64f915ae43f68a64511d9d4c7767d/href">https://medium.com/media/41f64f915ae43f68a64511d9d4c7767d/href</a></iframe><h3>Full Article</h3><p>I admit it’s a bit of a click baity title but the purpose of this article is to demonstrate how it is possible for a user to run their own Bitcoin and Lightning Full Node on their consumer Android OS device such as their smart phone or smart TV.</p><p>I am a firm believer that if you aren&#39;t running your own full node then you aren&#39;t really using bitcoin, however I appreciate the obvious barrier to entry of running a full bitcoin node let alone a full lightning node. This has become much easier recently with the introduction of standalone full lightning node solutions such as the <a href="https://store.casa/lightning-node/">CASA NODE</a> and <a href="https://www.nodl.it/nodlbox/">NODL</a> which I think are great products however would it not be even better if a user could install a full bitcoin and lightning node as simply as downloading and installing an app on their existing consumer entertainment device?</p><p>Actually the easiest way to do this is to use Lightning Labs Neutrino SPV solution with the LND lightning implementation, something like Zap, Pebble Wallet or Lightning Lab’s own mobile wallet will soon support this option in the app stores. The SPV solution is pretty straight forward and more light weight than a full node however the SPV approach also has some concerns regarding its effect on the health of the entire bitcoin network. For anybody interested in these concerns they are explained by Nicolas Dorier in his article <a href="https://medium.com/@nicolasdorier/neutrino-is-dangerous-for-my-self-sovereignty-18fac5bcdc25">here</a>.</p><p>Moving on… in the article I will demonstrate how I created an Android app that runs a full bitcoind and LND node side by side, furthermore as this is all runnable on android it follows that given a bit of fancy UI and optimizations a user could simply download a fully sovereign lightning setup onto their Android TV or… hey… technically even their smart fridge? why not? it’s always on.</p><p>Next I will go into the weeds on the technical details, for those not interested please be kind enough to scroll to the bottom and check out the donation links, any little donation helps me justify to my wife why i’m spending the weekends tinkering for fun when I could be doing paid work or taking her out to fancy restaurants.</p><h3>Components</h3><p>The three main components used are stated below, the developers of these components did all the hard work I was just lucky enough to be able to bundle them all together so kudos to them.</p><h3>ABCore</h3><p>The foundational app used in this setup is <a href="https://github.com/greenaddress/abcore">ABCore</a> developed by the Areen Address team, ABCore is an Android wrapper for bitcoind allowing bitcoind to be run on Android OS.</p><h3>LND</h3><p>The lightning implementation I chose to use along side ABCore is LND, the reason being is that LND is written in golang and golang has a very useful module called <a href="https://godoc.org/golang.org/x/mobile/cmd/gomobile">gomobile</a> which lets you compile a golang app into an iOS or Android library.</p><h3>gRPC</h3><p>The LND api communicates using <a href="https://grpc.io/">gRPC</a> which is an RPC framework allowing a native Android Java app to communicate with the LND lncli.</p><h3>Putting it all together</h3><p>With the components in place I decided to download the sample ABCore app as a starting base.<br><a href="https://github.com/greenaddress/abcore">https://github.com/greenaddress/abcore</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiBzqgQV4kKxsr20DImqXg.png" /></figure><p>After compiling it builds a simple app with a switch that will download the bitcoind binary and run it based on a config file you can adjust in the app settings. For this purpose I set this config to testnet and ran it on an android emulator as I don’t have an android device with more than 16GB of storage and 512MB of ram, however if it runs on an emulator it would work on a real device.</p><p>Luckily as ABCore is just a wrapper of bitcoind it means that LND should have no compatibility issues connecting to it, as the RPC server api would be the same as regular bitcoind. The next step was to build LND for android using gomobile and import it as a library into our project.</p><p>This was a lengthy process as the standard LND master branch cannot be easily built using gomobile due to its structure. After a lot of research I was able to create my own custom branch based off of the mobile support branch developed by halseth at Lightning Labs, the resulting branch is <a href="https://github.com/mandelmonkey/lnd/tree/mobile_support">here</a> and should not be used for production purposes. (Apparently Lightning Labs has a plan to release an update to the LND repository to make this process easier in the future!)</p><p>After building for Android gomobile produces an .aar file we can import into our android studio project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFwx12wVaq2L_UnejI3JEQ.png" /></figure><p>Once we have LND imported as a module we need to be able to interface with it, this is where gRPC comes in which can be installed as a gradle dependency. Using the LND rpc.proto file will let gRPC generate an LND api java class we can use to make calls to our LND instance. This process is also somewhat cumbersome to setup at first but more info can be found in the relevant gRPC documentation for <a href="https://grpc.io/docs/tutorials/basic/java.html">Android</a>.</p><p>Finally we just need to set up the config files for LND and ABCore to let LND connect to our bitcoind backend. With ABCore it was pretty simple as it can be done directly inside the sample app provided by green address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*1S82V-8J2njtjyHEiY9rrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*i42pz-m4ejrKTFg_aeablw.png" /></figure><p>The main things to note were to enable zmqs and the server config and make sure the rpc host is set to run on localhost, as this may not be done by default with ABCore. Setting the lnd.conf was a bit more involved as there was no function to do so with the lndmobile.aar we produced. It turns out you need to save a pre-made configuration file into the android app directory for lnd to read it. This was done by including an lnd.conf file in the apps bundle then copying it to the lnd data directory on app load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7j2xBn9VaHztWqk_izKEQ.png" /></figure><p>Finally I added some extra UI and code to interact with LND allowing us to start it, open channels, add peers etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*sNnrfEoZSB3zJbRyyYsS4Q.png" /></figure><h3>Time to run!</h3><p>Crash!</p><p>So it turns out LND will crash if opened too soon after starting bitcoind, this was resolved by simply waiting a while to start LND, seems bitcoind needs to fully open its db and wallet etc. I waited for ABCore to fully sync to testnet and then started LND again and hey bingo! LND was waiting for the user to create or unlock their wallet. Using gRPC I was able to create an new wallet and generate an address which I used to deposit some testnet bitcoins. After the coins were confirmed LNDs great auto pilot feature set up some channels for me and before I knew it I was able to buy an article on the <a href="https://testnet.yalls.org/about/">Y‘all’s</a> testnet site as shown in the video above!.</p><p>The source code for the project can be found <a href="https://github.com/mandelmonkey/lndabcore">here</a>, it is messy and not recommended for production use.</p><h3>Next Steps</h3><p>This was really just a weekend challenge inspired by a twitter thread to see if it were possible, turns out it is. Once I get more time I plan to polish up the source code, make a simple UI and try to compile for android TV if I can get my hands on one. I will also incorporate this into an open source mobile android app people can download.</p><h4>Implications</h4><p>I think that running a full node need not be complex at all and the fallacy that only tech geeks can run one needs to be broken. We all have computers and smart phones that run apps and programs just as (if not more) complex than a bitcoin full node so there is no reason why running a full node can’t be made simpler in the future. Hopefully this article demonstrates that in the not to distant future it will be possible for non technical people to easily and cheaply run a fully validating bitcoin and lightning node, helping the decentralisation of the network, but more importantly allowing people to reduce their need to trust whilst increasing their ability to verify!</p><h3>Update</h3><p>Managed to also run on an Android smart phone but it did take a day to sync even on testnet.</p><p><a href="https://youtu.be/95aQLzJqLtQ">https://youtu.be/95aQLzJqLtQ</a></p><h3>Donations</h3><p>If you want to help support me develop this project and others further or just want to buy me a beer please consider donating some sats below!</p><p><a href="https://btcpay.mandelduck.io/apps/3ePbYbCQnYSLQgYVrxNGHzr3cFf5/pos">https://m</a>andelduck.io/store</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=977da90de5e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mandel Duck Update]]></title>
            <link>https://mandelduck.medium.com/mandel-duck-update-c2852b95a6bd?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2852b95a6bd</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[lnd]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[lightning]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Thu, 16 Aug 2018 09:08:07 GMT</pubDate>
            <atom:updated>2018-08-16T09:08:07.712Z</atom:updated>
            <content:encoded><![CDATA[<h4>SarutTobi Chapter III has been released!</h4><p>The main update contains a continuation of the story and opens up the castle, in which SaruTobi must navigate in order to steal a magical gem stone. There is also a small amount of bitcoin hidden in the game which has not yet been swept!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3iV8omeLlXJClhKVHF_7w.png" /></figure><h4>Lightning Store added to SaruTobi Island</h4><p>Visit the lab and talk to “Beefstew” to buy coins and special Bitcoin hats via the lightning network. We recommend using the <a href="https://play.google.com/store/apps/details?id=fr.acinq.eclair.wallet.mainnet2&amp;hl=en">Eclair wallet</a> on android or if you don’t have a working mobile lightning wallet you can purchase redeemable codes from the <a href="https://mandelduck.com/sarutobiisland/lightningstore">desktop store</a></p><p><a href="https://www.youtube.com/watch?v=Bu1NDlK4X7g">https://www.youtube.com/watch?v=Bu1NDlK4X7g</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*EZnT4wXANXd6n5enXitbzw.png" /></figure><h4>Chapter IV</h4><p>The next chapter is currently in development and will feature two new monsters spawn-able by the MACHANCD and KOSMOCD.<br>I will also be working on a special <a href="https://www.ageofchains.com/">Age of Chains</a> collaboration and area, stay tuned!</p><h3>SaruTobi (Original game)</h3><p>Work on the new revamp of the original game is continuing, I am currently working with a Tokyo based project called Hash Hub to create a mobile version that will allow tipping via the lightning network expected to demo in October. However for those willing to try out lightning micro payments there is a lightning demo version up on the web that can be found <a href="https://mandelduck.io/sarutobiweb">here</a>.<br>(This is just a demo version and although it has tipping it is not yet optimal)</p><h3>Tokyo Game Show</h3><p>I am happy to announce that this September SaruTobi will be showcasing along side Spells of Genesis and IndieSquare at Tokyo Game Show in Japan where we will demo the power of blockchain in gaming, the use of tokens as game items and micro payments in gaming with the lightning network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2852b95a6bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SaruTobi retirement and new Sarutobi Lightning game]]></title>
            <link>https://mandelduck.medium.com/sarutobi-retirement-and-new-sarutobi-lightning-game-5a762b3afbf2?source=rss-b4ceaa3ea5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a762b3afbf2</guid>
            <category><![CDATA[sarutobi]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[lightning-network]]></category>
            <dc:creator><![CDATA[Mandel duck]]></dc:creator>
            <pubDate>Sat, 07 Jul 2018 12:05:28 GMT</pubDate>
            <atom:updated>2018-07-07T12:27:49.098Z</atom:updated>
            <content:encoded><![CDATA[<h4>Original SaruTobi Game</h4><p>First of all a massive thank you to the sarutobi players who have supported the game these past few years, SaruTobi was first launched back in late 2013 and initially was a way for me to play around with bitcoin in gaming. Initially my first intention was to allow the user to buy game items with bitcoin however due to Apple’s restriction on allowed payment methods it switched to sending the player small bitcoin tips.<br>Initially the tips were supplied by donation and paid out around $0.1 -$0.10 now and then to players. However donations eventually slowed down and the liquidity of tips switched to using a bitcoin miner that would payout the days mining rewards as tips to the users. However as the mining industry become competitive our miner was unable to supply bitcoin and SaruTobi switched to an ad revenue model. In this model as the users played the game ad revenue was earned and the game kept track of how much a user played based on the number of coins they received. At the end of each month the generated ad revenue would be distributed between players based on their coin submissions. However the ad revenue model is no longer feasible due to restrictions from the ad revenue companies, basically the ad revenue system is no longer supplying the revenue due to the nature of how the ads are used in the game (using ads to generate revenue cause users to click or view ads they were not interested in an understandably was not interpreted as real ad traffic causing blacklisting of the game). In fact ad revenue has not being received by us since January and we have been paying the earnings out of our own pocket. Furthermore I am happily working full time with a couple of other projects in the space (Everdreamsoft, Indiesquare, Book of Orbs and Counterparty, Takara, SaruTobi Island) and have limited time to maintain the current Sarutobi and work on the new lightning version. One last factor is currently for low payments of $0.01 -$0.10 the game sent them via coinbase which I don’t feel 100% comfortable promoting to new users as a wallet.</p><p>For these reasons SaruTobi will currently cease players being able to earn bitcoin and you will not be able to submit coins in the apps, current earnings for the current month will be sent out.</p><h4>SaruTobi Lightning</h4><p>However we are currently working on a new model using the lightning network, the basis of the game is that users will be able to purchase power ups and items via bitcoin over the lightning network, the profits from these purchases will be used as tips also sent over the lightning network.</p><p>There is no release date for mobile version but a web based prototype is almost ready however we will be working on a mobile alternative. The lightning network is still new and receiving bitcoin over it is not yet usable for most users so it will be a while before fully functional tips/rewards are active, however I have no doubt that the receiving bitcoin function will only improve in the coming months and years and hope to help develop this model with the new sarutobi lightning games and SaruTobi Island. Along with Lightning network the new refresh of the game will contain more utility for SaruTobi and other Counterparty tokens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a762b3afbf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>