BST, Traversals, and Hashing Binary Tree

Total Page:16

File Type:pdf, Size:1020Kb

BST, Traversals, and Hashing Binary Tree BST, Traversals, and Hashing Binary Tree ● Specific type of tree ● Every node has 0, 1, or 2 children. Never any more ● Complete binary tree - all nodes except leaves have 2 children ○ Lots of great properties - we will talk about these more when we start to talk about heaps Introduction to Binary Search Tree • Binary Search Tree(BST) is an ADT that uses trees to store an ordered dynamic set of data • BST combines the flexibility of updates in linked list and the high efficiency of search(query) operations in ordered arrays • BST is used widely in computer software because of its efficiency 9/20/2015 3 Definition of BST • A BST is a binary tree in which root • All nodes has a comparable key, • Both left and right subtree are BSTs which satisfy that • Key in any node of the left subtree is less than that of root • Key in any node of the right subtree is larger than left right that of root subtre subtre e e 9/20/2015 4 Operations of BST • 9/20/2015 5 Data structure key size • BST used by the following algorithms are 2 3 left right represented by a set of nodes connected by pointer fields in the node, and each node contains key size key size 1 1 3 1 left right left right • A field recording the value of key NULL NULL NULL NULL • A size field recording the number of nodes in the subtree the node represents • Pointers to its left and right children • If some child does not exist, the relevant pointer is set to NULL 9/20/2015 6 Algorithms/Search • Using recursive strategy Algorithm BSTSearch(k, root) Input: a key k, and a BST represented by • According to property that left root node Output: if a node whose key is k exists, subtree < root < right subtree, return it; else return NULL at most one subtree is if root == NULL then searched and the other is return NULL else if root->key == k then skipped return root else if root->key > k then • The run time is at most return BSTSearch(k, root->left) else // root->key < k BST.height + 1 return BSTSearch(k, root->right) 9/20/2015 7 NUL L 11 < 17 size field is omitted in the diagram BSTSearch(11, t) t 17 5 11 > 5 19 2 10 11 > 10 18 22 1 4 9 16 11 < 16 20 21 3 7 15 11 < 15 6 8 11 11 == 11 13 12 14 9/20/2015 8 NUL L size field is omitted in the diagram BSTSearch(30, t) 30 > 17 t 17 30 > 19 5 19 30 > 22 2 10 18 22 1 4 9 16 20 3 7 15 21 6 8 11 13 12 14 9/20/2015 9 Algorithm BSTRank(k, root) Algorithms/Rank Input: a key k, and a BST represented by root node Output: if a node whose key is k exists, return the number of nodes whose keys are less than k; else return -1 • Similar to search operation, The node exists! if root == NULL The number of nodes because one subtree is skipped return -1 less than k is the size of in each invocation, the run its left subtree else if root->key == k then time is limited to BST.height + if root->left == NULL then 1 return 0 Start from the else left subtree all return root->left->size over again root->key > k else if then The number of nodes return BSTRank(k, root->left) less than k = sizeof(left subtree) + else // root->key < k root + sizeof(nodes rr = BSTRank(k, root->right) less than k in right if rr == -1 then subtree) return -1 else 9/20/2015 return root->size – root->right->size10 + rr Result:14 BSTRank(15, return BSTRank(15, t1) t0) 14 Example BSTRank(15, 17 > 15 size return t1->size - t1->right->size 22 NUL + BSTRank(15, t2) t1) 17 L 5 < 15 9 16 t0 5 BSTRank(15, 5 19 return t2->size - 10 < 15 t2->right->size + BSTRank(15, t2) 4 t1 11 1 3 t3) 2 10 18 22 4 16 > 15 BSTRank(15, 2 return BSTRank(15, t4) 1 2 4 t2 6 t3) 1 4 9 16 20 t3 4 3 5 1 1 21 BSTRank(15,3 7 15 return t4->left->size t4) t4 1 1 4 6 8 11 3 13 1 1 12 14 9/20/2015 11 Result:-1 return BSTRank(16, t1) BSTRank(16, t0) -1 BSTRank(16, Example return -1 23 > 16 size t1) 22 NUL -1 23 L BSTRank(16, 5 < 16 return -1 16 t0 5 t2) 5 25 -1 11 < 16 BSTRank(16,4 t1 11 1 3 return BSTRank(16, t4) 2 10 24 30 t3) 20 > 16 -1 1 2 4 t2 6 2 BSTRank(16,1 4 9 20 27 return -1 t4) 15 < 16 t3 3 5 1 -1 1 29 BSTRank(16,3 7 15 return -1 t5) t4 1 1 4 6 8 11 t5 3 13 1 1 12 14 9/20/2015 12 Insertion • Follow path, add in new node where needed • Build tree on board... Tree Traversals ● We often want to visit every single node in a tree ● While we are looking at BSTs today, these methods work for all trees 1. Preorder 2. Postorder 3. Inorder Preorder traversal void preorder(tree T, node n) { if(n == NULL) return else { print n.value; preorder(n.left); preorder(n.right); } } Postorder traversal void postorder(tree T, node n) { if(n == NULL) return else { postorder(n.left); postorder(n.right); print n.value; } } InOrder Traversal void inorder(tree T, node n) { if(n == NULL) return else { inorder(n.left); print n.value; inorder(n.right); } } Hashing Hashing ● In its simplest form, hashing is a “Mathematical blender” ● An input is passed in and some scrambled version comes out ● We usually want it to: ○ Generate uniformly random values ○ Be one-way ■ Open problem in CS - Do one way functions exist? (P = NP?) ○ Be collision resistant ■ Hard to find two things that hash to the same value ○ Quickly computable (Sometimes the opposite though!) ○ Deterministic (Doesn’t rely on randomness) Hash tables ● Wanting to look things up quickly is a very, very common problem ● We use hashing as a trick to make lookups very fast (on average) ● General idea: ○ When we store an item x in a table, we try to store it at index H(x). i.e. table[H(x)] = x; ○ To find something, start looking at index H(x) ○ We usually find things in O(1) time, which is great! Collisions ● Tricky to deal with - multiple solutions to consider ○ Linear Probing: If the cell is occupied, just traverse the array to find the next open one To search - have to traverse until we find the item or an empty cell ○ Quadratic probing: Similar to linear, but instead of going in order you check for the nth time you check the n2’th cell after it ○ Linked list - Just maintain a linked list at each cell ● Load factor = n/N = Average number of items per cell ● As long as the load factor is “OK” (depends on collision handling), we have O(1) insert and lookup time Cryptographic Hash Functions ● Hashing is very useful for cryptographic purposes ○ These hash functions require a lot of expert analysis. Never, ever, EVER try to write them yourself! (“Don’t roll your own crypto”) ● Used to store passwords, create digital signatures, check for corruption, verify files, etc… ● You’ll spend a good amount of time working with them in a few weeks Password Storage ● Password leaks are a problem Offline Attacks: A Common Problem • Password breaches at major companies have affected millions of users. Password storage ● Uses cryptographic hash functions ● Dont store (username, password) ● Don’t store(username, H(password)) ● Store (username, salt, H(salt + password)) Picking your function is important ● Lots of old functions still floating around ● They have been broken! ○ MD5 ○ SHA1 ● People will argue endlessly over what you should use. Memory Hard Hashing ● Very recent stuff ● Idea: Easy for adversaries to build machines to compute hashes fast ● BUT they don’t really have that advantage with memory ● Make the hash function take up memory in addition to time ● Adversary must now deal with memory delay Examples ● SCRYPT ○ Proven to be maximally memory hard ● Argon2 ○ Winner of Password Hashing Competition So how does hashing make this better? ● Instead of the passwords being leaked in plain format, all that shows is a garbage value ● Yahoo used a cryptographic hash function called BCRYPT ● Instead hashed records are leaked ● Requires a lot more work to find the user’s password - you must find a hash collision! ● (Unless you made your password “password”) Merkle Trees - Preview of next project ● You want to verify a very large file stored remotely ● Say, 1TB ● Method 1 - Check that the hash value is right ● But how do you know remote storage isnt lying to you? Merkle Tree ● Absurd to have to resend file to verify it is stored correctly ● What if we could verify it but just checking a few blocks? ● Merkle tree - Tree of hash values representing a file ● Root node can be reconstructed by requesting certain values from a server Merkle Trees P2 Preview ● You will be implementing a merkle tree and using it to verify files ● Some other work with hash functions as well.
Recommended publications
  • Angela: a Sparse, Distributed, and Highly Concurrent Merkle Tree
    Angela: A Sparse, Distributed, and Highly Concurrent Merkle Tree Janakirama Kalidhindi, Alex Kazorian, Aneesh Khera, Cibi Pari Abstract— Merkle trees allow for efficient and authen- with high query throughput. Any concurrency overhead ticated verification of data contents through hierarchical should not destroy the system’s performance when the cryptographic hashes. Because the contents of parent scale of the merkle tree is very large. nodes in the trees are the hashes of the children nodes, Outside of Key Transparency, this problem is gen- concurrency in merkle trees is a hard problem. The eralizable to other applications that have the need current standard for merkle tree updates is a naive locking of the entire tree as shown in Google’s merkle tree for efficient, authenticated data structures, such as the implementation, Trillian. We present Angela, a concur- Global Data Plane file system. rent and distributed sparse merkle tree implementation. As a result of these needs, we have developed a novel Angela is distributed using Ray onto Amazon EC2 algorithm for updating a batch of updates to a merkle clusters and uses Amazon Aurora to store and retrieve tree concurrently. Run locally on a MacBook Pro with state. Angela is motivated by Google Key Transparency a 2.2GHz Intel Core i7, 16GB of RAM, and an Intel and inspired by it’s underlying merkle tree, Trillian. Iris Pro1536 MB, we achieved a 2x speedup over the Like Trillian, Angela assumes that a large number of naive algorithm mentioned earlier. We expanded this its 2256 leaves are empty and publishes a new root after algorithm into a distributed merkle tree implementation, some amount of time.
    [Show full text]
  • Enabling Authentication of Sliding Window Queries on Streams
    Proof­Infused Streams: Enabling Authentication of Sliding Window Queries On Streams Feifei Li† Ke Yi‡ Marios Hadjieleftheriou‡ George Kollios† †Computer Science Department Boston University ‡AT&T Labs Inc. lifeifei, gkollios @cs.bu.edu yike, marioh @research.att.com { } { } ABSTRACT As computer systems are essential components of many crit- ical commercial services, the need for secure online transac- . tions is now becoming evident. The demand for such appli- cations, as the market grows, exceeds the capacity of individ- 0110..011 ual businesses to provide fast and reliable services, making Provider Servers outsourcing technologies a key player in alleviating issues Clients of scale. Consider a stock broker that needs to provide a real-time stock trading monitoring service to clients. Since Figure 1: The outsourced stream model. the cost of multicasting this information to a large audi- ence might become prohibitive, the broker could outsource providers, who would be in turn responsible for forwarding the stock feed to third-party providers, who are in turn re- the appropriate sub-feed to clients (see Figure 1). Evidently, sponsible for forwarding the appropriate sub-feed to clients. especially in critical applications, the integrity of the third- Evidently, in critical applications the integrity of the third- party should not be taken for granted, as the latter might party should not be taken for granted. In this work we study have malicious intent or might be temporarily compromised a variety of authentication algorithms for selection and ag- by other malicious entities. Deceiving clients can be at- gregation queries over sliding windows. Our algorithms en- tempted for gaining business advantage over the original able the end-users to prove that the results provided by the service provider, for competition purposes against impor- third-party are correct, i.e., equal to the results that would tant clients, or for easing the workload on the third-party have been computed by the original provider.
    [Show full text]
  • Providing Authentication and Integrity in Outsourced Databases Using Merkle Hash Tree’S
    Providing Authentication and Integrity in Outsourced Databases using Merkle Hash Tree's Einar Mykletun Maithili Narasimha University of California Irvine University of California Irvine [email protected] [email protected] Gene Tsudik University of California Irvine [email protected] 1 Introduction In this paper we intend to describe and summarize results relating to the use of authenticated data structures, specifically Merkle Hash Tree's, in the context of the Outsourced Database Model (ODB). In ODB, organizations outsource their data management needs to an external untrusted service provider. The service provider hosts clients' databases and offers seamless mechanisms to create, store, update and access (query) their databases. Due to the service provider being untrusted, it becomes imperative to provide means to ensure authenticity and integrity in the query replies returned by the provider to clients. It is therefore the goal of this paper to outline an applicable data structure that can support authenticated query replies from the service provider to the clients (who issue the queries). Merkle Hash Tree's (introduced in section 3) is such a data structure. 1.1 Outsourced Database Model (ODB) The outsourced database model (ODB) is an example of the well-known Client-Server model. In ODB, the Database Service Provider (also referred to as the Server) has the infrastructure required to host outsourced databases and provides efficient mechanisms for clients to create, store, update and query the database. The owner of the data is identified as the entity who has to access to add, remove, and modify tuples in the database. The owner and the client may or may not be the same entity.
    [Show full text]
  • Hash Functions
    Hash Functions A hash function is a function that maps data of arbitrary size to an integer of some fixed size. Example: Java's class Object declares function ob.hashCode() for ob an object. It's a hash function written in OO style, as are the next two examples. Java version 7 says that its value is its address in memory turned into an int. Example: For in an object of type Integer, in.hashCode() yields the int value that is wrapped in in. Example: Suppose we define a class Point with two fields x and y. For an object pt of type Point, we could define pt.hashCode() to yield the value of pt.x + pt.y. Hash functions are definitive indicators of inequality but only probabilistic indicators of equality —their values typically have smaller sizes than their inputs, so two different inputs may hash to the same number. If two different inputs should be considered “equal” (e.g. two different objects with the same field values), a hash function must re- spect that. Therefore, in Java, always override method hashCode()when overriding equals() (and vice-versa). Why do we need hash functions? Well, they are critical in (at least) three areas: (1) hashing, (2) computing checksums of files, and (3) areas requiring a high degree of information security, such as saving passwords. Below, we investigate the use of hash functions in these areas and discuss important properties hash functions should have. Hash functions in hash tables In the tutorial on hashing using chaining1, we introduced a hash table b to implement a set of some kind.
    [Show full text]
  • The SCADS Toolkit Nick Lanham, Jesse Trutna
    The SCADS Toolkit Nick Lanham, Jesse Trutna (it’s catching…) SCADS Overview SCADS is a scalable, non-relational datastore for highly concurrent, interactive workloads. Scale Independence - as new users join No changes to application Cost per user doesn’t increase Request latency doesn’t change Key Innovations 1. Performance safe query language 2. Declarative performance/consistency tradeoffs 3. Automatic scale up and down using machine learning Toolkit Motivation Investigated other open-source distributed key-value stores Cassandra, Hypertable, CouchDB Monolithic, opaque point solutions Make many decisions about how to architect the system a -prori Want set of components to rapidly explore the space of systems’ design Extensible components communicate over established APIs Understand the implications and performance bottlenecks of different designs SCADS Components Component Responsibilities Storage Layer Persist and serve data for a specified key responsibility Copy and sync data between storage nodes Data Placement Layer Assign node key responsibilities Manage replication and partition factors Provide clients with key to node mapping Provides mechanism for machine learning policies Client Library Hides client interaction with distributed storage system Provides higher-level constructs like indexes and query language Storage Layer Key-value store that supports range queries built on BDB API Record get(NameSpace ns, RecordKey key) list<Record> get_set (NameSpace ns, RecordSet rs ) bool put(NameSpace ns, Record rec) i32 count_set(NameSpace ns, RecordSet rs) bool set_responsibility_policy(NameSpace ns,RecordSet policy) RecordSet get_responsibility_policy(NameSpace ns) bool sync_set(NameSpace ns, RecordSet rs, Host h, ConflictPolicy policy) bool copy_set(NameSpace ns, RecordSet rs, Host h) bool remove_set(NameSpace ns, RecordSet rs) Storage Layer Storage Layer Storage Layer: Synchronize Replicas may diverge during network partitions (in order to preserve availability).
    [Show full text]
  • Authentication of Moving Range Queries
    Authentication of Moving Range Queries Duncan Yung Eric Lo Man Lung Yiu ∗ Department of Computing Hong Kong Polytechnic University {cskwyung, ericlo, csmlyiu}@comp.polyu.edu.hk ABSTRACT the user leaves the safe region, Thus, safe region is a powerful op- A moving range query continuously reports the query result (e.g., timization for significantly reducing the communication frequency restaurants) that are within radius r from a moving query point between the user and the service provider. (e.g., moving tourist). To minimize the communication cost with The query results and safe regions returned by LBS, however, the mobile clients, a service provider that evaluates moving range may not always be accurate. For instance, a hacker may infiltrate queries also returns a safe region that bounds the validity of query the LBS’s servers [25] so that results of queries all include a partic- results. However, an untrustworthy service provider may report in- ular location (e.g., the White House). Furthermore, the LBS may be correct safe regions to mobile clients. In this paper, we present effi- self-compromised and thus ranks sponsored facilities higher than cient techniques for authenticating the safe regions of moving range actual query result. The LBS may also return an overly large safe queries. We theoretically proved that our methods for authenticat- region to the clients for the sake of saving computing resources and ing moving range queries can minimize the data sent between the communication bandwidth [22, 16, 30]. On the other hand, the LBS service provider and the mobile clients. Extensive experiments are may opt to return overly small safe regions so that the clients have carried out using both real and synthetic datasets and results show to request new safe regions more frequently, if the LBS charges fee that our methods incur small communication costs and overhead.
    [Show full text]
  • Horner's Method: a Fast Method of Evaluating a Polynomial String Hash
    Olympiads in Informatics, 2013, Vol. 7, 90–100 90 2013 Vilnius University Where to Use and Ho not to Use Polynomial String Hashing Jaku' !(CHOCKI, $ak&' RADOSZEWSKI Faculty of Mathematics, Informatics and Mechanics, University of Warsaw Banacha 2, 02-097 Warsaw, oland e-mail: {pachoc$i,jrad}@mimuw.edu.pl Abstract. We discuss the usefulness of polynomial string hashing in programming competition tasks. We sho why se/eral common choices of parameters of a hash function can easily lead to a large number of collisions. We particularly concentrate on the case of hashing modulo the size of the integer type &sed for computation of fingerprints, that is, modulo a power of t o. We also gi/e examples of tasks in hich strin# hashing yields a solution much simpler than the solutions obtained using other known algorithms and data structures for string processing. Key words: programming contests, hashing on strings, task e/aluation. 1. Introduction Hash functions are &sed to map large data sets of elements of an arbitrary length 3the $eys4 to smaller data sets of elements of a 12ed length 3the fingerprints). The basic appli6 cation of hashing is efficient testin# of equality of %eys by comparin# their 1ngerprints. ( collision happens when two different %eys ha/e the same 1ngerprint. The ay in which collisions are handled is crucial in most applications of hashing. Hashing is particularly useful in construction of efficient practical algorithms. Here e focus on the case of the %eys 'ein# strings o/er an integer alphabetΣ= 0,1,...,A 1 . 5he elements ofΣ are called symbols.
    [Show full text]
  • Why Simple Hash Functions Work: Exploiting the Entropy in a Data Stream∗
    Why Simple Hash Functions Work: Exploiting the Entropy in a Data Stream¤ Michael Mitzenmachery Salil Vadhanz School of Engineering & Applied Sciences Harvard University Cambridge, MA 02138 fmichaelm,[email protected] http://eecs.harvard.edu/»fmichaelm,salilg October 12, 2007 Abstract Hashing is fundamental to many algorithms and data structures widely used in practice. For theoretical analysis of hashing, there have been two main approaches. First, one can assume that the hash function is truly random, mapping each data item independently and uniformly to the range. This idealized model is unrealistic because a truly random hash function requires an exponential number of bits to describe. Alternatively, one can provide rigorous bounds on performance when explicit families of hash functions are used, such as 2-universal or O(1)-wise independent families. For such families, performance guarantees are often noticeably weaker than for ideal hashing. In practice, however, it is commonly observed that simple hash functions, including 2- universal hash functions, perform as predicted by the idealized analysis for truly random hash functions. In this paper, we try to explain this phenomenon. We demonstrate that the strong performance of universal hash functions in practice can arise naturally from a combination of the randomness of the hash function and the data. Speci¯cally, following the large body of literature on random sources and randomness extraction, we model the data as coming from a \block source," whereby each new data item has some \entropy" given the previous ones. As long as the (Renyi) entropy per data item is su±ciently large, it turns out that the performance when choosing a hash function from a 2-universal family is essentially the same as for a truly random hash function.
    [Show full text]
  • CSC 344 – Algorithms and Complexity Why Search?
    CSC 344 – Algorithms and Complexity Lecture #5 – Searching Why Search? • Everyday life -We are always looking for something – in the yellow pages, universities, hairdressers • Computers can search for us • World wide web provides different searching mechanisms such as yahoo.com, bing.com, google.com • Spreadsheet – list of names – searching mechanism to find a name • Databases – use to search for a record • Searching thousands of records takes time the large number of comparisons slows the system Sequential Search • Best case? • Worst case? • Average case? Sequential Search int linearsearch(int x[], int n, int key) { int i; for (i = 0; i < n; i++) if (x[i] == key) return(i); return(-1); } Improved Sequential Search int linearsearch(int x[], int n, int key) { int i; //This assumes an ordered array for (i = 0; i < n && x[i] <= key; i++) if (x[i] == key) return(i); return(-1); } Binary Search (A Decrease and Conquer Algorithm) • Very efficient algorithm for searching in sorted array: – K vs A[0] . A[m] . A[n-1] • If K = A[m], stop (successful search); otherwise, continue searching by the same method in: – A[0..m-1] if K < A[m] – A[m+1..n-1] if K > A[m] Binary Search (A Decrease and Conquer Algorithm) l ← 0; r ← n-1 while l ≤ r do m ← (l+r)/2 if K = A[m] return m else if K < A[m] r ← m-1 else l ← m+1 return -1 Analysis of Binary Search • Time efficiency • Worst-case recurrence: – Cw (n) = 1 + Cw( n/2 ), Cw (1) = 1 solution: Cw(n) = log 2(n+1) 6 – This is VERY fast: e.g., Cw(10 ) = 20 • Optimal for searching a sorted array • Limitations: must be a sorted array (not linked list) binarySearch int binarySearch(int x[], int n, int key) { int low, high, mid; low = 0; high = n -1; while (low <= high) { mid = (low + high) / 2; if (x[mid] == key) return(mid); if (x[mid] > key) high = mid - 1; else low = mid + 1; } return(-1); } Searching Problem Problem: Given a (multi)set S of keys and a search key K, find an occurrence of K in S, if any.
    [Show full text]
  • 4 Hash Tables and Associative Arrays
    4 FREE Hash Tables and Associative Arrays If you want to get a book from the central library of the University of Karlsruhe, you have to order the book in advance. The library personnel fetch the book from the stacks and deliver it to a room with 100 shelves. You find your book on a shelf numbered with the last two digits of your library card. Why the last digits and not the leading digits? Probably because this distributes the books more evenly among the shelves. The library cards are numbered consecutively as students sign up, and the University of Karlsruhe was founded in 1825. Therefore, the students enrolled at the same time are likely to have the same leading digits in their card number, and only a few shelves would be in use if the leadingCOPY digits were used. The subject of this chapter is the robust and efficient implementation of the above “delivery shelf data structure”. In computer science, this data structure is known as a hash1 table. Hash tables are one implementation of associative arrays, or dictio- naries. The other implementation is the tree data structures which we shall study in Chap. 7. An associative array is an array with a potentially infinite or at least very large index set, out of which only a small number of indices are actually in use. For example, the potential indices may be all strings, and the indices in use may be all identifiers used in a particular C++ program.Or the potential indices may be all ways of placing chess pieces on a chess board, and the indices in use may be the place- ments required in the analysis of a particular game.
    [Show full text]
  • Executing Large Scale Processes in a Blockchain
    The current issue and full text archive of this journal is available on Emerald Insight at: www.emeraldinsight.com/2514-4774.htm JCMS 2,2 Executing large-scale processes in a blockchain Mahalingam Ramkumar Department of Computer Science and Engineering, Mississippi State University, 106 Starkville, Mississippi, USA Received 16 May 2018 Revised 16 May 2018 Abstract Accepted 1 September 2018 Purpose – The purpose of this paper is to examine the blockchain as a trusted computing platform. Understanding the strengths and limitations of this platform is essential to execute large-scale real-world applications in blockchains. Design/methodology/approach – This paper proposes several modifications to conventional blockchain networks to improve the scale and scope of applications. Findings – Simple modifications to cryptographic protocols for constructing blockchain ledgers, and digital signatures for authentication of transactions, are sufficient to realize a scalable blockchain platform. Originality/value – The original contributions of this paper are concrete steps to overcome limitations of current blockchain networks. Keywords Cryptography, Blockchain, Scalability, Transactions, Blockchain networks Paper type Research paper 1. Introduction A blockchain broadcast network (Bozic et al., 2016; Croman et al., 2016; Nakamoto, 2008; Wood, 2014) is a mechanism for creating a distributed, tamper-proof, append-only ledger. Every participant in the broadcast network maintains a copy, or some representation, of the ledger. Ledger entries are made by consensus on the states of a process “executed” on the blockchain. As an example, in the Bitcoin (Nakamoto, 2008) process: (1) Bitcoin transactions transfer Bitcoins from a wallet to one or more other wallets. (2) Bitcoins created by “mining” are added to the miner’s wallet.
    [Show full text]
  • IB Case Study Vocabulary a Local Economy Driven by Blockchain (2020) Websites
    IB Case Study Vocabulary A local economy driven by blockchain (2020) Websites Merkle Tree: https://blockonomi.com/merkle-tree/ Blockchain: https://unwttng.com/what-is-a-blockchain Mining: https://www.buybitcoinworldwide.com/mining/ Attacks on Cryptocurrencies: https://blockgeeks.com/guides/hypothetical-attacks-on-cryptocurrencies/ Bitcoin Transaction Life Cycle: https://ducmanhphan.github.io/2018-12-18-Transaction-pool-in- blockchain/#transaction-pool 51 % attack - a potential attack on a blockchain network, where a single entity or organization can control the majority of the hash rate, potentially causing a network disruption. In such a scenario, the attacker would have enough mining power to intentionally exclude or modify the ordering of transactions. Block - records, which together form a blockchain. ... Blocks hold all the records of valid cryptocurrency transactions. They are hashed and encoded into a hash tree or Merkle tree. In the world of cryptocurrencies, blocks are like ledger pages while the whole record-keeping book is the blockchain. A block is a file that stores unalterable data related to the network. Blockchain - a data structure that holds transactional records and while ensuring security, transparency, and decentralization. You can also think of it as a chain or records stored in the forms of blocks which are controlled by no single authority. Block header – main way of identifying a block in a blockchain is via its block header hash. The block hash is responsible for block identification within a blockchain. In short, each block on the blockchain is identified by its block header hash. Each block is uniquely identified by a hash number that is obtained by double hashing the block header with the SHA256 algorithm.
    [Show full text]