<?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 Nicolas Maldonado on Medium]]></title>
        <description><![CDATA[Stories by Nicolas Maldonado on Medium]]></description>
        <link>https://medium.com/@nixsm?source=rss-36d15b08f0f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E0yhcky437AufmkJffbP5w.jpeg</url>
            <title>Stories by Nicolas Maldonado on Medium</title>
            <link>https://medium.com/@nixsm?source=rss-36d15b08f0f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:46:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nixsm/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[Bitcoin as a world reserve asset]]></title>
            <link>https://medium.com/@nixsm/bitcoin-as-a-world-reserve-asset-e084cb0e0389?source=rss-36d15b08f0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e084cb0e0389</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[psychology]]></category>
            <dc:creator><![CDATA[Nicolas Maldonado]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 23:03:15 GMT</pubDate>
            <atom:updated>2022-03-07T12:42:33.925Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What are the odds of Bitcoin reaching world reserve asset status?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJVARA5tX2FcQsCXltBUiw.jpeg" /></figure><p>Are those odd greater than 2% ? If you think so then a ~ $40,000 price tag per BTC should be considered a real bargain.</p><p>Let me explain, if Bitcoin where to become a world reserve asset then we can assume a conservative 5% allocation of all world assets.</p><p>Currently this number ascends to 900 trillion US dollars. This includes all bonds, real state, gold, stocks, cash, etc.</p><p>If Bitcoin where to capture only 5% of this pie, then this will amount to 45 trillion dollars. This number divided by 21 million (total possible supply) gives us a number of 2 million dollars per coin.</p><p>Of Course the value of all world assets is always rising due to inflation. So whatever that number ends up being in the future, if Bitcoin reaches the 5% mark, we can assume the buying power of a single Bitcoin will be equivalent of what 2 million dollars can buy today.</p><p>For simplicity sake let’s say there are only two possible outcomes for this scenario. Bitcoin reaches world reserve asset status, or not and it goes to $0 for whatever unforeseeable reason.</p><p>Now let’s say chances are 10% of becoming world reserve asset and 90% it goes to $0 . Assuming this are the real chances a fair price of BTC should be 200k (10% of estimated total possible valuation).</p><p>So how much is the market currently pricing this possibility? At $40,000 this is the market saying there is only a 2% chance of this scenario becoming a reality.</p><p>Of course nobody has a crystal ball and can confidently say there is a 100% chance of this prediction becoming true. But given all the fundamentals backing up the use case of Bitcoin I would bet that the odds are actually higher than 2%.</p><p>Most of those 900 trillion are bonds, about 400 trillion. This is debt emitted by nation states or private business. Most of this bonds are yielding negative real interest rates because of a high inflation environment that most likely wont change in the short term.</p><p>Given this circumstances, big hedge funds that back most of this bonds are starting to come to term with the idea that even a small Bitcoin allocation makes sense.</p><p>It’s simply a very asymmetrical bet, you could in theory lose the principal allocated to a BTC position, but still it has a better chance that an assured loss of capital of real negative yielding bond.</p><p>Given this circumstances <em>not </em>allocating even a small percentage to Bitcoin exposes any hedge fund to be outpaced in their earnings by other ones that do.</p><p>At this point we start entering in the realm of game theory. Allocating to Bitcoin becomes a new <a href="https://en.wikipedia.org/wiki/Focal_point_(game_theory)">Schelling point</a> in the game of global capital allocation. There is simply nowhere else to go where you can find such asymmetrical possible outcomes.</p><p>This is not by any means financial advice and I believe a true sovereign individual should conduct his own research and act accordingly. I hope this post sparked your curiosity about this topic and would love to hear what you think about this in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e084cb0e0389" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple SMTP Go Implementation]]></title>
            <link>https://medium.com/@nixsm/simple-smtp-go-implementation-342c73beb77f?source=rss-36d15b08f0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/342c73beb77f</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[smtp]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Nicolas Maldonado]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 20:01:12 GMT</pubDate>
            <atom:updated>2022-02-28T20:01:12.372Z</atom:updated>
            <content:encoded><![CDATA[<p>My objective for this post is to illustrate a simple implementation of the <strong>net/smtp</strong> Go package, and maybe fill any information gaps for someone trying to send and email using Go.</p><p>For this purpose I created the BlazeMailer repository, in honor of Golang’s blazing fast speed. You can follow along with the code in the following link:</p><pre><a href="https://github.com/nixmaldonado/BlazeMailer">https://github.com/nixmaldonado/BlazeMailer</a></pre><p>Suggestions and comments are always welcomed!</p><h4>What is SMTP?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8ZK_DvYJ5QGasXdiGkhPA.jpeg" /></figure><p>SMPT stands for <a href="https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol">Simple Mail Transfer Protocol</a> and simply put is the protocol used to send emails between users.</p><p>Go language offers a package <strong>(“net/smpt”)</strong> to perform SMTP requests which enables sending emails.</p><h4>BlazeMailer walkthrough</h4><p>The starting point of the program can be found in <strong>cmd/main.go</strong>. In the main function two actions are performed:</p><pre>func main() {<br>   config.InitConfig()<br>   server.HandleRequests()<br>}</pre><p><strong>Config </strong>package has all the env vars needed to run the program, and the<strong> InitConfig()</strong> function is in charge of reading and assigning them for the program to use.</p><p>The env vars are needed are the following:</p><pre>SMTPPassword string `envconfig:&quot;SMTP_PASSWORD&quot;`<br>SMTPHost     string `envconfig:&quot;SMPT_HOST&quot;`<br>SMTPPort     string `envconfig:&quot;SMTP_PORT&quot;`</pre><p>Having this values in env vars is a good practice to avoid uploading private information, and to allow different configurations as needed.</p><p>The second function <strong>HandleRequests()</strong> starts listening for requests on port <strong>3000</strong>.</p><p>BlazeMailer provides the following endpoint to send emails:</p><pre>http://localhost:3000/email/send</pre><p>It expects a json body with the following format:</p><pre>{<br>    &quot;from&quot;: &quot;sender@mail.com&quot;,<br>    &quot;to&quot;: &quot;recipient@mail.com&quot;,<br>    &quot;subject&quot;:&quot;This is Blaze Mailer&quot;,<br>    &quot;body&quot;: &quot;Hello World!&quot;<br>}</pre><p>Sending invalid data type will result in a <strong>400 Bad Request</strong>.</p><p>Once a valid payload is received the first step is to create an Auth variable.</p><blockquote>PlainAuth returns an Auth that implements the PLAIN authentication mechanism as defined in RFC 4616. The returned Auth uses the given<br>username and password to authenticate to host and act as identity.<br>Usually identity should be the empty string, to act as username.</blockquote><pre>auth := smtp.PlainAuth(&quot;&quot;, p.From, password, smtpHost)</pre><p>Here <strong>p </strong>is the parsed payload form the request body.</p><p>Password and SMPT Host are pulled from env vars that should be configured before running the program.</p><p>Next we need to format the message according to the SMPT standards:</p><pre>message := fmt.Sprintf(&quot;To: %v\r\nSubject: %v\r\n\r\n%v\r\n&quot;, p.To, p.Subject, p.Body)</pre><p>Again, <strong>p </strong>is the parsed payload from the request body and we use it as parameters for the parsing of the message.</p><p>Finally we are ready to actually send the email:</p><pre>smtp.SendMail(smtpHost+&quot;:&quot;+smtpPort, auth, p.From, []string{p.To}, []byte(message))</pre><p><strong>smtp.SendMail(…) </strong>is the function that actually send the email.</p><p>The first parameter is the address composed of the smtp host and port.</p><p>The second parameter is the auth object we created previously.</p><p>The third parameter is the email address of the sender.</p><p>Four parameters are the recipients. The function requires recipients to be an array of strings. This is because an email can have multiple recipients. This implementation will only have a single recipient for simplification purposes.</p><p>Finally the message is passed along as an array of bytes.</p><p>In case there is an error with the request it will be returned as the response body of the request. Otherwise <strong>200 OK</strong> success is returned.</p><h4>Final thoughts</h4><p>If this post peaked your interest I invite you to try it out and expand this simple implementation as needed.</p><p>Please note this simple implementation is meant only to serve as a POC demonstration and many improvements can be made on top of it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=342c73beb77f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retrofit Easy First Steps for Android]]></title>
            <link>https://medium.com/@nixsm/retrofit-easy-first-steps-for-android-bab92f1b8ac0?source=rss-36d15b08f0f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bab92f1b8ac0</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[retrofit]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Nicolas Maldonado]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 18:02:21 GMT</pubDate>
            <atom:updated>2018-09-28T18:16:45.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbUxibibzGGWzkWle3eMxA.jpeg" /></figure><ol><li><strong>Integrating Retrofit to your Android App</strong></li><li><strong>GET Requests</strong></li><li><strong>POST Requests</strong></li><li><strong>PUT Requests</strong></li><li><strong>DELETE Requests</strong></li></ol><p>Retrofit is a REST client library for Java. I would like to elaborate a little on the information provided by its <a href="http://square.github.io/retrofit/">documentation</a> to help you get started.</p><h4><strong>Integrating Retrofit to your Android App</strong></h4><p>Add this lines to your app/build.gradlefile:</p><pre>dependencies{<br>    compile &#39;com.squareup.retrofit2:retrofit:2.2.0&#39;<br>    compile &#39;com.squareup.retrofit2:converter-gson:2.2.0&#39;<br>}</pre><p>We are also adding converter-gson to parse a Json response into a Java object. After adding the dependencies remember to sync your project.</p><p>Also we are going to need permission in your app manifest to perform network requests:</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;</pre><h4><strong>GET Requests</strong></h4><p>For this example we are going to use GitHub’s API to display the repos of a given user. First let’s create a very basic Class to describe what a GitHub repo is:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2be5c9f3db564d970b6a0e4a153002eb/href">https://medium.com/media/2be5c9f3db564d970b6a0e4a153002eb/href</a></iframe><p>Then we create the following interface describing the API endpoint:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a5b1572aeb73e367e66a9fedeb0f17e/href">https://medium.com/media/6a5b1572aeb73e367e66a9fedeb0f17e/href</a></iframe><p>The <strong><em>@GET</em> </strong>annotation tells Retrofit which HTTP action to perform followed by the API´s path. Notice that the path contains a “/{user}/” that is replaced by the<em> user </em>String method parameter. In order to do this we need to use a <strong><em>@Path(“user”) </em></strong>annotation in the input.</p><p>This method returns a<strong> List</strong> of GitHub repos which are wrapped in a Retrofit Class named <strong>Call </strong>. This is needed to make the request asynchronous.</p><p>To create a Retrofit client insert this code in your onCreate method of your MainActivity:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71102e84e6684ba66b66bb91340e7c4e/href">https://medium.com/media/71102e84e6684ba66b66bb91340e7c4e/href</a></iframe><p>Here we are creating a Retrofit client specifying all the configurations needed, including: base URL of the API, a converter to parse a Json response, and the <strong>GitHubClient</strong> interface we created previously.</p><p>Please notice that you can use different converters depending on the type of data you’re receiving on your response. <a href="http://square.github.io/retrofit/#restadapter-configuration">Check here for a list of accepted converters.</a></p><p>Then we use our <strong>gitHubClient </strong>object to execute the method we created in the interface passing in the username we want to query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31130e1b084045d2418e480562a0840f/href">https://medium.com/media/31130e1b084045d2418e480562a0840f/href</a></iframe><p>We get a <strong>call </strong>object and use the<em> </em><strong><em>.enqueue() </em></strong>method to perform the request in a separate thread so we don’t block the main UI.</p><p>We pass in a new Callback and override two methods: First the<strong><em> .onResponse() </em></strong>method. This one gets called when the request receives an HTTP response (which can be a 404). To check for a successful response call use the <strong><em>Response</em></strong><em>.</em><strong><em>isSuccessful() </em></strong>method.</p><p>Here we get the response body as a List and create an adapter to populate a ListView with the repos names.</p><p>The second method to override is <strong><em>.onFailure() </em></strong>which gets called when a network exception occurred talking to the server or when an unexpected exception occurred creating the request or processing the response.</p><h4>POST Requests</h4><p>If instead what we want to do is make a POST request we need to add the following method to our interface:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f460e53c9563214b12d477fc7337855/href">https://medium.com/media/7f460e53c9563214b12d477fc7337855/href</a></iframe><p>In this case we are using the @POST annotation with the path endpoint and a @Body annotation in the method parameter. This lets Retrofit know that the Java object passed in must be serialized to a Json and passed in as the body of the request.</p><p>Let’s suppose our User object looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/841196b364a5ad0ce93ab2f4bc68a490/href">https://medium.com/media/841196b364a5ad0ce93ab2f4bc68a490/href</a></iframe><p>Then we call our interface method like this:</p><pre>foo.createUser(new User(&quot;John&quot;));</pre><p>This will yield the following json body for our POST request:</p><pre>{&quot;name&quot;:&quot;Jhon&quot;}</pre><p>If instead you want to pass the parameters in URL itself we can use the @Query annotation like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec9edb62a13acac2fac3b17ca21f16c8/href">https://medium.com/media/ec9edb62a13acac2fac3b17ca21f16c8/href</a></iframe><p>Calling foo.createUser(1); yields /users/new?userId=1.</p><h4>PUT Requests</h4><p>PUT Requests are very similar. Let’s suppose once again we have an API that has an endpoint that let’s us update a User like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acf86b70002eba4a0f77d85b8bca4b05/href">https://medium.com/media/acf86b70002eba4a0f77d85b8bca4b05/href</a></iframe><p>Notice that this time we use a @PUT annotation to signal Retrofit we want this HTTP action performed. And since we are updating an specific user, we need to send the user id in the path of our request. This is what the @Path annotation is for. The second parameter is a new user to replace the previous one. In this case we are sending it as a Json in the body of the request.</p><h4>DELETE Requests</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90dc537fee37ba14329965ccceacb9eb/href">https://medium.com/media/90dc537fee37ba14329965ccceacb9eb/href</a></iframe><p>This time we use the@DELETE annotation. And in our method parameters we use @PATH to replace the received int in our path. This way we delete an specific user. Pretty simple right?</p><p>Of course there is plenty more to know about this amazing library . But for now, congrats! These are the basics to perform the most common requests using Retrofit. I’m confident that with this knowledge at hand you can continue learning Retrofit more easily. Good luck in your future endeavours!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bab92f1b8ac0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>