Nonoutsourceable Puzzles

Here is another lecture on alternative puzzles regarding non-outsourcable puzzles. I don’t know too much about this topic. It was really fascinating and took me a bit longer to understand it though.

Questions answered in this Post:

  • What is a non-outsourcable puzzle?
  • Why are mining pools potentially non-outsourcable?
  • Vigilante Attack and improved vigilante attack
  • What are the mining mechanic changes?
  • Will this be the future?

What is a non-outsourcable puzzle?

Simply. Puzzles that discourage the consolidation of mining power.

Are mining pools are risk?

Previous lectures, this class has talked quite a bit about mining pools and even have shown graphs pointing to how Bitcoin mining is concentrated. The lecturer then starts a discussion on how mining pools could be a threat. Pool operators may become central targets for coercion or hacking. However, this isn’t how mining pools were initially describe in the previous lectures. In that the participants or the mining pool don’t really trust each other or the pool operator. And that’s an observation that the lecturer goes into. The pool operates being of the “shares” protocol which distributes profits throughout all the members transparently and fairly. Guess, that ties up that discussion, to be no. The incentive structure that allowed mining pools to get so large opposes this idea of collusion and trust among members and operators.

What about vigilante attacks?

Vigilante attack, again have been discussed before. The purpose of the attack is one member of the pool is angry with the pool operator and thus wants to hurt the operator. A vigilante attack is based on someone trying to act maliciously while part of a mining pool. If a vigilante finds the block rewarded with the pool operators public key, they don’t end up sharing it with the pool operator. The result is the pool output decreases as they likely missed a block reward which in turn also hurts the vigilante. From the description, I’m still unclear why someone would want to do this attack as if they care about maximizing return, this is not that. The lecturer mentions though the vigilante is only losing a little as he’s still gaining other members profits from share block rewards.

Miller then mentions about how one cannot rely on vigilantes for doing this attack. I’m still not sold why they would do this in the first place. So this is now where the non-outsourcable puzzle comes in. How do you devise the right incentives to make the vigilante attack more appealing

Improved Vigilante Attack

The improved attack is that the vigilante takes the entire block reward for themselves. Thus, this would make them more likely to make this attack if they can. So if the vigilante can be everyone, why isn’t everyone out there running this attack? Jumping ahead, we’re now going over the mechanics of the puzzle.

Mining mechanics

Instead of just hashing, search now requires signing. Signing implies there is a private key and thus one can spend the reward via this known private key. This mechanism further drives the point, will there be no mining pool, as right now this puzzle doesn’t make sense for the operator or the participants. Lastly, the lecturer discusses a practical implementation of this which is not too different form the current mining problem. There are two signatures though. The first signatures is used with computing a hash in addition to a previous hash, nonce, and public key. The second signature is used only if its within the target and then you use the Merkle root. Then you can choose which transactions will be included into the next block.

Should we all jump on the bandwagon?

Maybe not. As I had mentioned before, if this puzzle gets used, harmless decentralized P2Pools are also at risk. People with not have any incentive to participate. From there, the lecturer mentions they may go towards other centralized features like hosting mining. Hosted mining, I think, means that you pay someone else to mine for you.

Further Research

Andrew Miller, the lecturer, has written about this topic further. I’ve linked some additional resources that discussed using the non outsourable puzzles. From what I can tell/ my minimal Google searching, haven’t seen evidence that people have discussed this post 2016. With the move to Proof of Stake for Ethereum and growth of ZKP, my take are there are other areas people are using to tackle this issue with mining outside of the non-outsourcable puzzles.

ASIC Resistant Puzzles

This lectures describes what ASIC resistant puzzles are since this is a widely researched topic in puzzles. I also completely diverted from the lecture notes by bringing up a topic I’ve been following closely which is ProgPOW in Ethereum. This is a proposal for introducing another (potential) ASIC resistant puzzle for Ethereum.

Questions answered in this Post:

      • What and why do ASIC resistant puzzles matter?
      • Memory Hard Problems
      • Memory Hard Problems: Scrypt
      • Memory Hard Problems: Cuckoo Hash Cycles
      • ProgPOW: Ethereum discussion

Why care about ASIC resistant puzzles?

A bit of a backstory, Bitcoin used to be mined by individuals. Home computers that weren’t fancy could be miners and win the block rewards. Nowadays, that’s pretty much impossible. Companies running giant mining rigs running specialized hardware dominate the network now. ASIC stands for Application-Specific Integrated Circuit and describes the specialized hardware now used to mine Bitcoin and some other cryptocurrencies. Because of this shift, people have proposed alternatives to democratize mining. Is there a way to allow the average consumer the ability to participate once again in mining? ASIC resistant boils down to if allowing specialized hardware to have an intrinsic advantage when participating (mining) for a network.

Based on the above description, it’s clear that one goal of ASIC resistant puzzles is to lower the barrier to entry. This allows potentially any idle hardware could be used to contribute to supporting a blockchain network.

Another goal, in a similar strain, is reducing the monopoly by big manufacturing firms. The creators of the mining hardware have an unfair advantage. If they’ve created the new hardware and then mine Bitcoin with it for a few months, buyers are essentially getting a second-hand piece of hardware. Given that the difficulty level changes over time, it’s thought that when newer hardware is first used, it performs better and then overtimes the reward decreases. The lecturer uses the term “burn-in” advantage to describe the “use before sell” approach. Thus the new approach would be to reduce difference between future hardware and existing custom ASICs which would allow for longevity with the hardware and reduce this “burn-in” advantage.

Tangent on Mining Ecosystem: Work by Siacoin

Ok, not sure if you’re like me, but when I hear Siacoin my first thought was not cryptocurrency. However, they’ve written and done compelling work looking at the ASIC industry. Siacoin is building online network for distributed storage. They created ASICs for their own Sia mining somewhat related to Bitmain’s ASIC release and documented their journey. “The vast majority of ASIC-resistant algorithms were designed by software engineers making assumptions about the limitations of custom hardware. ” This quote alone makes me skeptical whenever people claim that something is ASIC resistant. Further down, I mentioned about ProgPOW for Ethereum and feel comforted that they are seeking a 3rd party audit. The article touches about Monero secret mining which again targets a real world example that this lecture discussed.

Memory Hard Problems

Memory hard problems is a type of puzzle that is ASIC resistant. It uses the idea known since the 80s that cost and performance in memory is more stable than for processors. As time has progressed processing has increased exponentially while memory and storage have increased at a slower rate. Thus if you pick a puzzle based on processing than it’s more likely to change significantly and older versions will have worse performance than a puzzle that was memory or storage intensive. He brings up Moore’s Law briefly when mentioning the exponential improvement.

Scrypt – Colin Percival

One potential memory hard hash function is called Scrypt by Colin Percival (2009). Scrypt is similar to the Bitcoin puzzle but instead of using SHA2, it replaces the function with the scrypt algorithm. It has a trade-off with constant time/memory. It can be computed with a certain amount of fixed memory, any smaller, it will require more time. In addition, it has already been adopted by a known cryptocurrency, Litecoin. Scrypt is used in other application such as for password hashing. Thus the lecturer mentions another benefit to this approach is that if there were issues other people have eyes on this mechanism to look for vulnerabilities.

Scrypt Steps

  1. Fill memory with random values
  2. Read from the memory in random order

The lecturer then dives into a step-by-step example of how the algorithm works. The algorithm, per the lecturer, was memory hard because if you reduce memory by half, then the number of computational steps increase by 1.5x. One disadvantage is that it requires N steps and N memory to check. In addition, scrypt ASICs unfortunately already exist. There was an interesting thread posted on Bitcointalk which I’ve linked here. It points out that scrypt does use SHA256 but the algorithm happens to be memory intensive. Given that in 2013, the cryptocurrencies using this algorithm were low value and low liquidity, manufacturers were not incentivized to build FPGA and ASIC when GPUs already do much of the needed work. I’ve found newer academic articles proving that scrypt is maximally memory-hard. However, based on what I’ve read, cryptocurrencies may not have achieved the right parameters, specifically the actual memory size, to achieve ASIC resistance which some suggested was due to support GPU miners. Again, I’ve provided my sources, but admittedly I don’t understand the proofs well enough to make a well-substantiated argument.

Cuckoo Hash Cycles – John Tromp + More

Next, we look at Cuckoo hash cycles by John Tromp (2014). It has a clear improvement to Scrypt in that it’s cheap to verify where before verification would require the same amount of memory as solving. For a certain memory size, you still compute the hash function. However, instead of having to look through the entire memory space, you just need to check if there is a cycle of size K where K is less than N.

There are more complex functions that people are researching which Miller mentions. Specifically X11 which as indicated in the name uses 11 different hash functions. The other is called a moving target which builds on changing the puzzle periodically. As with most lectures, Miller also provides a counter argument on why perhaps the current algorithm is sufficient.

ProgPOW: Programmable Proof of Work for Ethereum

Per EIP-1057, “Proof-of-Work algorithm to replace Ethash that utilizes almost all parts of commodity GPUs”. Clear and concise. The goal as mentioned for ASIC Resistance is to allow commodity GPUs to be used for Proof of Work mining. Having a custom ASIC would not be beneficial. The primarily discussion that I’ve read about has little to do with the new algorithm or when it will be implemented. Most conversation has been around getting the algorithm audited. There seems to be consensus around whether people see it as useful. 

Counter Argument: Maybe ASIC Resistant isn’t needed now

The argument simply is that Bitcoin mining ASICs aren’t changing very much anyway. Thus the first argument brought up with Moore’s law, is maybe not as needed. Processing is not increasing at that much of an exponential rate that necessitates the shift to memory intensive algorithms. The difference between the bigger and smaller ASICs is how many copies of the same SHA2 function the hardware holds. 

Similar to where the lecturer mentioned that ASIC resistant wasn’t needed, the most recent BTC forks have also had a similar discussion.

https://news.bitcoin.com/cryptocurrency-projects-aiming-to-be-asic-resistant-have-little-success/

Tangent on Memory Hard Problems

Just a quick note, I wasn’t able to find many resources outside of those related to this course talking about memory hard problems that weren’t cryptography intensive. A. Biryukov from the University of Luxembourg has published two papers relating memory-hard and cryptocurrencies though. If you’re interested, I’ve left links to both papers, Fast and Tradeoff-Resilient Memory-Hard Functions for Cryptocurrencies and Password Hashing and Tradeoff Cryptoanalysis of Memory-Hard Functions

Wrap Up

ASIC resistance

      • seeks to make it more appealing to mine with regular consumer devices than it is today
      • response to centralization of Bitcoin mining

 

Bitcoin and Anonymity: Back to Basics

Bitcoin and Anonymity

I’m finally on Week 6. That’s a win! Be warned this lecture covers several related topics and seems to jump from one to the other. Thus the notes below seems a bit more disjointed. This lecture dives into the terms of what it means to be anonymous. In addition, it brought up compelling questions on the ethics behind it. Getting into blockchain, there is a lot of talk about decentralization. For me, I look at decentralization as not necessarily requiring anonymity. People have been building these reputation and identity systems which is almost accomplishing the opposite goal, shedding light on these anonymous addresses to. Lastly, we talk about blind signatures which demonstrate why anonymity and decentralize may be at odds with each other.

Questions answered in this Post:

  • Is Bitcoin anonymous?
  • Who is this anonymity good for? What are the improvements that have been proposed?
  • What does unlinkability mean and is it necessary?
  • Why anonymous cryptocurrencies?
  • Why don’t you want complete anonymity?
  • What is some historical references of anonymous cash?
  • What are some anonymous currencies if not Bitcoin?

Is Bitcoin anonymous?

It depends. That is the best answer to any question for almost everything (Oh so vague). Anonymous is defined to be “without a name”. Bitcoin addresses are public key hashes rather than real identities which realistically map to some real world entity. That is not a requirement but at this point in time many people physically create a public address that they themselves use and control. Apparently this is defined as “pseudonymity”. Even with things like hierarchical deterministic wallets, all those addresses are sprung by a single entity. So now it becomes more of a question of semantics.

What does unlinkability mean and is it necessary?

Anonymity is equal to pseudonymity plus unlinkability. Thus, unlinkability means that different interactions of the same user with the system should not be linkable to each other. Linkable in the sense that someone could monitor all the transactions and know that these set of transaction were all done by the same user even if there used different addresses. That’s actually pretty profound and difficult. I’m just thinking that if you see a high concentration of transactions happening between two parties and not anyone else than potentially that grouping may know each other or at least partake in business with each other. It may or may not be a similar algorithm for how Facebook or Linkedin can determine friend groups.

 

Now let’s talk about an example with online forums where people are able to create online entities. Some places like Reddit or Telegram, people create long-term pseudonyms. With Reddit, your reputation gives you more access and power within the site. Alternatively, 4Chan, the posts are anonymous with no attribution at all.

Additionally, if anyone has used cryptocurrency exchanges like Coinbase or even pure crypto-exchanges like Liqui or Poloniex, users need to input address and country information into the system. Therefore, real world identities are explicitly added to a system that could have been done with straight hash addresses.

Because of this and the fact unlinkability is hard among all addresses/transactions, instead another term is used called anonymity set. An anonymity set is the crowd that one attempts to blend into. I think it of it more like “study thy enemy”. This means that for the set you need to understand what the adversary knows, what they do not know, and what they cannot know. Thus to get to unlinkability, you’re trying to maximize the anonymity set. You also need to have a careful and thorough understanding of the technical protocol. Now the lecturer just shifts gears into discussing the ethics of this approach.

Anonymous Cryptocurrencies?

Currently blockchain based currencies are publicly, and permanently traceable. This means that the notion of privacy is worse than traditional banking which is one goal some people hope to achieve with blockchain and cryptocurrencies. Thus, he makes the argument that blockchain needs to do better.  I ask again “Why?”. I would have preferred for him to state the reasons more explicitly. I read another post called “Importance of Anonymous Cryptocurrencies” where he at least elaborates on the idea a second time. I took his response to mean that not all currencies have to be anonymous. In fact the mainstream ones will likely not be as e-commerce and advertising benefit from this denonymization which is in fact more transparent than credit cards and especially more so than cash. The use of the research will drive confidence in mainstream adoption of Bitcoin. My take is that people will be happy that the technology exists but may not use it. His post also made me question if the question itself was invalid. Why ask the Bitcoin protocol about something that is more used in the Bitcoin ecosystem. The services are the truer implementation and develop around a protocol.

Why don’t you want complete anonymity?

Easily, one reason for wanting to provide complete anonymity is money laundering and even just using the funds for something malicious. Yes, that means that this structure is tied to real-world regulatory and criminal courts. However, if humans are performing these transactions on native soils, it seems reasonable that the entity that the people belong to has a hand in what happens to the currency amounts.

The lecturer uses this term bottleneck. Bottleneck means looking at the points of moving large flows of money in and out of Bitcoin. Thus, it is difficult to move money from Bitcoin to fiat currency. I don’t think that works since more and more people are going to just keep and provide their services for crypto. Look at Olaf Carlson-Wee, he took a job where he was only paid in crypto at a time where crypto was seemingly worthless. Also, there are websites that accept crypto but then at that point you’re also inputting several pieces of personal information like address and name though. It’s interesting he brought up the point of Tor which is an anonymous communication network where sender and receiver of message is truly unlinkable. So even with all this technology there is still a need for a blanket above it of law enforcement and regulation. Hmm, it sounds like this system can’t exist and be separate from centralized institutions if it will be safe for mainstream public consumption.

What are some historical references to anonymous currency (electronic cash)?

Arvind, the lecturer, brings up blind signatures which were created by David Chaum in 1982. This serves as an example that electronic cash has bee proposed in the past. Chaum can be considered the “Father of Anonymity”. Blind signatures is a two-party protocol, meaning two parties communicate with each other, to create a digital signature without the signer knowing the input. I looked up two of his papers, <a=””>Untraceable Electronic Mail, Return Addresses, and Digital Pseudonyms and <a=”https://taler.net/papers/chaum-blind-signatures.pdf”>Blind Signatures for Untraceable Payments. Arvind then walks through this protocol of blind signatures to handle anonymous e-cash.

Anonymous e-cash via blind signatures example

As with most examples, we start off with a bank, a central authority. The bank houses customer’s balances say customer Alphonso(10) and Bartelli(5). Also, it posses a table of spent coins. That’s not very interesting so let’s add some action to this story.

Alphonso wants to withdraw an anonymous coin of size 1. The bank will have a reduced balance that now equals 9. Afterwards they’ll execute the two party protocol. Alphonso will pick a random serial number of a coin which gets sent to the bank and there is some execution. The bank will send Alphonso a signature of the serial number in a way that the bank does not actually know the serial number. Now Alphonso has a signature of a serial number of an anonymous coin that (forgive me if this is not 100% correct), holds the information and value of the coin that Alphonso withdrew from that specific bank. The lecturer refers to this signature of a coin as an anonymous token that can be passed to others.

A little time passes. Alphonso decides he is going to give Bartelli one coin a a token of good will. The one coin that Alphonso holds which he knows the serial number that he sent to the bank as well as the signature of the coin that the bank sent back to him. He will send the anonymous (signed) token as well as the plain-text value of the token of the serial number. Bartelli will immediately contact the bank to deposit the money. Bartelli needs to do this action immediately to ensure that Alphonso is not trying to participate in a double spend. Double spend meaning that that Alphonso has not tried to give the anonymous token to several other individuals thus using the value of the token more than once and thereby creating more value than he started with. The bank will verify that the coin is not within the spent coins table. Only once the bank says the coin is valid with Bartelli continue with the transaction. The bank looks at the signature and makes sure it is valid as well as checking the plaintext serial number of the token is not within the spent coins table. Once confirmed, Bartelli will deposit the coin into the bank. Since the bank did not look at the serial number initially, the bank cannot tell who is the sender of the coin, they only know the receiver. Now the balances table will increment the balance to six and the bank will send a response back to the user. Now the bank cannot link the two users.

Drawbacks

One drawback is that the bank knows who is receiving the coin. The other question for me was whether it makes sense for users to just briefly touch base with the bank and then withdraw so that the balance is at zero. Basically you use the bank as just a validator but once that has been confirmed, the tokens become changed to anonymous and can be used for different payments.

The glaring drawback is centralization is required. The bank is used for both the signing and the validation of the coin. It is possible that banks for Alphonso and Bartelli don’t need to know their names and just their hash addresses. Even still, there is still a central location doing the validation. However, as a thought though, what can the bank do maliciously? The bank could just arbitrarily withdraw everyone’s funds and give it to themselves. They could also just lock the capital and not allow withdraws for deposits thereby freezing accounts. Arvind brings up that much of the research in cryptography protocols used a similar model where the bank was considered trustworthy.

Actual cryptocurrencies that encompass Anonymous Attributes

I’m going to just list a few that have some properies. Feel free to disagree or suggest more. I also did not include Zerocash which is in the next lecture.

  1. Monero
  2. Zcash
  3. Dash
  4. Verge

Monero, and Zcash are two currencies that provide anonymity features. I’ll talk more about Zcash in the next segment given that it’s discussed in this lecture series. Monero is not so I’ll spend some time on it.

Monero is cryptographically private and uses items called stealth addresses and ring confidential transactions. I have seen people on the internet recommend that one should use Tor with Monero. Stealth addresses means a random one-time address is automatically created for each transaction being made by the sender. This means that all payments sent have unique addresses and prevent links between the recipient. Ring signature add a second layer of masking by ensuring that the original sender of the coin cannot trace outputs on the blockchain. Outputs end up being masked so that senders are unable to determine if their coins are moved by the recipient by some grouping and hiding mechanism. The notion of ring confidential transaction means that the amount being transactions is hidden even though the network is able to verify said amount without revealing details. This mixing quality allows for the sum of inputs to equal the sum of outputs without knowing the exact sum of each individual component.

Dash and Verge are slightly different. They are not inherently cryptographically private. However, each has different characteristics built-in to provide more privacy then Bitcoin. Also, note that both dash and verge are similar in protocol to Bitcoin the the above two.

Dash uses something calling mixing, which is a method to anonymize Bitcoin. The truly basic explanation is that if you want to do a transactions merge it with other instead and then do a joint payment have it mixed together such that a little or your and the other persons values are distributed in the output. Thus there isn’t an easy way to separate the inputs and outputs in one bitcoin transaction. Dash has a level of trust built in for who it responsible for the mixing depending on the Public/Private send. The trust is enforced economically by having the master node lock some Dash coins though.

Verge offers privacy by how the messages are trafficed. They claim if one uses Tor and I2P Routing, traffic will be obfuscated and the user’s IP address will be concealed. It’s strange that Verge uses this secure communication but then have a site for the “Rich List”. Personally, I have not read their Blackpaper and only have a cursory understanding of the currency and how their focus on privacy is implemented.

Reflections: Anonymity versus Decentralization

Summing up, bitcoin allows for better decentralization than anonymity and that’s OK. The lecturer mentions that people can improve on the anonymity given that the decentralization target has been achieved. I’m not sure I agree that the decentralization target has been achieved giving the prevalence of mining farms. It does bring up to question, “Can you be both anonymous and decentralized?”. The example given suggests that if you use a bank or just an single centralized arbitrary validator to have these “two party protocols”, it’s not easy to decentralized. Also, because a blockchain is public, this is one way to enforce the accountability and security. It’s hard to prevent double spends then.

Unlinkability in Bitcoin could mean

  • It’s hard to link different addresses owned by the same user
  • It’s hard to link different transactions made by the same user

Mining incentives and strategies

This lecture focusing on miner incentives and strategies. When someone decides to mine, there are options that a miner has to how they actually mine. It is not simply get hardware, cheap electricity, run and wish for good luck. Miners can be more choosy to determine which blocks they work on which is discussed in this lecture.
Questions answered in this Post:

  • What is the miner default strategy?
  • What are some of the deviations and how can you analyze it?
  • What is a forking attack?
  • And furthemore, what is a Goldfinger Attack?
  • What is a forking attack through bribery mean?
  • What exists in the blockchain to prevent this?
  • What is a block-withholding attack?
  • What is punitive forking and how is it different from feature forking?

Default Miner Behavior

I’ll describe below what are some of the considerations miners make when determining their strategy. Just to be clear, the job of a miner is to listen on the network for transactions and blocks as well as get ready to write a transactions into a block. A miner is unable to write and send out a valid block until they actual solve the mining puzzle though.

First, they have to determine which transactions to include in a block. Default behavir is any block above the minimum transaction fee. The second is which block to mine on top of. Usually this is the longest valid chain. The next is how to choose between colliding blocks. The miner picks the first block hear. The last is when to announce new blocks and by default, it should be immediately after finding one. From now, the lecturer jumps into different “attacks” which in my interpretations are deviations in behavior.

One factor that is key is “alpha” which is what percentage of mining power do you control. Depending on your power, this is tied to how well choosing a non-default strategy may be profitable.

Forking Attack: what is it?

This is the first of the non-default strategies. Forking has gotten more notice recently due to it causing large fluctuations in the price as well as the creation of BTCC. Additionally, within Ethereum, a fork is pending as a way to bring in new chagnes which Metropolis to improve scale.

The goal of a forking attack is to perform a double spend. Remember a double spend is when a set of coins is used in more than one transaction. It does not mean new coins are created but that you are using the same coins for two transactions and ultimately reneging on one of the transactions. This would be considered fraudalent behavior. An example is presented in the notes. This same miner will work on an earlier block (ideally about 6 blocks earlier) and transfer than same amount that was going to “Bob”, they will give the bitcoins to themselves. The lecturer brings up a point where this attack depends on the percentage of mining power that you hold.

A miner sends some funds to user (victim) “Bob”. It will likely appear to be in the longest chain. However the forking miner is up to something sneaky. The miner will start to write off another block, one that occurred 6 blocks earlier. The miner will create another transaction where they send bitcoin to another address that they own. If the miner has sufficient hash power (>.5), they will continue writing on this alternate chain making the chain with Bob invalid. Thus history gets rewritten so that the payment to Bob is invalid. The lecturer brings up the point that if you had traded Bob for something in the real world (Bob gives you a teddy bear, you give Bob bitcoin) you have now come out ahead. Also, it means that you keep whatever amount you had given Bob. Double win for yourself and effectively successfully completing a double spend.

Takeaways from the Forking Attack

To do this, you need to have considerable hash power ie greater than .5. He mentions that it may be possible with less due to network overhead and avoiding block collisions, though I have not researched this further. He does mention that 51% is not always sufficient to execute an attack, only that the probabiliy increases because completing an attack becomes easier. This attack is clearly detectable and could be reversed. Being reversed means that that the community decides to reject the newest alternative chain even if it is the longest. That strikes me as requiring quite a bit of coordination. He mentions that this double spend could completely crash the bitcoin exchange rate. This would be due to loss of confidence in bitcoin if a double spend successfully when through and thus through lack of trust or other emotional triggers, there would be a stop to buying bitcoin for fiat ultimtely crashing the coin. Kinda doomsday to me, and really something like this could have to traditional fiat currency as well pulling more people to use bitcoin. The reason is that if the triggers for this collapse are linked to human emotions and fear, really nothing is safe.

Goldfinger Attack

Goldfinger refers to the movie and is used to explain why someone would want to cause bitcoin to crash and burn. In the movie, the villian wanted to devalue the Fort Knox gold so that the villian would have control over the supply. Thus in the case of bitcoin, you would make a profit if you shorted bitcoin or if you had strong holdings in an alt-currency.

Forking through bribery

Forking through bribery is fairly straightforward to understand. Instead of requiring alpha or hash power be greater than 0.5, he mentions tat it may be easier just to temporarily buy someone off. I suppose you can just have some single serve friends meaning that this attack can be undertaken not by just billionaires. The lecturer then goes on to describe some payment methods such as phsyically handing someone fiat currency, run a mining pool at a loss to attract attention and “friends”, or by just leaving large tips in the blockchain. The core idea stays the same and they work just temporarily for you. These miners are not incentivized in the long run however perhaps individual miners may just want a temporary gain. Tragedy of the commons” is how he described it. According to wikipedia, with situatios of shared resources, it is a situation where individual actors can behavior opposite or maliciously to a common good due to their own shared interest. In this case, it would be short versus long term gain on which would be greater. If the miner truly did not care about bitcoin or the power of blockchain and did not want to miner for a long period of time, they would be better rewarded to align with malicious parties.

Prevention Mechanism: Checkpointing

Each version of the bitcoin client always releases with this checkpoint mechanism. The security safeguard locks-in the blockchain up to that point in history and rejects other chains. This does mean there is a central party who are deciding what is the valid blockchain but at the same time it’s the central party of bitcoin developers.

Block-withholding attack

Again, this was is self explanatory as well. As a miner, you do not announce the block right away. Instead, you “get ahead”, by finding two more in a row and thus the next time someone announce a block, you can just annoucne yours and create the longest block. At this point, it means all the work everyone else is doing is invalid/orphaned and you would be able to profit. It has the term “selfish mining” but that’s a misnomer according to the lecturer.

In the scenario, if you’re only ahead by 1 instead of 2, then you need to immediately push your hidden block and hope that people decide to choose yours. This creates a race condition since now there are two versions of the history and only the majority will prevail. The suprising characteristic to me was that this mechanism would work if you knew that you would always/in majority win that race condition race. The lecturer mentions that you need to have alpha over 25% to do this. Also, you could couple the other attacks like bribery to get ahead.

Punitive Forking

This mechanism is just vengeful. If someone just wants to blacklist transactions from a specific address, a miner can just refuse to mine on any chain with a transaction from X. This strategy realistically only works if you have alpha great than .5. However, I could see this as a strategy for future uses if government regulation came into play. Governments could easily just blacklist certain addresses that they knew were doing money laundering. This would be an extremely temporary solution since people could just keep changing addresses or not. If the ban was strong enough, the money could be stop gapped to a certain account for a longer period of time.

Feather-forking

This is similar to punitive is that it’s directed toward a certain address hwoever it is more practicaly. Instead of banning a address outright, you can refuse to mine directly on any block with a transaction from X however, you’ll remine after n confirming blocks. If you hold a alpha greater than some amount, you may be able to get others to join the blacklist because it induces an a^2 chance of losing a block. Since you’re transparent with this ban, it’s no secret if you’re doing this feather forking. Success depends on convincing others how likely you’ll actually fork the network.
Again, regulation and extortion could be used.

There was another case that miners can truly blacklist on any characteristic present in a block. THe lecturer brings up one where they may try to enforce a minimum transaction fee. That’s interesting and could work. According to what I’ve read, it’s on average $7.00. This already exists in that priority has to be greater than 0.576 as of May 2015 mentioned in the lecture.

I remember reading in Bloomberg where someone lost $70K due to gas fees in Ethereum. Clearly a miner was greatly compensated for their work.

Wrap up

In summary, just want to say this was quite a bit of information. Miners have incentives coming from everywhere yet most seem to follow a simple herd mentality whether due to laziness or lack of technical skills. There are game-theortic alternative strategies that perhaps have not been seen in the real world but would be interesting if they got out.

Mining Pools: Bitcoin style

Mining Pools

Mining Pools. Clearly from the previous lectures, it sounds expensive to be a small miner. It costs about $6,000 to purchase a rig. Expected time to find a block is 14 months and that breaks down to $1,000/month when amortized. Because this is all amortized valuation, things could go horribly wrong for you or you could get luck and achieve more. This is where mining pools come in in that it providers some insurance for the miner by banding with others. Mining pools are not just in bitcoin but are in other cryptocurrencies as well but I’ll get to that after I talk about the basics of what is a mining pool and a bit regarding the economies. This was a long lecture that covered many topics broadly and thus I hope to dive into some of the topics individually to truly learn more about them.

Questions answered in this Post:

  • Why did mining pools develop?
  • What is a mining pool?
  • What is a mining share?
  • How does a miner indicate how much work they have done and how that translates to income?
  • Describe what pay-per-share versus proportional method mean in relation to bitcoin mining.
  • Who is Luke-jr
  • what is pool hopping?
  • Why do mining pool protocols exist?
  • General Mining pool history

What is the intuition behind forming mining pools?

As with most lectures in this series, the lecturer starts at the very beginning of the topic to answer the question. He briefly described the risks involved with mining and the large amount of uncertainty that is present. Because of this, if this was the only option to mine, mining would be a very very risky business. To further illustrate the point of mining pools, the lecturer brought up a more traditional business model.

When small business/farms faced high risk, they historically formed mutual insurance companies to lower the risk. This translates to sharing the risk through the group ensuring that if one business had a bad year, they would not be at a complete loss. It does mean that some of the group members may earn a smaller share of profits to help counterbalance the lower performance of others. To me, this only makes sense if the group is diversified. Coming back to a concrete example of farmers, if this is a group of corn farmers from Illinois within 50 square miles of each other, I would guess that if one corn farmer suffered a loss due to poor weather conditions, all the other farmers would also have a poor year. However, if you had a group of corn farmers from all over the world perhaps weather and geopolitics as well as other risks maybe better distributed out. From this question, when people are determining who can join what mining pool, will they ask about location/hardware/costs as a factor?

Mining Pool: What is that?

A mining pool is mutual insurance for Bitcoin miners. It is a group of miners that form a pool and all attempt to mine a block with a designated coinbase recipient who is called the pool manager. Irrespective of who find the block, the pool manager receives all the rewards and then will evenly distribute it to all the participants based on some criteria, ideally ho much work each participant actually performed. The pool manager will also take a cut for managing the pool as well as keep the trust that each party has with them. They are responsible for accurately defining the payout criteria to each member. The book suggests that miners can prove their work by outputting mining shares which I will expand upon below.

Bitcoin mining pools are collections of Bitcoin miners who have the same strategy, group up to get a block solved, and share on the same reward. The reward sharing will depend on miner’s power contribution and the method that they are exercising towards Bitcoin mining. https://www.bitcoinminer.com/pools/

Mining shares: manner of defining miner’s work

Mining shares is a way that miners can probabilistically prove how much work they are doing by outputting shares or near-valid block. Near valid blocks means how close to the target number were you. The targets is usually some number that begins with many zeros (67 zeroes). A mining share may be valid if it is a number that contains 40 – 50 zeroes.

The pool manager will also run Bitcoin nod, collect transactions, and assemble them into a block. The manager will send their address and send the block to all participants of the pool. The pool participants can also work on this block and prove that they’ve been working by sending in shares. Once a valid block is found, the pool manager distributes the reward in proportion to the amount done. Thus, the winner of the block will only receive this average amount based on their work not based on if they were the winner or not.

Pool Manager: What criteria can they use to calculate pay?

The lecture describes two common approaches though I’m sure many more exist: pay-per-share and proportional.

Pay-per-share Method

The first is pay-per-share where the manager pay a flat fee for every share above a certain difficulty for the block that the pool is working on.
Miners send their shares to the pool manager right away and get paid without waiting for the pool to find a block. This works really well for the miner but moves all the risk to the pool manager. Because of this, pool managers will charger higher fees than other models as a reward for taking on so much risk. There is also no incentives for miners to send valid blocks to pool managers in that they can discard valid blocks and still keep getting paid. This means that a mining pool can keep paying out miners but the pool manager will never get a full block reward and likely will be running at a complete loss.

Proportional

The second is the proportional which the amount of payment depends on whether the pool actually found a valid block. Every time a valid block is fund, the rewards from the lock are distributed to the members proportional to how much work the miners actually did. Thus risk is not solely on the pool manager this time. If the pool is large than the variance of how often the pool finds blocks is low. There is lower risk for pool managers since they only pay out when valid blocks are found and thus they don’t risk overpaying people and miners are incentivized to send all blocks to the pool manager. Thus there is more work for the pool manager to verify, calculate, and distribute rewards. From the information they gave, it seems like using the proportional method makes the most sense for certain periods of time if you can get miners to say they will stay with the pool for a certain time interval.

Luke-jr approach

Luke-jr method is different because there is no management fee. Miners only get paid once they hit some minimum threshold usually 1 BTC. Thus you don’t make as much money when you are first starting out because of this minimum threshold. One thing that’s interesting is the Luke-Jr ( luke-jr) is the name of a real person. Luke Dashjr is a Bitcoin core developer and he founded the Eligis mining pool.

Issues like Pool Hopping

Pool hopping means switching between different mining pools at different times. There is some strategy involved though. The book mentioned that a miner may try mining in a proportional pool early in the cycle because the rewards per share are relatively high and then switch to the pay-per-share pool later in the cycle when the expected rewards are lower. As a result of this pool hopping, other more complicated schemes exist ie “pay per last N shares submitted”.

Mining Pool Protocols

Mining pool protocols is the mechanism that pool managers use to communicate with their members. There needs to be communication between the pool and the miners because pools need to provide work to the miners, collect their results, as well as ensure efficiency with the mining. The lecture mentions three mining protocols: getblockshare, getwork, and stratum. The simple getwork mining protocol just issued block headers for miners to solve. Thus, miners knew little about what was in the block and the pool operator was responsible for deciding which transactions were accepted. I think getblockshare is an error and that lecturer meant getblocktemplate. The getblocktemplate creation to the miner though the pools would set up the rules. While this still leaves a loop hole for fraudulent behavior from pools, the security is more decentralized in this fashion. Stratum is more of a open source client-server “overlay” protocol and is used by Electrum. Stratum replaced getwork in 2012. According to slushpool, Stratum resolves some earlier issues with getwork. Because it’s more of a line-based protocol using a TCP client with JSON-RPC, people don’t need to rely on HTTP overhead. The lecturer did not touch too heavily beyond this but I will definitely be looking more into this topic.

People have wanted to make these mining protocols standardized because they are important to the Bitcoin ecosystem. Certain hardware systems support specific protocols which lowers the barrier to entry for miners in terms of knowing how to setup a mining protocol.

Historical Context regarding Mining Pools

Mining pools first started in 2010 during the GPU era of bitcoin mining. Slushpool claims to be the first bitcoin mining pool starting in December 2010. Also by 2014, 90% of mining is pool based. There are monopolies in the Bitcoin mining pool which played a role in the SegWit issue.

Wrap-Up

Overall, the lecturer wraps up with the pros and cons. The positive as from the beginning of this article, pools reduce the risk and make it more predictable allowing for smaller miners to participate. Also, more miners end up using updated validation software since the pool managers are responsible for this. The negatives are that mining pools support centralization as well as discourage miners from running full nodes.

Energy Consumption and Ecology

Energy Consumption and Ecology

This lecture sought to look at the effects of bitcoin mining from a different perspective. At least in July 2016, bitcoin mining is dominated by certain p2p pools. If you want some historical data regarding the bitcoin mining network, checkout Neighbourhood Pool Watch. According to bitnode21, there were 7599 nodes running on June 2017. This does not necessarily indicate the number of existing miners but should shed some light. The estimation from this Brave New Coin article suggests around 100,000 miners. While, the statistics on mining pool estimates and miner hashrates is interesting, that was not the core focus on this lecture.

This lecturer focused on looking at the ecological effects that bitcoin may have.

Questions answered in this Post:

  • How do you defined energy used by bitcoin?
  • Where can I find the distribution of miners?
  • In terms of usage, how does that compare to modern life?
  • What should we do with this excess energy, if anything?
  • Think about more open questions.

The lecture first begins with the Landauer’s principle developed by Ralph, you guessed it, Landauer in the 1960s. The principle states that any non-reversible computation must consume a minimum amount of energy. Each bit change requires kT ln 2 joules. This amount derived from basic physics. However, currently this is the theoretical minimum and at this point in time there is significantly more energy used.

Because energy is never destroyed, but transformed into something else. Note, SHA-256 is not reversible meaning that energy consumption is inevitable. We walked through the three main energy aspects of mining: embodied energy, electricity, and cooling.

Main Energy Aspects

  1. Embodied energy: energy required to manufacture mining chips and ship it to the users which theoretically should decrease over time and returns to scale
  2. Electricity: energy needed to perform the computations which will increase over time and returns to scale. This is where Landauer’s energy comes to play.
  3. Cooling: energy need to protect equipment that is doing the mining which will cost more with increased scale

Follow up Notes

He makes a point regarding the embodied energy that I’m not sure I agree with. It is that mining circuits will be obsolete less quickly. This was counter to what was previously discussed where with mining rigs, people are able to get rewards initially but slowly over time, less rewards are gained. Also, companies keep making newer and newer hardware that individuals have to purchase to keep up with the increased difficulty. Maybe this is a longer term goal that will be achieved later on…

Also, these electricity costs are relative. If you do you mining in a cooler climate, you don’t need to spend as much on cooling.

From March 2015, they post some statistics about energy usage. $.10/kWh since each block at this time was worth $15,000. $25/s and upper bound of electricity consumed is 900 MW.
Then he went over a second calculation which was bottom-up approach. This approach looked at the number of hashes the miners were computing and then try to derive a lower bound of electricity consumption by assuming miners were using the most efficient hardware. The cutting edge ASICs performs 3 billion hashes per second while consuming 1 watt of power. The total network hashrate is about 350,000,000 GH/s then is takes about 117 MW to produce that many hashes per second. While these are just estimates, the idea is that miners are likely using a few hundred MW.

It was nice that after doing this calculation he gave a nice example of a frame of mind for what a megawatt means.

Name MW Used
Bitcoin Miner ~100-800 MW
Typical Hydroplant 1000 MW
Coal-fired plant 2000 MW
Nuclear Plant 4000 MW
Kashiwazaki-Kariwa (Nuclear) 7000 MW
Three Gorges Dam (Hydro) 10000 MW

 

The whole bitcoin network is consuming less than an entire power plant. That sounds more serious then the lecturer presented it as. Though he does rationalize it by saying that all payments systems require money such as storage of money/electronic transfers. It would be interesting if someone computed roughly the usage of credit cards as compared to the bitcoin miners.

Data Furnaces

Well, he then took the next logically step which was “Can we do something with this heat generated?”. The mining rig could also serve as a heater for your home. This mining rig is generating heat based on electricity. He mentions three challenges for this. One deals with that fact that gas heaters are 10x more efficient than electric heaters. Personally, while true, I don’t think this should prevent people from at least testing out this approach. I think electric versus gas and I think electric cars and Tesla. Simple minded, probably, but until I look into it further there is still a window of hope in my mind. The second challenge he mentioned was the ownership/maintenance model. Who owns the rewards that the machine gains? This is easily summed that the company would likely take the profit. It is foolish to think maybe if there is a smart contract on the mining rig that that contract should hold onto the coins? The last is that within the summer, the heater would not be used as heavily. If there is less mining power, what happens to the bitcoin mining? People would have odd incentives to use the heater in summer if they think others will not be using it and thus the difficulty may be lower.

This lecture was a series of “what ifs”. There is no conclusive evidence provided and merely this section to me sought to have the listener keep asking more questions.

Questions

Which of the following are assumptions made about the UPPER bound for the energy used for mining Bitcoins?

  • Miners mine up to the point that all of the money they earn is used to pay for electricity
  • Miners all pay the same for electricity

Which of the following are assumptions made about the LOWER bound for the energy used for mining bitcoins?

  • Everyone mines where it is cold(cooling doesn’t consume energy)
  • Everyone mines at the maximum claimed efficiency

Mining Hardware: what kind of special hardware do I need?

Mining Hardware

I’m not 100% why this lecture was not touched upon earlier. Since I thought I had this great understanding of SHA-256 back in lecture 1 and now I’m like, I was a fool.

Questions answered in this Post:

  • What else should I know about SHA256?
  • What is this mysterious function miners have to compute?
  • Where can I find a Bitcoin ATM?
  • What simple ways did they classify owners of bitcoin?
  • Using the fiat mediated transaction model, what happens when supply is too low?

SHA256: more words about it

As mentioned earlier, it is a general purpose hash function. General purpose meaning that there is a list of other SHA-2 functions. SHA-2 stands for Secure Hash Algorithm 2 and was designed by the NSA. Yes, there is a SHA-1 if you’re curious and people are working on SHA-3. SHA-2 consists of SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256. They are considered unbroken cryptographically even if there are known weaknesses. SHA-256 is computed with 32-bit words and SHA-512 is computed with 64-bit words. One takeaway is that SHA-256 has been optimized for 32-bit systems.

He showed a picture which reminded me of a crazy logic puzzle. OK, not really that but here’s a representative picture below. This is not the exact picture but a very similar one taken from Wikipedia.

Yet even in this lecture, he says we don’t really need to know SHA-256. He did give an overview which was more than we got previously. In the pictures you see the letters “A-H”, which are actually 8 32-bit words. As a sanity check, 8 * 32 = 256 so we’re still working with 256 bits. There are four computation rounds that take place. In each computation round, different bits are tweaked and then their bits are added and then everything is mod 32. A complete computation does 80 different iterations.

Honestly whenever I’ve used SHA-256 I just use a library to do it without thinking about the mechanics. However, after learning more about the importance with mining , this reflects what kind of work miners have to do. A basic code as presented from the lectures is listed below and you can observe that they are also calling SHA256 not once but twice.

while (1) {

HDR[kNonePos]++;

if (SHA256(SHA256(HDR)) < (65535 << 208) / DIFFICULTY)

return;

}

A normal machine can compute this calculation 2^24 hashes per second (10 -20 MHz). When bitcoin first started that would have been sufficient. Back in 2013 when this lecture was released, he mentions it would take ~140,000 years.

The next level was to use GPU mining which allows for high-performance graphics allowing high parallelism and high throughput. It was implemented in OpenCL which had people hacking the individual implementation for specific cards used. There were advantage back then. It was easily available and to set up. You get parallel ALUs (arithmetic-logic units), bit-speciic instructions, overclocking, and rig multiple ones from 1 CPU. If people tell you they have their own mining rigs, I picture some crazy space cowboy rig from like Cowboy Bebop. Now even GPUs are not good enough.

People introduced FPGAs which allow for higher performance for GPU and have better cooling implementations. However as of when the lecture was released, it would take 25 years to find a bitcoin block. So yes you get superior performance than before but you’re really not good enough.

Nowadays people use ASICs is they mine. ASICs (Application Specific integrated circuits), are hardware machines that are specialized to mine bitcoin. They have been designed specifically for mining and have adjusted for any changes in the environment but they do require major expertise and long lead-times. Usually you have to pre-order the ASIC miner and the important question to ask is when the hardware will be shipped. It was interesting that the TerraMiner IV ($6000)  would take around 14 months to mine a block. Also, most boards are considered obsolete within 3-6 months and most profits are made in the first 6 weeks. That means time is of the essence to get this machine.

Basically miners have only really made money because the price if bitcoin has exploded. There are now professional mining centers. He mentions one from the Republic of Georgia. To create one, you need cheap power, good network, and cooler climate.

 

Takeaway from this lecture, you’re never going to be good enough to mine bitcoin unless you have special skills, money, and live in an appropriate environment…

Remaining questions:

  1. Can small miners stay in the game?
  2. Do ASICs violate the original Bitcoin vision by going against every individual being part of the netowrk and working together?
  3.  Would we be better off without ASICs?
    Which statement about Bitcoin miners is NOT true?
    Bitcoin miners can recoup a reasonable fraction of their initial expenses by selling their ASICs once they are done with them to other users for less computationall intense purposes.

To be a bitcoin miner….

Bitcoin Miners

Week 5! I’m curious if what bitcoin miners face is similar to what other digital currency miners face. With bitcoin, miners are required to store and broadcast the blockchain, validate new transactions, and they have the ability to vote by hash power on consensus. That being said, my favorite part of the lecture was just understanding some of the miner lingo.

Questions answered in this Post:

  • Who are the miners?
  • How do they operate?
  • What’s the business model like for miners?
  • What impact are miners having on the environment

Also, as I’ve mentioned in previous posts, trying to mine bitcoin is likely not going to be profitable easily. It requires quite a bit of hardware and people have had their AWS accounts hacked so that people could mine bitcoin. Hmmm…. The price tag for the specific hardware is pretty pricey. Other cryptocurrencies may have more potential.

How to be a bitcoin miner. Only 6 EASY steps

  1. Join the network, listen for transactions – validate all proposed transactions
  2. Listen for new blocks, maintain block chain
  3. Assemble a new valid block
  4. Find the nonce to make your block valid – Hard work trying to find that special number…
  5. Hope and pray everybody accepts your new block
  6. Profit. Repeat…

Who benefits from these steps
Steps 1-3 are useful to the bitcoin network because they are needed to maintain and thus this is where you provide!
4-6 incentive aspect, meaning this is where you gain!

The first two steps are handled by software that you download. In the first step, the node is listening to transactions in the network and then validates it based on a strict list of rules. In the second list, you’re listening for new blocks that have already been added to make sure that you’re validating each transaction in the block and checking that the block contains a valid nonce. The next steps where you start to build a candidate block to write to the blockchain is where things get interesting. Now, you’re setting yourself up to make a contribution to the blockchain and at the same time receive some incentives for the work. Once you have assembled this block, you now need to find the nonce to make your block valid.

I have discussed that earlier here where I spoke about hashed linked lists where each block is composed of a Merkle tree of transactions.
2. Then keep trying to find a nonce

Parameter in the coinbase transaction:
after you exhaust nonce in the block header 32 bit number
then try a new nonce after incrementing the coinbase.

Setting the mining difficult

Every two weeks, computed:

next_difficulty = previous_difficulty * 2 weeks/(time to mine last 2016 blocks)

expected number of blocks in 2 weeks at 10 minute node

so over time the mining difficulty gets worse even though there is a target to make new blocks every 10 minutes

Time to find a block is interesting because previously it used to go from 10 min down to 5 minutes but now its from 10 min only to 8 min. Thus, this suggests that the improvement seen in those two weeks is not as much.

Currency Exchange Markets: Cryptocurrency Edition

Currency Exchange Markets

Yes, I’m finally at the last lecture of week 4. Seriously, it’s so long. Also, I realize the first time I watched the lecture, I did not fully understand much of what was talked about during the lecture. I have remedied that by writing out this article.

Questions answered in this Post:

  • How is currency exchange markets different from bitcoin exchange?
  • How can I exchange my fiat for bitcoin?
  • Where can I find a Bitcoin ATM?
  • What simple ways did they classify owners of bitcoin?
  • Using the fiat mediated transaction model, what happens when supply is too low?

Currency Exchange Market, isn’t that just Forex?

Currency exchange markets in this lecture refer to trading bitcoin against fiat currency. If you know anything about foreign exchange markets than you’re in luck since they operate similarly. The exchange rate refers to how much someone is willing to buy one currency and sell another currency.
The site points to Bitcoincharts as an example of a place to view markets. This website gives you pricing of not just USD but for a wide variety of different fiat currency. If you’re just interested in just USD prices then use this link.
From viewing this site because of the constant updates, you can see this is a liquid market.

There is another option which is buying bitcoin in person with cash. There are sites like localbitcoins.com where you can choose to find people near you to make these trades. I observed that even though bitcoincharts showed the price of bitcoin to be about $1300 (according to Coinbase it’s $1312.99, the prices that people were posting were at least $1400. Some were even $1500 and more. This does show the distinction between using a more liquid versus this one to one exchange. If you still want to go this path, there are apparently regular meetups that people go to to trade bitcoin. I’m not sure if that would be more liquid but I think that you would have more competition and thus perhaps the price to buy bitcoin may be more standard and closer to the market price listed online. There are also bitcoin vending machines around the world where these machine may allow you to sell bitcoin. New Hampshire, USA has at least 5 bitcoin vending machines. Personally I think these machines are a bit shady in that I would be hesitant to use them given the transaction fees. This Coindesk article while a bit old does touch upon certain types of new machines that accept bitcoin. Now, the lecturer decided to start talking about market dynamics… (I know this is a terrible segue but I’m watching the video).

Basic Market Dynamics

  • market matches buyer and seller
  • large, liquid market reaches a market price
  • price set by supply (of BTC) and demand (for BTC)

Now how does that translate to the bitcoin land. When the video was filmed there was 13.1 million BTC. As of April 29, 2017, there are 16,300,750 BTC. Supply of a currency is equal to the amount of coins in circulation plus the amount in demand deposits. If you have bitcoins in demand deposit for dollars then that does have to be included. the amount of bitcoin may rise beyond 21 million BTC dependin on what supply you’re looking at. The demand of bitcoin is defined as one to mediate fiat-currency transaction and as an investment.

What does mediate fiat-currency transactions mean?
My interpretation is that you’re using Bitcoin as a tool to exchange other currencies and thus you have no plans to hold Bitcoin long term. The reason for doing this is that transferring money can be difficult. Using Western Union or MoneyGram can be expensive as well as you get large transaction fees as well as less ideal exchange rates. This is for transferring money internationally. Even domestically can be difficult if the two parties are not using the same bank and you need to transfer a large amount of money. If your’re actually interested in moving money without bitcoin, check out this article from Nerdwallet.
OFX, Transferwise, and XOOM are all newer companies that are helping reduce costs but I think by comparison using bitcoin may be cheaper. You won’t win with speed though or with convenience at this point.

Below I’ve written down a concrete scenario to hopefully remove any abstraction.

This means that Alice buys BTC for some dollars. Then Alice sends BTC to Bob Then Bob sells the BTC for $. Thus the main take away is that the BTC is out of circulation for this time. The reason for doni this is that you’ll get If you use it for investment purposes, the idea is that the market thinks demand will go up in the future.

Now that we understand what is being done, the next question is what effect does transaction mediate have on the price of bitcoin?

He walks through a simple model for modeling transaction-demand. While listening I kept nodding and was like great this makes sense. After I walked away then tried to explain the concept to myself again and was completely at a loss. If this happened to you, I hope my below explanation can help.

There are three variables that this model relies upon.

T (Total Transaction Value)

This is your demand in a rate format. It is how much money that needs to be moved during a certain period of time. In this case all money (fiat) is boiled down to a base value in dollars. The period of time used by this model is in seconds. My understanding of how to calculate this would be to sum up all the potential transactions that need to be taken a day and then divide that by (24 * 3600 =  84,600). While I now understand this variable, my question would be is this an easy number to calculate? Can you get this from reading the blockchain?

D (Duration)

This is how long those bitcoins will be out of circulation in order to mediate a transaction. I thought about those payment services individuals as a way of understanding this number. Let’s say a merchant hired a firm to handle the bitcoin processing. Thus the duration would be how long it takes the merchant to accept the bitcoin from the client and then return the dollar amount to the merchant. Again this gets measured in seconds.

S (Supply)

Since this is a demand-supply model, it makes sense that supply is the last value. This refers to the supply of bitcoin that are liquid in the market. That means you take the full supply of bitcoin around 16 million and subtract the amount of bitcoin that are used for long term investment. This supply is a number in terms of bitcoin. To get to any sort of dollar amount to work with T, you would need to multiply the S by the price of bitcoin.

P (Price of Bitcoin)

Very simple this is the price of bitcoin. However, think of P as Dollars/1 Bitcoin. This will make it easier for the below part.

S/D – Number of bitcoins available per second. You’re dividing the total supply by the time needed for a transaction. If the

T/P – Bitcoins needed per second. Right now, you’re converting the total transaction value which is in dollars into the number of bitcoins.

From these two simple values of Number of Bitcoins available and Number if Bitcoins needed, the lecturer goes through different cases. If you think back to Econ 101, there were always Demand and Supply curves. demand_supply

Thus at a specific moment in time there is a supply of S/D and demand of T/P and with this model, prices will fluctuate in order to bring supply and demand in line with each other. Now let’s look at the consequences of inequalities between supply and demand. In econ, if supply is higher than demand, then that means the suppliers will be willing to lower their price. That translates to higher supply in available bitcoin means that people who are selling bitcoin will be able to lower their asking price in order to sell them. If you just care about equations and direction of movement, for T/P, when price drops (note that means the the denominator is getting smaller) the demand increases. Similar in econ when the supply is smaller than demand, this means that the demand people are willing to pay a larger price for the fixed supply. Again, for this model, it means people who want to mediate transactions cannot because of a fixed supply and thus the price increases. If you’re an equations kinda of person, the below ones sum this all up quite nicely. equilibrium
What I thought was interesting, is this gives us a simple way to value the price of bitcoin. Using this equation, perhaps we can estimate if the price of bitcoin is higher or lower or matched up.

World of Cryptocurrencies

However, this lecture does not touch upon how many cryptocurrencies are out there that people trade. I almost think of bitcoin as the stable currency that people use to market the rest of their buys and sells against. There are different cryptocurrency exchanges that do not let you deal in fiat currency but instead you only use your cryptocurrency wallets.

Transaction Fees

Transaction Fees

I can’t believe I’m still on week four! There are only two more lectures left for this week: Transaction Fees and Currency Exchange Markets. If you just want to simple gist of this lecture. “Whenever there is a transaction, there is likely a fee. So pay up!” Also, at this point, I know more about the Ethereum fees rather than bitcoin. I’ll try to comment more about the Ethereum fee structure soon.

Questions answered in this Post:

  • What is a bitcoin transaction fee?
  • Who gets the transaction fee as a reward?
  • Why does the transaction fee exist at all?
  • How is this fee calculated?
  • Is there a way to send a transaction with no fee?
  • Random thought experiment.

Fees, fees, fees

We started the lecture by going over what is a transaction fee as defined by bitcoin. Transaction fee is the total value of coins that go into a transaction minus the total value of coins outputted. Well, to be honest that doesn’t tell me very much. I’ve gathered from this that the total coins outputted must be less than the coins inputted else the transaction cost would be negative or zero which does not make sense. This feed is given to the miner who includes the transaction into their block.

Why do fees exist?

Basic answer is “there is no such thing as a free lunch”. Every Economics teacher (and actually random math/comp sci teachers) has quoted that phrase to me. I’m sure you have heard it as well. Where’s the lunch?

no free lunch

Your transaction, of course. Why should someone put it into the blockchain for free? There are costs incurred to relay your transactions. A miner’s block is slightly larger to include your transaction. As with many things in bitcoin, you have the power to choose your own fee. You can choose no fee or pay a higher amount to further incentive miners to incorporate your transaction. If you choose to pay no fee, have no fear (maybe). According to bitcoin.it, there is a “Free transaction relay policy” in place. To be a part of this, the node must be connected to Lightfoot Hosting’s node, which relays indiscriminately. The site linked contains the exact instruction though.

Side note: I tried looking up Lightfoot Hosting. There is a place Lightfoot, Virginia as well as there is a host service. That is all I can comment about for now.

Breakdown of costs to relay transaction

  • peer to peer network
  • miners to record transaction
  • fee to just run a node

I’m sure the numbers listed in the video are outdated but I”ll throw them up anyway as well as get an updated list.

Current consensus feeds (2015)
No fee if

  • transaction has less than 1000 bytes
  • all outputs are .1 BTC or larger
  • large enough priority

Priority defined to be (sum of input age * input value) / (transaction size) or basically the longer a transaction is unspent the more it ages and increases the priority.

Otherwise the default fee is .0001 BTC per 1000 bytes. Just for from stats, most transactions are approximately 400 bytes: 148 bytes per input, 34 bytes for each output and ten bytes for other information.

Now fast forward to April 2017:

I have not seen information contradicting the free transaction so I’ll say for now they are still in place.

The cheapest fee is 220 Satoshis/byte so an average fee with a transaction size of 226 bytes is 50,000 Satoshis. Remember a Satoshi is 1.e- BTC. This information I got from bitcoinfees.

Per reddit , they post the price at  $.15 and remember bitcoin is around $1000. Yes it’s higher than that today almost $1300.

There is a bitcoinfees website that seems to be up to date as well as one at satoshi.info.

Again, not all of this is set in stone. The lecture makes this sound like guidelines. It is up to the miners to follow or not follow this.

Random Though Experiment

One thought experiment I had was what happens when the reward to mine a block goes to zero. Will the transaction cost have to some minimum amount to ensure that the transaction can still be persisted into the blockchain? My conclusion is that this time point in the future is so far in the future that perhaps new technology will be in place. Things like Raiden lightning may impact this if they become an intermediary layer for the actual blockchain. Another thought was if the bitcoin reward is decreasing logarithmic then perhaps the transaction fee would rise and stabilize to some transaction fee. There will definitely be a time at which the transaction fee will be greater than the reward.

PHP Code Snippets Powered By : XYZScripts.com