<?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 Victor Bolum on Medium]]></title>
        <description><![CDATA[Stories by Victor Bolum on Medium]]></description>
        <link>https://medium.com/@vic_tha_god?source=rss-78e5bac385c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JaGC9hnkFYG_YnQwXYpQNA.jpeg</url>
            <title>Stories by Victor Bolum on Medium</title>
            <link>https://medium.com/@vic_tha_god?source=rss-78e5bac385c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:49:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vic_tha_god/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[Sending a bitcoin transaction]]></title>
            <link>https://medium.com/@vic_tha_god/sending-a-bitcoin-transaction-cf76aadf0a96?source=rss-78e5bac385c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf76aadf0a96</guid>
            <category><![CDATA[bitcoin-wallet]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Victor Bolum]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 11:03:16 GMT</pubDate>
            <atom:updated>2020-06-29T11:07:01.936Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we are going to look at how to send a bitcoin transaction using NBitcoin and blockcypher api.</p><blockquote>Blockcypher api is a simple, mostly RESTful JSON API for interacting with blockchains, accessed over HTTP or HTTPS from the <a href="https://api.blockcypher.com/v1/btc/main">api.blockcypher.com</a> domain.</blockquote><blockquote>Block Cypher endpoints don’t need a token for any read-only <strong>GET</strong> calls. Please <a href="http://accounts.blockcypher.com/">register for a user token</a> if you want to use <strong>POST</strong> and <strong>DELETE</strong> calls</blockquote><p>This tutorial isn’t going to focus on the basics (create private key, address etc). we already talked about that here <a href="https://medium.com/@vic_tha_god/bitcoin-with-c-3f84903f6d79">https://medium.com/@vic_tha_god/bitcoin-with-c-3f84903f6d79</a></p><p>Signing and building a transaction in Bitcoin can be complicated, A lot of 3rd party wallets already abstract this implementations for you. The goal here is to simplify the whole process.</p><p>Transaction Builder needs the following information :</p><ol><li>What Coins it can spend</li><li>What Private Keys he knows</li><li>Where does it send the money</li><li>Where does it send the change</li><li>Fees for the transaction</li></ol><p><strong>Make Payment</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bde308864a93cf4ed3e7142860f37791/href">https://medium.com/media/bde308864a93cf4ed3e7142860f37791/href</a></iframe><p><strong>Get Unspent Coins</strong></p><p><strong>Unspent coins</strong> Outputs or UTXOs serve as globally-accessible evidence that you have bitcoin in your digital wallet. A bitcoin transaction has both an input and an output. The input is the address where the bitcoin is sent from; the output is the address where it is sent to.</p><blockquote>Important Note : If you are interested in building a wallet, you should use <a href="https://github.com/dgarage/NBXplorer/">NBxplorer</a> a very simple self hostable API, that tracks only what is needed for your wallet.</blockquote><blockquote>the codes below is purely for demo purpose</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f02918c7ae645bd9d197f137564d77b/href">https://medium.com/media/4f02918c7ae645bd9d197f137564d77b/href</a></iframe><p><strong>Broadcast Transaction</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e457ee5341434867f2e9679dc0d0a2ac/href">https://medium.com/media/e457ee5341434867f2e9679dc0d0a2ac/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf76aadf0a96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin with C#]]></title>
            <link>https://medium.com/@vic_tha_god/bitcoin-with-c-3f84903f6d79?source=rss-78e5bac385c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f84903f6d79</guid>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[nbition-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Victor Bolum]]></dc:creator>
            <pubDate>Fri, 26 Jun 2020 13:54:03 GMT</pubDate>
            <atom:updated>2020-06-29T11:10:21.378Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we are going to introduce Bitcoin using C#. We will be using C#’s bitcoin library, called NBitcoin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kk8ipS-QOJoa7XbGcJjiIw.jpeg" /></figure><p><strong>Install Nbitcoin</strong></p><pre>dotnet add package NBitcoin</pre><p><strong>Generate a private key</strong></p><p>A <strong>private key</strong> in the context of Bitcoin is a secret number that allows bitcoins to be spent. Every Bitcoin wallet contains one or more <strong>private keys.</strong></p><p>This is how you generate a private key with NBitcoin:</p><pre>var privateKey = new Key();</pre><pre>var bitcoinPrivateKey = privateKey.GetWif(Network.Main).ToString();</pre><pre>Console.WriteLine(bitcoinPrivateKey);</pre><pre>//L3X8YdfNAgPGhcQs1tbiAiyqG3Z5BJ4nYzfJPmxA7BJRGMi3AMPp</pre><p><strong>Generate a public key</strong></p><pre>var privateKey = new Key();</pre><pre>var bitcoinPrivateKey = privateKey.GetWif(Network.Main);</pre><pre>var bitcoinPublicKey = bitcoinPrivateKey.PubKey.ToString();</pre><pre>Console.WriteLine(bitcoinPublicKey);</pre><pre>//027f34ed880f6ee198b5b583472d7dcd640326a6f3d8530c6105cb3bf20b1b629e</pre><p><strong>Create a Bitcoin address</strong></p><p>You know that your <strong>Bitcoin Address</strong> is what you share to the world to get paid.</p><pre>var privateKey = new Key();</pre><pre>var bitcoinPrivateKey = privateKey.GetWif(Network.Main);</pre><pre>var bitcoinPublicKey = bitcoinPrivateKey.PubKey;</pre><pre>var address = bitcoinPublicKey.GetAddress(ScriptPubKeyType.Segwit, Network.Main);</pre><pre>Console.WriteLine(address);</pre><pre><br>//bc1q7sq2samnm4nkpsylusuqw95t3ma8z5ayn7s5zk</pre><p><strong>Generate Address from a known private key</strong></p><pre>var key = &quot;L1TmYw2edTAyF9CtSF64k2Qc3AkKa8t9xn1vMa92xCe9VCzTbYzV&quot;;</pre><pre>var bitcoinSecret = new BitcoinSecret(key);</pre><pre>var address = bitcoinSecret.PubKey.GetAddress(ScriptPubKeyType.Segwit,Network.Main);</pre><pre>Console.WriteLine(address);</pre><pre>//bc1qlq037jz8u9mlkwh3ccmky92yxflrqrmaz5dtyr</pre><p><strong>Generate Mnemonic</strong></p><p>A <strong>mnemonic</strong> recovery phrase or <strong>bitcoin</strong> seed is a list of words which store all the information needed to recover a <strong>bitcoin</strong> wallet</p><pre>var mnemo = new Mnemonic(Wordlist.English, WordCount.Twelve);</pre><pre>//key victory fashion rough torch ice lesson main grape actual horn dinosaur</pre><p><strong>Generate Address from Mnemonic</strong></p><pre>var mnemo = new Mnemonic(&quot;dry brown drive parade drastic shine embrace hard report loan fold iron&quot;, Wordlist.English);</pre><pre>var hdroot = mnemo.DeriveExtKey();</pre><pre>var pKey = hdroot.Derive(new KeyPath(&quot;m/84&#39;/0&#39;/0&#39;/0/0&quot;));</pre><pre>var address = pKey.PrivateKey.PubKey.GetAddress(ScriptPubKeyType.Segwit, Network.Main));</pre><pre>Console.WriteLine(address);</pre><pre>//bc1qv7z69wxrew84vv43xrnfrckkzj4wzalf99e2cs</pre><p><strong>Generate Multiple Addresses from Mnemonic</strong></p><p>Derivation path follows this convention:</p><pre>m / purpose&#39; / coin_type&#39; / account&#39; / change / address_index</pre><p>So you can increase address_index from 0 to get new addresses from same mnemonic.</p><p>For more details: <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki">https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki</a></p><pre>var mnemo = new Mnemonic(&quot;orange soup note oil token top slab elder mercy mad wool congress&quot;, Wordlist.English); </pre><pre>var hdroot = mnemo.DeriveExtKey(); </pre><pre>var pKey = hdroot.Derive(new KeyPath(&quot;m/84&#39;/0&#39;/0&#39;/0/0&quot;)); </pre><pre>var pKey2 = hdroot.Derive(new KeyPath(&quot;m/84&#39;/0&#39;/0&#39;/0/1&quot;)); </pre><pre>Console.WriteLine(pKey.PrivateKey.PubKey.GetAddress(ScriptPubKeyType.Segwit, Network.Main)); </pre><pre>Console.WriteLine(pKey2.PrivateKey.PubKey.GetAddress(ScriptPubKeyType.Segwit, Network.Main));</pre><pre>//bc1q3sfs9z8zl5c4jw5hxujv9p5gf2hseha7vkfeav</pre><pre>//bc1qk3myyedlqyvjg69cfmatypaep9hqa6rzcx9dcu</pre><p><strong>Conclusion</strong></p><p>In this tutorial, we introduced bitcoin with c#. We saw how to generate a private key, public key, bitcoin address, mnemonic and also generate addresses from a mnemonic recovery phrase.</p><p>we talked about <strong>sending transaction</strong> in this post : <a href="https://medium.com/@vic_tha_god/sending-a-bitcoin-transaction-cf76aadf0a96">https://medium.com/@vic_tha_god/sending-a-bitcoin-transaction-cf76aadf0a96</a></p><p><strong>Source : </strong><a href="https://programmingblockchain.gitbook.io/programmingblockchain/">https://programmingblockchain.gitbook.io/programmingblockchain/</a></p><p>Buy me coffee: bc1qr0mfxvc94j5732r450z3uw9jfujmm9syn2uy3q</p><h3>Connect:</h3><p><a href="https://www.linkedin.com/in/veektorh/"><em>Linkedin</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f84903f6d79" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>