CS120 Study Guide

Unit 5: Bitcoin Data

5a. Explain various encoding methods used in Bitcoin 

  • What are some of the benefits of using hex as an encoding system in Bitcoin?

Hexadecimal is a base 16 system rather than the base 10 decimal system that most of us are very familiar with. Hexadecimal uses the decimal numbers 0 through 9 and six additional symbols, the letters a through f. This makes hex easier for humans to work with binary data as it provides a human-friendly way to represent binary values. Each hexadecimal digit represents 4 bits, half a byte, which means that a single byte can have values ranging from 00000000 to 11111111 in binary, which can be much more compactly represented in hex as 00 to FF.
Hexadecimal numbers, or hex, can shorten the number of digits required to the large numbers used in Bitcoin keys and make binary data more easily readable to humans.
To review, see Hex and Base58.

5b. Summarize the error prevention benefits provided by base58 and address checksums 

  • How does base58 encoding differ from base64, and what benefit does this difference provide?

Base58 encoding differs from base64 format by eliminating easily confused characters (by humans) from the set. The characters removed are: the number zero (0), the capital letter "O", the lowercase letter "L" (l), the capital "I", the left and right quotation marks ("") and the backslash "/" symbol.
The benefit of removing these characters is that it makes the transcription of keys in Bitcoin more accurate when performed by humans.
To review, see Base58.

5c. Describe the data in a Bitcoin block 

  • What are the main components of the data found in every Bitcoin block?

A block in Bitcoin is the fundamental component of the blockchain and, therefore, a critical component of the network's infrastructure that every Bitcoin developer needs to be familiar with.
Each block in the Bitcoin blockchain consists of the block header, which contains metadata about the block and the transactions which compose the majority of the data in the block.
The block header always references the block hash of the previous block (the parent), thus forming a chain from the present block back to the first block mined in 2009 (the Genesis Block).
To review, see The Blockchain.

5d. Convert data between hex and base58 

  • What are the primary uses in Bitcoin for the following data formats: DER, hex, and base58

Hex and base58 data formats are primarily used to make the numbers used in Bitcoin more compact and easily readable by humans and prevent errors in transcription.
DER, or Distinguished Encoding Rules format, is needed for encoding the binary numbers that represent digital signatures with the precision required for accurately generating and verifying digital signatures.
To review, see Base58.

Unit 5 Vocabulary

This vocabulary list includes terms you will need to know to successfully complete the final exam.

  • base58 encoding
  • DER encoding
  • hexadecimal encoding