bitcoin mining

Bitcoin mining, joint accounts and smart contracts

In this blog post we will build on top of the knowledge acquired in the last two blog posts about Blockchain and cryptocurrencies. We will explore bitcoin mining, joint accounts and smart contracts.

bitcoin mining

Mining:

Remember The Gold Rush? When people were flocking to mine for gold? Today, Bitcoin can also be mined. How? Let’s find out.

Bitcoin mining is a process in which a complicated mathematical puzzle needs to be solved, and solving this puzzle requires a lot of computational power. Typically, this would take ordinary computers years to find the solution, and thus, it needs a lot of electricity. Whoever solves that puzzle first is rewarded with Bitcoins, and these new Bitcoins are minted and added to the total Bitcoins supply in circulation. Hence, the term “mining” was coined. But why would we waste electricity? To prevent double-spending.

Transactions created in the Bitcoin network are collected by miners who then try to solve the puzzle. Every 10 minutes or so someone can solve the puzzle and thus gets the right to put all his/her collected transactions in a Block, making it a part of the Blockchain.

Once the transaction becomes part of the Blockchain and a few more blocks are added, it becomes computationally costly to maliciously modify the Blockchain to double-spend the Bitcoin, which is already part of an existing transaction.

This mining algorithm is called “Proof of Work”, and it’s an exquisite way to keep the Blockchain system safe and consistent without the need for an intermediary.

bitcoin mining

Mining Farms:

Since mining requires a lot of computational power to solve the mathematical puzzle, some companies own one or more computer data centers. These data centers are called Mining Farms, and they have hundreds and thousands of special purpose computers explicitly built to solve these mathematical puzzles.

Today, multiple mining farms owned by different companies compete to solve the puzzle for claiming the Bitcoin reward.

As more miners join the network and more powerful computers are introduced, the mathematical puzzle gets harder and harder for miners to solve, so on average, it should take around ten minutes to solve, no matter how powerful the computers get.

bitcoin mining

Joint Accounts:

Joint accounts are prevalent in the real world. For example, we have joint accounts with our spouses, business partners, etc. In joint accounts, a designated number of participants are needed to authorize a transaction. Is it possible to enable joint accounts in the Bitcoin system? Are we out of luck? Is that a missing feature?

The good news is that the Bitcoin system is robust and supports joint account features, making it even more powerful and flexible.

To understand how the Bitcoin system provides this feature, we first have to understand the technology which makes it possible.

bitcoin mining

Multi-Signature:

In the world of Bitcoin, a special purpose program called P2SH (Pay to Script Hash) enables multiple signature support. Think of it as a virtual person sitting inside the computer to ensure the minimum required valid signatures are present before releasing any payment(s) or other funds. The P2SH program is also assigned a Bitcoin Address where anyone can send Bitcoins. However, multiple digital signatures are required to use the Bitcoins received at the address.

The number of digital signatures required to unlock Bitcoins is pre-programmed in the script. So, in essence, P2SH scripts act as a governing entity.

Contract:

If the P2SH script can govern access to Bitcoins via multi-signatures, is there any way we can administer arbitrary contracts on Blockchain? The answer is YES! However, the Bitcoin system is designed to transfer value, so it cannot carry out complex contract logic involving the transfer of assets.

This takes us to another world built on top of Blockchain infrastructure and utilizing the same concepts we have learned so far.

bitcoin mining

Ethereum and Smart Contracts:

Ethereum was built on Blockchain and introduced the concept of Smart Contracts. Smart Contracts are special-purpose programs run on an Ethereum network and provide the governing capability.

Smart Contracts are powerful enough to build complex logic like Deeds Enforcements, Assets Exchanges, Supply Chains Tracking, Property Contracts Executions, etc.

Like a computer application, these Smart Contracts must be programmed to implement special use cases.

Blockchain

Blockchain and how it works

Blockchain Overview:

Blockchain has proven to be an undeniably fascinating electronic ledger. It helps ensure that processes, procedures, interactions, governance, and currency are streamlined without an intermediary (middleman or agent). Despite the ingeniousness of this invention, it is still relatively unknown to the average person around the globe.

This blog post is for a general audience; therefore, it does not require prior knowledge.

Firstly, it is essential to understand the basic concepts upon which Blockchain is built as this will subsequently broaden our knowledge of how it functions.

After grasping and understanding the concepts mentioned in this blog, you will be able to understand these blogs about cryptocurrencies and smart contracts.

Blockchain

Hashing Function:

A hashing function is a mathematical function that takes in any random text and generates a fixed-length text. Think of it as a box in which one can put any size document(s), and it will produce a unique token with a fixed length.

Message: “My name is XYZ, and I would like to transfer $100 to my friend ABC.”

Output = Hash(Message)

Output: GEWWRR12REQW

It’s important to note that the Hash function’s output will be uttered entirely if the message is changed completely or slightly. Hash functions are irreversible; given the output, the original message will never be found.

Cryptography:

The word “cryptography” originates from Greek, meaning “Secret Writing”. Cryptography is a science of protecting data against tampering, eavesdropping, unauthorized access, and malicious use. Through cryptographic algorithms, once the information is locked (encrypted), it is nearly impossible to unlock (decrypt) that information without the knowledge of a secret key. However, using the most advanced computing power cannot guarantee such a decrypting process.

Cryptographic algorithms are reversible, unlike the Hash functions. So the message locked using the secret key can be unlocked to retrieve the original message.

Blockchain

Public Key Cryptography:

Public Key Cryptography is a technique in which two keys are used to encrypt relevant information or data. One of the keys, called “Public Key,” is used to lock vital information and is publicly available to users. This is similar to an individual’s bank account number, which can be shared with others if desired. The second key, the “Private or Secret Key,” is used to unlock vital information. This key is similar to the PIN of a debit card or the signature on a check. The public/private key pair is analogous to a lock. For example, anyone can put a lock on a box, but once locked, no one can unlock it unless the private key is available.

Public Key: XSDGD1SDF34AD

Private Key: GF34GREHS54AS

It is the user’s responsibility to keep their private key safe from anyone else. If the key is compromised, it can be used for malicious purposes by hackers or criminals. Just like if someone can retrieve the PIN of another individual, they will automatically possess the power to do away with the victim’s finances once such an opportunity presents itself.

Blockchain

Digital Signature:

We can create digital signatures using a combination of Hash Function and Public Key Cryptography. Consider using a document with text.

Message = “I would like to pay $10 to XYZ.”

We then hash it to get a unique token.

Hash = A1B2C3

Then, we sign this hash with our private key.

Signature = Sign (Hash, Privatekey)

This will give us a signature value that anyone can verify using the public key.

Verify (Message, Signature, PublicKey)

This will output “Verified” if the message is the same as what was signed. If it is not the same, then it will fail verification.

Centralized Systems:

Centralized computing systems are owned and controlled by organizations like Google, Amazon, Facebook, Banks, Governments, and more. Users can interact with these systems over the internet; whatever data they provide is then stored in the central databases. These organizations have complete control of the data and can use them as they please. Furthermore, each organization enforces its rules for using its system.

Decentralized Systems:

Decentralized systems are formed by a computer network in which no central authority exists. Anyone can join and leave the network and access the information as they please. The users, not the organizations, control the data on the decentralized networks, which is more like a democratic system, where users are in control.

Blockchain:

A favorite question among people who have just begun familiarizing themselves with this new technology is: Why is it called “blockchain”? This stems from the concept that, within blockchain technology, blocks of information are connected using the hash value of the data inside the block. 

The Blockchain is exceptionally secure because even the most minor change in any block can alter the value of the original hash, ultimately breaking the chain. This means that any malicious attempt to corrupt data can be easily detected and will be rejected by other computers in the network.

Blockchain

Digital Currency

How digital currencies like Bitcoin are kept safe

In this blog post we will build on top of the knowledge acquired in the last blog post. We will explore differences between fiat and digital currencies, bitcoin as digital currency and how it can be kept safe in digital wallets.

Digital Currency

Fiat Currency:

Fiat currency refers to money used in a particular country that lets consumers purchase goods. Every country has its currency, and each currency differs in value. Generally, the value is controlled by the respective governments.

For instance, if someone has a $100 bill, it is necessarily just a piece of paper. However, the issuing country has attached a specific value to this bill, granting the owner purchasing power. Therefore, we can think of this kind of currency as part of a centralized system.

Bitcoin

Banks:

Banks are institutions that were designed to keep money safe. Additionally, when backed by the FDIC, this money is insured with the full faith and credit of the United States government.

To ensure its security, users must prove their identity and sign various agreements to open a bank account. When someone deposits money in their account, the Bank keeps a ledger for that user on file, which they continue to update each time there is activity.

If someone needs to send money to another user via their Bank, the Bank acts as an intermediary and will transfer the capital straight to the recipient’s Bank, which will then update their account. Banks operate as centralized systems, have complete control of users’ accounts, have the power to seize users’ accounts, and can dictate certain restrictions, preventing users from using their own money.

Digital Currencies

Digital Currency:

We are currently in the digital age where computers surround us and have access to information at the touch of our fingertips. Like most other companies in today’s financial market, banks use computers to keep track of ledgers with all transactional details recorded.

A new payment system, Bitcoin, showed up in 2009 and has since revolutionized how we think about money. After the internet, many described Bitcoin as the most disruptive technology of the century. But what exactly is Bitcoin, and how does it work?

Bitcoin


Bitcoin:

Bitcoin is a virtual and digital currency built on a blockchain infrastructure. Imagine a hypothetical system in which pictures of dollar bills represent one’s ownership of money. In this case, if you have an image of $100, then it is possible to email that image to a friend of yours. After your friend receives the email and stores that image on their computer, they own $100, and they can utilize it by sending it to someone else in exchange for goods.

Similarly, Bitcoin is a currency that lives entirely in a computer system. You can send and receive Bitcoin currency to and from anyone. Additionally, since Bitcoin’s network is decentralized, no single entity controls the system. Therefore, the value of Bitcoin is determined by users based on the supply/demand premises.

Bitcoin


Identity on Blockchain:

Banks require proof of identity to open an account so that it can be associated with someone. So, who holds the identity on Blockchain? Who opens the accounts on Blockchain? How does someone prove their identity?

The answer to all these questions is simple: no one does. No one can figure out how many Bitcoins a person owns, but there has to be a way to associate Bitcoins with their owners.

Recall public/private keys from the previous post. That public key, also referred to as the Bitcoin address, acts as the identity for that individual. Therefore, if someone wishes to send Bitcoin to a particular person, they need to send it to that individual’s public key.

Private keys are used to access and manage the Bitcoins a person owns. So, the only way to send Bitcoins to someone’s public key is to sign the transaction using the private key digitally. It is crucial to keep the private key safe. If the private key is lost, then there is no way to access the Bitcoins controlled by that private key which can cause them to be lost forever.

Bitcoin


Wallets:

We keep Fiat cash in our wallets or purses. Just like physical wallets, digital wallets are used to store cryptocurrencies. There is, however, a misconception that wallets store Bitcoins, but in reality, Bitcoins are tracked in the Bitcoin Network, whereas wallets keep track of private keys used to access those funds.

What happens when the wallet is lost? Well, in the “real” world, we lose all the money in it. Similarly, if the digital wallet is lost or corrupted and the private keys are not stored elsewhere, the Bitcoins associated with those private keys are also lost forever. 

There are different types of wallets, each with pros and cons.

Desktop Wallets:

These wallets can be installed on desktops or laptops, but they are not very secure.

Mobile Wallets:

These wallets can be installed on cell phones, and they are more secure than desktop wallets.

Web Wallets:

These wallets are developed by 3rd party companies and are primarily managed in the cloud.

Hardware Wallets:

These are special-purpose hardware wallets designed to store keys safely. Because of their design, they are very secure.

Paper Wallets:

Keys can be engraved on paper, metal, or other materials and kept safe.

Transaction:

How do we track changes in Bitcoin ownership? We do it through Transactions that are recorded on the ledger permanently and contain information about the evolution of ownership from the sender to the receiver.

For the transaction to be accepted by the network, it should be digitally signed by the sender using their private key. The sender should have enough funds to transfer, network fees should be covered, and the receiver’s public key should be valid.

Accepted Transactions then become part of the Blockchain and can be verified by anyone who has access to it.

Once the transaction is sent to the Bitcoin Network, it takes 10 minutes to become part of the ledger.

Double Spending:

What exactly is Double Spending? Imagine you have a $100 bill and give it to someone. At this moment, a change of ownership has taken place, meaning you no longer have access to that $100 bill. After you transfer ownership, you cannot use it multiple times. You can have a different $100 bill that you are free to spend, but you cannot use the one already spent.

When using a credit card, your Bank keeps track of your spending. Every time a purchase takes place, it is recorded on the Bank’s internal ledger, and the balance is decremented, preventing you from spending more than you have.

So, how do we prevent someone from using the same Bitcoin multiple times (i.e., double spending)? To understand the solution, we first have to understand mining.

Challenges to Cloud Computing

AWS cloud migration Advantages

Cloud computing is the on-demand availability of computing resources, such as databases, servers, networks, storage, etc., that can be accessed over the internet. Amazon Web Services, also known as AWS, is a cloud computing platform by the tech giant Amazon. Although cloud computing has gained massive popularity recently, some organizations are still oblivious to its value proposition.

CRE8IVELOGIX Inc is an AWS consulting partner specializing in digital transformation and application modernization. With our certified experts and 20+ years of experience, CRE8IVELOGIX Inc is the partner organizations can trust in their cloud adoption and cloud migration needs. 

Below we’ve discussed some advantages of migrating your apps to the cloud:

Security:

Security should be the No 1 priority of every organization when dealing with confidential data. Any data breach can be insidious to an organization’s reputation and trust in its products. Cloud offers advanced security features that protect data and resources when properly configured. These services include Web Application Firewalls, Encryption Services, Fine-grained permission policies, etc. Not all services are secure by default. However, the infrastructure provisioned using the Well-Architected CDK developed by CRE8IVELOGIX provides security out of the box.

AWS cloud migration services

Agility:

Modernized applications take advantage of cloud-native services. By modernizing applications and leveraging AWS application migration services, your development teams become more agile. And can focus on developing differentiating business features instead of worrying about the heavy lifting of infrastructure provisioning and management. 

AWS cloud migration services

Cost Reduction:

Cost reduction is probably the most significant advantage of cloud computing and AWS cloud migration. Cloud enables you to build complex applications utilizing complicated infrastructure without requiring huge IT staff. Once organizations migrate to cloud using our AWS cloud migration services, they no longer need to pay for complicated equipment or maintain it.

AWS cloud migration services

Elasticity:

Every application has varying needs; some are popular and have more traffic, while others are active only for a few hours. As the application demand increases, its hardware requirement increases proportionally. The hardware procurement cycle could take weeks or months. Therefore, organizations tend to over-provision their infrastructure for the potential increase in traffic, wasting a lot of money. Cloud, on the other hand, offers an elastic infrastructure that can scale up and down automatically based on demand. Organizations utilizing cloud computing, after their apps are migrated to the cloud, have a significant competitive edge thanks to this level of adaptability.

Global Expansion:

With its global infrastructure, exposing applications worldwide can be done in minutes. Distributing applications via the global network allows end users to access the resources through the data center closest to them, resulting in lower latency and higher application performance. All this is possible with our cloud migration services.

AWS cloud migration services

CRE8IVELOGIC Inc specializes in AWS cloud computing technologies and AWS Cloud migration. We have been helping our partners migrate or build cutting-edge cloud-native technologies for over six years. By adopting AWS cloud, your organization can benefit from all the pros discussed in this blog, which will make it ahead of its competitors.