Mining Cryptocurrencies

Cryptocurrencies like Bitcoin, well almost exclusively Bitcoin, have been getting some play time in the popular media. Hopefully you understand what they’re talking about, if not check back to my earlier post “A Change in Direction”. Now you might be asking yourself, “How do I get some?” One option is to “Mine” your Cryptocurrency

Mining Cryptocurrencies is essentially using electricity to generate Cryptocurrency. Not all Cryptocurrencies can be mined. For those that can, the process involves looking for a new block in the currency’s blockchain. The miner who finds the block is rewarded with some units of the currency.

The process of looking for a block involves math, complicated and difficult math. The sort of math that would take you or me 30-45 minutes to do by hand with a calculator. Additionally, the more miners doing the same math for a currency increases the “Difficulty” of the math. New or less popular currencies are easier to mine until they become more popular. The more miners or powerful mining hardware working away at the currency, the more the completion rate of the calculation must be slowed down to keep the reward rate stable. The “Difficulty” of the calculations is proportional to the “Hash Rate” of the currency’s network and must adjust to speed up or slow down the reward frequency.

Mining can be done on a computer’s CPUs, though the video card(s’) GPU(s), or with application-specific integrated circuit (ASIC) hardware.

CPU Mining

CPU (Central Processing Unit) mining is the easiest to write software and therefore usually the first option made available when a new currency is made available. It’s also extremely poor performing. By poor performing I mean the Hash Rate (Number of calculations performed in a second) is not high enough usually to pay for the amount of electricity used to run the CPUs. What? Why is that? Remember, “The process of looking for a block involves math, complicated and difficult math.” A computer’s CPU isn’t built for just doing math calculations. A CPU also responsible for sending commands to all the hardware in a system (network card, sound card, USB devices, etc.)

GPU Mining

GPU (Graphical Processing Unit) mining is a little harder to write software for because there are so many variations of Video cards. New CPUs are released every few years and the command structure doesn’t really change, just the speed at which those commands are executed. Additionally, there are only two CPU manufacturers (AMD and Intel). New Video Card Hardware is released every year, sometimes twice a year, and while there are two main video card platforms (AMD, and NVIDIA) the platforms are manufactured by 20+ different providers. GPU mining software must be compatible with several different versions of each platform’s hardware and updated whenever a new version is released. The payoff is a higher Hash Rate. Why are GPUs better for this? First, a GPU is engineered to do a lot more complex math. All those complicated lifelike video games you love, require a lot of math to display and manipulate the visual environment.

ASIC Mining

Application-specific integrated circuit (ASIC) are platforms where the Processing Unit is designed to perform only one action. In the specific case of Cryptocurrency mining, and ASIC miner is a chip that only has the instruction required to perform the complicated calculations for a designated set of currencies. These devices are the most efficient for mining Cryptocurrencies because they can’t do anything else like send commands to your hard drive or tell the back ground of a first-person shooter to move as you hold down the ASDW keys.

I will post a more in depth discussion about my personal experiences and the experiences reported by others in trying to use ASIC mining hardware. I will just provide this cautionary teaser: AMD, Intel, and NVIDIA are old, well established, insured, companies with large customer bases. Cryptocurrency ASIC manufacturers are largely new companies without any reputation or large amounts of R&D funds, and in many cases, no support whatsoever.

Up next, my fun experiences with ASIC miners and then a detailed guide into mining software.

Stay tuned!

Wikipedia – Bitcoin

https://en.wikipedia.org/wiki/Bitcoin

Bitcoin Forum – The most popular place to discuss all Cryptocurrencies

https://bitcointalk.org/index.php

Cryptocurrency Trading Charts

https://coinmarketcap.com/

Most Profitable Mining Calculations

http://www.coinwarz.com/cryptocurrency

Some Exchanges

https://poloniex.com/

https://btc-e.com/

https://www.gdax.com/

https://www.bittrex.com/

 

 

 

Acquiring Cryptocurrencies

Cryptocurrencies like Bitcoin, well almost exclusively Bitcoin, have been getting some play time in the popular media. Hopefully you understand what they’re talking about, if not check back to my earlier post “A Change in Direction”. Now you might be asking yourself, “How do I get some?”

Mining

Mining Cryptocurrencies is essentially using electricity to generate Cryptocurrency. Not all Cryptocurrencies can be mined. For those that can, the process involves looking for a new block in the currency’s blockchain. The miner who finds the block is rewarded with some units of the currency.

The process of looking for a block involves math, complicated and difficult math. The sort of math that would take you or me 30-45 minutes to do by hand with a calculator. Additionally, the more miners doing the same math for a currency increases the “Difficulty” of the math. New or less popular currencies are easier to mine until they become more popular. The more miners or powerful mining hardware working away at the currency, the more the completion rate of the calculation must be slowed down to keep the reward rate stable. The “Difficulty” of the calculations is proportional to the “Hash Rate” of the currency’s network and must adjust to speed up or slow down the reward frequency.

A later post will look at mining in more detail, but I will briefly touch on hardware concepts. Mining can be done on a computer’s CPUs, though the video card(s’) GPU(s), or with application-specific integrated circuit (ASIC) hardware.

Staking

Staking also involves electricity, but does not require math. With staking, one is rewarded for operating a node in the Network and holding on some units of the currency. The more currency held in the wallet the more often the wallet receives a deposit from the currency’s network. When I say, staking requires electricity, remember that Cryptocurrencies are digital, requiring computing hardware, which requires electricity. When the computer (desktop, tablet, laptop, ARM device, phone) is not running and connected to the network, Staking does not occur. Staking currencies to not require miners to generate more currency.

The acts of maintaining a node and holding a balance of currency results is two things. First, having more nodes in the Network increases the speed of transaction verification and keeps the network well distributed and healthy. Holding back portions of the currency from trading increases the rarity of the currency and helps support higher trading prices through the laws of supply and demand.

Master Nodes

Master Nodes are very like Staking, but there some major differences. The amount or frequency of reward does not change with the amount of currency in the wallet of the node. Master nodes take a portion of the coins mined. Networks require a certain balance of the currency to qualify as a master node.

If you want to increase your reward with Staking, buy and hold more currency in your staking wallet. If you want to increase your reward with Master Nodes, create a new master node and buy the minimum amount of currency required to run the master node.

 

Exchanges

You’ve heard of New York Stock Exchange (NYSE), right? There are several others around the world where people trade fiat currencies for pieces of a company. You may not have heard of FOREX exchanges. These market places are where people come to trade currencies.

Conceivably, you could trade or exchange some US Dollars (USD) for Great British Pounds (GBP) one morning at the Exchange rate of 1.60 USD for 1 GBP. Later that day the rate has changes and you can change your 1 GBP back to 1.80 USD. So over the course of the day you’ve made 20 cents just moving your balances from one currency to another.

The same concept is available in Cryptocurrencies. You can move your balances between Bitcoin and Altcoins, Bitcoin and fiat, fiat and Altcoins…. Altcoins and Altcoins.

Upcoming posts will break out some topics introduced in this blog and cover other concepts in detail.

Stay tuned!

Wikipedia – Bitcoin

https://en.wikipedia.org/wiki/Bitcoin

Bitcoin Forum – The most popular place to discuss all Cryptocurrencies

https://bitcointalk.org/index.php

Cryptocurrency Trading Charts

https://coinmarketcap.com/

Most Profitable Mining Calculations

http://www.coinwarz.com/cryptocurrency

Some Exchanges

https://poloniex.com/

https://btc-e.com/

https://www.gdax.com/

https://www.bittrex.com/

 

 

 

A Change In Direction

There are a lot of great and exciting things happening in the world of Microsoft. I am nearly overwhelmed with the evolution of Data Science technologies, my specialty. And yet I’ve not found an opportunity within my current career to dive in and work on solving interesting problems utilizing these new technologies. Instead I find myself becoming more passionate about the developments in Cryptocurrencies.

There is a lot of introductory information available on this topic. I will include some links at the end for further reading. But to summarize and explain it in my characteristic easy straightforward manner: A Cryptocurrency is a digital asset. That is: A Cryptocurrency is something of value that exists as 1s and 0s. Simple, right? Let’s try an analogy, most of you have played some kind of mobile or PC game that involved earning money or points that can be traded in for improvements to your ability to play. In a lot of cases there are means to spend USD, GBP, or Euros to purchase in game Cryptocurrencies. From here on out I will refer to USD, GBP, Euros, other government managed currencies as fiat.

These concepts are directly transferable to Cryptocurrencies like Bitcoin, LiteCoin, Dash, Ethereum, Stratis, ZCash, so many more. They exist within digital systems (computers). They can be traded between fiat currencies. They are not carried around as physical paper or metal. In most cases, they can be acquired through a repetitive process.

Enough about game money, let’s focus on Cryptocurrencies that actually have some financial ramifications. Bitcoin was the first. The brain child of a mysterious personality,  Satoshi Nakamoto, took form first as a white paper (technical article). A short time later the concepts in the article were built as software and the first chuck of Bitcoin was created, some of it going to early supporters of the project.

Since that time several imitators have been created. Currently, any Cryptocurrency that is not Bitcoin is called an Altcoin (Alternative Coin). Nearly all of them have some value people are willing to trade fiat to acquire, anywhere from fractions of $0.01 to Bitcoin itself which is hovering over $1100 at the time of writing this blog. The reasons for development of these other coins vary as much as their value. In some cases, there are central challenges with the Bitcoin infrastructure they claim to solve. In other cases, the Altcoin is trying to stabilize the fiat trade value by limiting the supply. And there are those currencies created specifically for the creators to gin up hype, trade a lot of the initial supply for fiat, and then disappear.

Upcoming posts will break out some topics introduced in this blog and cover other concepts in detail.

Stay tuned!

Wikipedia – Bitcoin

https://en.wikipedia.org/wiki/Bitcoin

Bitcoin Forum – The most popular place to discuss all Cryptocurrencies

https://bitcointalk.org/index.php

Cryptocurrency Trading Charts

https://coinmarketcap.com/

 

Congratulations American Airlines

I did not think it possible. American Airlines has beat all the odds and actually made the center seat more hellish! Some of you may not remember, roughly 10 years ago there were several law suits, some not valid, brought against airlines for the cramped travel conditions. Doctors even had a name for the injury done to frequent fliers who had to sit in the wrong position for so long. American Airlines, almost immediately, yanked out 2-3 rows of seats to spread them all out giving everyone more leg room.

On Monday I flew 4 hours in the center seat of a 1 month old aircraft ran by American and I can safely say the  leg room has been reduced back to pre “we want your business” levels. Not only was the distance between the seats ridiculously small, but the space under the seat in front was reduced 1/3 to accommodate some idiotic metal box that was bolted to the seat support that was also offset 3+ inches from where it should have been.

There was no lumbar support in the seat back. I was writhing to gain relief between lower back pain, upper back pain and calf spasms the entire journey. They only make the aisle seats available to customers with status. Well there’s a great way to discourage a person from flying with you enough to earn status. They’ll be wheelchair bound by 25k miles.

Coming Home

Almost 2 months ago I had my first day at Avanade. For those of you who don’t know, Avanade was cerated as a join venture between Microsoft and Accenture. Avanade has thier own business development streams but 99.9% of the Microsoft projects Accenture wins, are sent to the the Avanade team for execution.

Well let me just say what an absolute joy it has been to come back to the Microsoft family of products. After 13 months of wasting my life away fighting with Open Source garbage, I’ve come home to integrated enterprise solutions that work as advertised or at least have some reliable sources for support when they don’t. I was actually told to stop blogging about how much the Open Stack is a waste of time and money… Anyway, that’s behind me.

To add to the good vibes, Avanade is connected to Microsft in so many ways. We’ve actually had advanced looks at new technologies before the rest of the community. There 20+ MVPs in just the Midwest region, Avanade requires 80+ hours of training every year, and employees are encouraged to participate in developer community organizations.

I’m excited to talk about the first area of expertise they’d like me to look at, Avanade Touch Analytics (ATA). I haven’t completed the training yet, but this offering is fantastic. The easiest interface I’ve ever used to create dashboards that look and feel like Tableau or Spotfire, but perform lightyears ahead of both. Once the data sources are made available to the ATA server for any customer’s instance, the dashboards can be authored for or on any device. Switch between layout views to see how your dashboards will look on any device before releasing them. Publish multiple dashboards to different Active Directory security groups and let your users pick the information that’s important to them. It’s exciting, and I’m glad to see an offering addressing the shortcomings of the competition in a hosted or onsite instalations.

Well that’s enough advertising. Now that my censorship is at an end, I’ll be blogging mroe often I really want to discuss SQL Server’s memory resident database product, interesting things I’ve learned about the SSIS Service recently, and Service Broker.

Consulting 101: Credibility and Integrity

Let me preface this treatise with a message to those in my audience who actually know me in person. I’ve been doing what I do for almost 18 years. My blog posts are a compilation of observations stretching that whole time and back into my years in grade school. I do not refer to anyone in particular any of you and I may know. My blogs are mostly about me.
How many times can a restaurant you frequent get your order wrong before you stop spending your money there? How many times can a garage fail to fix your car before you take it somewhere else for service? As a consultant, contractor, or subject matter expert, how many mistakes is your customer willing to forgive? I don’t know either, so I always shoot for perfection.
In my practice, the struggle for perfection means I will not quickly offer my gut feeling on a solution to a problem. I want to research the situation and think it over for some time until I am comfortable taking a position. The discipline to be 99% sure about something before I share it helps me avoid mistakes. The more often I’m right the more my credibility builds. The buildup of credibility eventually leads to my customers’ increasing confidence in my work. And that’s great because, a lack of confidence in my expertise always manifests itself as more time wasted in explanations, healthy debate, and sometimes fruitless arguments about things I’m at least 99% sure of.
Relatively, I do not propose solutions that I cannot implement 100% myself. There is a theme of helplessness prevailing through some workplace environments; taking the shape of people who will not lift a finger to figure something out without being fully trained and having a stack of documentation. I’m going to put on my old fogey hat now and relate to you, my audience, how my first ASP web sites were written in notepad. My “simulator” was an actual Windows NT server with IIS and FrontPage extensions. In those days there wasn’t any documentation really because we were figuring it out as we went. I was handed a challenge that usually looked nothing like requirements and told to go figure it out. I did figure it out without training and it made a better professional out of me.
So when I say, “Let’s do it this way.” I mean I can do the whole thing this way myself if I have to. I’m 99% sure it will meet all the requirements on paper and the several that you haven’t thought of yet.
Now, I am human and I do make mistakes. Under the perfection mandate, I strive to find my mistakes and fix them before everyone notices. I once worked for a company where the products all had a call home feature. When there was an error the system would either dial in or FTP a message to a system in the home office that would create a ticket and kick off a workflow for resolution. I was so impressed by the fact that a customer could come in the office in the morning to find an email from tech support notifying them an error was detected and fixed remotely overnight and the customer suffered no outage as a result. I strive to conduct my business the same way by fixing an issue as soon as I determine it’s my responsibility and then explaining what happened and how I fixed it. That’s exercising integrity to build credibility. The value of building credibility is always greater than the perceived liability of admitting to bugs with integrity.
All that said, every action has its equal and opposite reaction. There will always be competitive forces… or persons who will work to build credibility through damaging yours. After all, it seems hard to build credibility by simply agreeing with someone else all the time even if the other person has a 99% success rate. The perception is that always agreeing with another makes one a follower or toady. Likewise, some resources are hiding the fact that they will not succeed with your proposal because it involves things they haven’t been trained on. Yes, the corporate business environment often mirrors school yard factions carving out various spheres of dominance. Woe unto the executive staff that has to always play teacher or referee. Truly, you have to pity decision makers who are constantly dealing with weak personalities who cannot tolerate others discovering they may not be perfect, so seek to advance solely through bringing down others.
The school yard provides the tactic for dealing with this. Get to teacher first! Luckily, if you’re catching, fixing, and admitting to your short comings before anyone notices, your competition shows up to tattle on you and looks rather foolish. Teacher says, “Yes I know. He told me and corrected the issue in such a seamless matter we never knew anything was wrong.”
Don’t misunderstand. It makes me sick that adults conduct themselves in this matter. It’s one of the reasons I sought the freedom of working for myself. Even now, when these situations arise, I suffer less than healthy rises in blood pressure. Why do we have to go through this schoolyard battle again after I’ve already built up all this credibility? The point is to revert back to the idea of not immediately going with gut reactions mentioned above. Don’t fall into the competitive traps. Diligently building credibility through accuracy and integrity should, in theory, pay off in the long run. Optionally, find a sub-contractor and throw them to the wolves.

PostgreSQL, AWS, and Musical Bottlenecks

I have had the misfortune of working with PostgreSQL for the last 8 months. Working is a relative term, for me little work has been done mostly I’ve been kicking off queries waiting forever fo the returns and then trying to run down the bottleneck.

I am not a Linux professional and have to rely on those professionals to diagnose what’s going on with the AWS instance that runs PostgreSQL 9.3. Everyone who looked at the situation has had a different opinion. One person looked at one set of performance data and said the system isn’t being utilized at all, someone else would say it’s IO bound, still someone else would say it’s the network card… So we wnet through all these suppositions added more RAM, then more processors, then we used the SSD drives more, finally switching from Non-provisioned IOPS to Provisioned IOPS got the system roughly as far as we could push it to where the complex queries would drive one CPU Core to 100%.

Now those of you who work with read enterprise RDBMS might say, “Wait… One CPU core reached 100%?” Well yes, of course, because you see PostgreSQL does not have parallel processing. Yeah…

No matter how many CTEs or sub queries present in a query statement sent to PostgreSQL, The processing of said query will happen in a synchronous, single threaded fashion on CPU core. I’m thinking SQL Server had parallel processing in the late 90’s or early 2000’s? It’s 2014 for crying out loud.

And it gets better! According to my observations, the Postgres process is also single threaded. This process is responsible for writing to the transaction logs. So there isn’t any benefit to create multiple log files for software striping and efficient log writing. In fact, one big insert seemed to back up all the smaller transactions, while the first insert wrote to the transaction log.

This is one of the joys of Open Source offerings. If the development community doesn’t think a feature is important you have to fork the code and write the feature yourself. What blows me away is that companies are willing to gamble the success of their products and implementations on something so hokey.