Leaderboard
Popular Content
Showing content with the highest reputation on 12/09/20 in all areas
-
There is no doubt about it that Blockchain has started exploding both as a topic and technology for a few years now. Maybe you are a professional who simply has seen the word blockchain too many times and want to learn it once and for all. Or maybe you are a blockchain enthusiast who wants to dive in deeper in understanding the internals of the blockchain ecosystem. In both cases, you came to the right article place! Here we will cover: How blockchain technology works What blockchain is used for and what industries use it What programming languages to use to build a blockchain What are the leading providers of blockchain technologies How to build a blockchain from the ground up (with code) How to learn more about blockchain If you want to learn any of these notions then keep reading! What is Blockchain and How Does it Work In a nutshell, blockchain is a piece of technology that ensures that transactions (e.g. paying for your groceries, a doctor visit, an artist signing a record label contract, etc.) are transparent in a securely decentralized fashion, so there is no longer a need for a central authority (such as a bank or government) to oversee or regulate it. Because blockchain is also built with privacy in mind, it is very difficult to alter or tamper with. In order to understand how blockchain does this and how it works, let’s envision the following example: Simple Blockchain Example Imagine that you and two other friends (let’s call them Friend 1 and Friend 2) are using a blockchain to update your shared expenses online. All three of you will have a file on your computers that automatically updates when you buy or sell an item, either from the internet or from each other. You buy some tickets to a concert, and when you do, your computer quickly updates your file and sends copies of your file to your friends. Once your friends receive those files, their computers quickly check if your transaction makes sense (e.g. did you have enough money to buy the tickets, and it is really you who is buying the tickets). If both friends agree that everything checks out, everyone updates their file to include your transaction. This cycle repeats for every transaction that either you or your friends make so that all three of your files are synced up, and there is no authority to oversee the process. There is of course a bit more nuance to it and gets very technical very quickly in understanding to build such a system from a programming perspective. If you want to understand how blockchain works in-depth, you can read the academic paper by Satoshi Nakamoto who created the first blockchain database Original blockchain paper by Satoshi Nakamoto (link) What is Blockchain Used For? Blockchain is quickly becoming very widespread where almost every industry is touched by this technology. For inspiration, here are just a handful of examples of how Blockchain is used today. Monetary Payments – Blockchain used in monetary transactions creates a more efficient and secure payment infrastructure. Global Commerce – Global supply chains are governed by blockchain technologies to ensure a more efficient transactional trade system. Capital Markets – Blockchain enables audit trails, quicker settlements, and operational improvements. Healthcare – Secondary health data that cannot identify an individual by itself can be placed on the blockchain which can then allow administrators to access such data without needing to worry about the data all being in one place which makes it very secure. Energy – Utility processes such as metering, billing, emission allowances, and renewable energy certificates all can be tracked via blockchain transactions in one decentralized place. Media – Media companies use blockchain to protect IP rights, eliminate fraud, and reduce costs. Voting – The notion of each vote being in a decentralized blockchain solves the problem of elections being hacked or tampered with. Cybersecurity – Blockchain solutions in the security space ensure that there is no single point of failure, and it also provides privacy as well as end-to-end encryption. Other real-life examples exist in Regulatory Compliance and Auditing, Insurance, Peer-to-Peer Transactions, Real Estate, Record Management, Identity Management, Taxes, Finance Accounting, Big Data, Data Storage, and IoT among many others. What are the Most Popular Types of Cryptocurrency? Bitcoin – The cryptocurrency that started it all. It was started in 2009, and follows closely to the original Satoshi Nakamoto cryptocurrency paper referenced earlier. It is mostly used for monetary transactions. Litecoin – Crated in 2011 as an alternative to Bitcoin. Litecoin is a little faster than Bitcoin, has a larger limit and, operates on different algorithms. Ethereum – Ethereum was created in 2015 and is also focusing on decentralized applications with smart contracts instead of just monetary transactions. This way different transactions outside of monetary exchange can happen, such as digital trading cards, or IoT activations on a smart-grid network. Ripple – A cryptocurrency that is not blockchain-based. However, it is often used by companies to move large amounts of money quickly across the globe. For a more extensive list, check out these resources. An ever-growing list of cryptocurrencies on Wikipedia (link) Understanding The Different Types of Cryptocurrency by SoFi (link) Types of Cryptocurrency Explained by Equity Trust (link) What are the Best Programming Languages to Develop Blockchain? C++ – Best if you need to build a blockchain from scratch or change some low-level internals of how blockchain works. Solidity – Best if you are set on using the Ethereum Blockchain framework and platform. Python – Best if you want to bring blockchain to general-purpose apps, especially in Data Science. JavaScript – Best if you want to build a blockchain for the web. Java – Best if you want to build a general, and large-scale object-oriented application. There are, however, blockchain developments in almost all programming languages, so pick the one you’re most comfortable with or is required for the project. What are the Leading Providers of Blockchain Technologies Coinbase – A very secure and free API that supports many different cryptocurrencies such as bitcoin and ethereum, and also supports different blockchain transactions such as generating digital wallets, getting real-time prices, and crypto exchanges. Use it if you want to create blockchain apps cost-effectively. Bitcore – Another free and speedy option with many different blockchain transactions possible. Use it if you want to build very fast blockchain applications with quick transaction times. Blockchain – The oldest and most popular blockchain framework. It has a large developer community and low timeouts. Use it if you need to implement blockchain wallet transactions. For a more extensive list check out the following resources. Top 10 Best Blockchain APIs: Coinbase, Bitcoin, and more (link) How to Choose the Best Blockchain API for Your Project by Jelvix (link) How to Learn More About Blockchain The fastest way to learn about blockchain is to first take a course, and then start building one yourself. If you’re also serious about blockchain and want to learn it continuously, you should subscribe to some blockchain newsletters. Here are some links to the courses. Look for the ones with the highest ratings and popularity: [Top 10] Best Blockchain Courses to learn in 2020 (link) 10 Best Blockchain Courses and Certification in 2020 (link) Also, if you want to build a blockchain, check out this well-sourced Quora post. Furthermore, here is a list of good newsletters to learn more about blockchain from your inbox! How to Build a Blockchain, a Brief Introduction (With Code) Let’s build a simple blockchain so that we can understand some of the more subtle nuances of one. The most important inner workings of a blockchain are the following. The chain itself which stores transactional information, a way to mine new possible slots in the chain, the proof of work that identifies if the chain is valid, and a consensus algorithm that can allow nodes or computers to vote whether the chain is valid. The code will label these important notions as #CHAIN step, #MINING step, #POW step, and #CONSENSUS step respectively to trace back to these notions. Note that there is an important aspect of the proof of work. The proof of identifying if a new block is valid should very easily be verified; however, it should be very hard to create from scratch (mining a new block). This property is important because it allows us to easily validate if a blockchain is not tampered with, and prevents hackers from re-creating a blockchain easily (it becomes immutable). We will build all these things below. Pay close attention to the comments as they explain the purpose of each component. Also, note that some functions, such as (is_valid_proof_pattern, get_blockchain, block_matches_proof, etc.) have yet to be implemented to keep this post short, so just imagine that they exist and that they do what they are supposed to do. Note: that the code below is not an exact replica of a blockchain. Instead it is a simplified representation which can be used for inspiration/intuition and not for rigorous implementation of a blockchain. Blockchain Server Code """ Blockchain Server Code On the blockchain server is where we store the main implementation of the blockchain. The clients (or apps such as your banking app) would hit a server like this as they create new transactions and store them on the blockchain, or as miners try to mine new blocks. The classes and code below represents the code that sits on the blockchain server. """ # Imports from datetime import datetime # Generates unique timestamps import hashlib # Used for hasing our blocks # Classes class Transaction(): """ A given monetary transaction. Example: Joe pays Amy 10 mBTC. """ __init__(self, frm, to, amount): self.frm = frm self.to = to self.amount = amount class Block(): """ A block on the blockchain containing blockchain transactions. Note that every block has a hash that is associated to previous blocks. """ __init__(self, index, previous_hash, proof_of_work, timestamp, transactions): self.index = index self.previous_hash = previous_hash self.proof_of_work = proof_of_work self.timestamp = timestamp self.transactions = transactions class Blockchain(): """ The blockchain containing various blocks that build on each other as well as methods to add and mine new blocks. (# CHAIN step) """ __init__(self): self.blocks = [] self.all_transactions = [] # Every blockchain starts with a genesis first block genesis_block = new Block( index=1, previous_hash=0, proof_of_work=None, timestamp=datetime.utcnow(), transactions=self.all_transactions ) self.add_block(genesis_block) @staticmethod def add_block(block): """Adds a new block to the blockchain. Args: block (Block class): A new block for the blockchain. Returns: None """ self.blocks.append(block) @staticmethod def add_new_transaction(transaction): """Adds a new transaction to the blockchain. Args: transaction (Transaction class): A new transaction for the blockchain Returns: None """ self.all_transactions.append(transaction) @staticmethod def get_full_chain(): """Returns all the blockchain blocks. Returns: all_blocks (List[Block class]): All the blocks in the blockchain. """ all_blocks = self.blocks return all_blocks @staticmethod def get_last_block(): """Gets the last block in the blockchain. Returns: last_block (Block class): The last block in the blockchain. """ last_block = None if self.blocks: last_block = self.blocks[-1] return last_block @staticmethod def hash(block): """Computes a hashed version of a block and returns it. Args: block (Block class): A block in the blockchain. Returns: hashed_block (str): A hash of the block. """ stringified_block = json.dumps( block, sort_keys=True ).encode() hashed_block = hashlib.sha256( stringified_block ).hexdigest() return hashed_block @staticmethod def mine_new_block(possibilities): """An attempt to mine a new block in the blockchain. (# MINING step) Args: possibilities (List[Possibility class]): All possibilities for mining that the miners compute/create. Returns: reward (str): A reward for the miners if they succeed. """ last_block = self.get_last_block() # Go through many possible proofs, which is equivalent to # using computational power, to find the new block. for possibility in possibilities: mining_success = False previous_hash = self.hash(last_block) possible_proof = hashlib.sha256( possibility ).hexdigest() # We imagine this method exists (# POW step) if is_valid_proof_pattern(possible_proof, previous_hash): # Our possible proof was correct, so miner was # able to mine a new block! # Forge the new Block by adding it to the chain index = last_block.index + 1 proof_of_work = possible_proof timestamp = timestamp.utcnow() transactions = self.all_transactions new_block = new Block( index, previous_hash, proof_of_work, timestamp, transactions ) self.add_block(new_block) # The mining was a success, we stop mining mining_success = True break # Give reward to miner if mining was a success reward = '0 mBTC' if mining_success: reward = '0.1 mBTC' # The reward can be anything return reward In short, the server code contains a blockchain which contains blocks and transactions. Miners can use computational power to mine new blocks and as an incentive for doing so, they get rewarded. Consumers can add transactions to the blockchain (e.g. you pay a friend back for lunch) and that transaction will then live on the blockchain. The blockchain is really then a chain of transactions that have the property of being tied to one another and able to be verified if that tie is correct or not. Client Code Accessing The Blockchain """ Client Code Accessing The Blockchain The client or blockchain application that gets API requests for new transactions. It primarily interacts with the blockchain server from above, but has some internal helper functions to store the new transactions. Note that there could be dozens if not thousands of these clients that do the same things as decentralized transactions are written to the blockchain. Imagine an app like Apple Pay where everyone is paying each other, client connections like these would register the transactions on the blockchain. Below are the client helper functions and code. """ # Functions def check_consensus(all_nodes, our_blockchain): """Compares our blockchain with blockchains from other nodes in the network, and attempts to find the longest valid blockchain, and returns it. (# CONSENSUS step) Args: all_nodes (List[Node class]): All nodes in the network. our_blockchain (Blockchain class): Our blockchain. Returns: longest_valid_blockchain (Blockchain class): The longest valid blockchain. """ longest_valid_blockchain = our_blockchain longest_blockchain_len = len( our_blockchain.get_full_chain() ) for node in all_nodes: # Imagine the get_blockchain method exists on the node node_blockchain = node.get_blockchain() is_valid_chain = True for block in node_blockchain.get_full_chain(): # Imagine the block_matches_proof method exists if not block_matches_proof(block): is_valid_chain = False break current_blockchain_len = len( node_blockchain.get_full_chain() ) if (is_valid_chain and current_blockchain_len > longest_blockchain_len): longest_valid_blockchain = node_blockchain longest_blockchain_len = len( node_blockchain.get_full_chain() ) return longest_valid_blockchain def get_other_nodes_in_network(): """ Returns all nodes, or servers/computers in the network. Code not written here as it is application dependent. """ return all_nodes def get_our_stored_blockchain(): """ Retrieves the current blockchain on our node or server. Code not written here as it is application dependent. """ return our_blockchain def set_our_stored_blockchain(new_blockchain): """ Sets the current blockchain on our node or server. Code not written here as it is application dependent. """ return status # Now let's say that Joe wants to pay Amy 10 mBTC and # the client prepares this transaction to write it # to the blockchain. This is roughly what happens below. # We first prepare the transaction frm = 'Joe' to = 'Amy' amount = '10 mBTC' new_transaction = new Transaction(frm, to, amount) # Then we get the longest valid blockchain we can write our # new transaction to. our_blockchain = get_our_stored_blockchain() all_nodes = get_other_nodes_in_network() longest_valid_blockchain = check_consensus( all_nodes, our_blockchain ) if our_blockchain != longest_valid_blockchain: # We have an out of date or invalid blockchain # so we update our blockchain as well. set_our_stored_blockchain(longest_valid_blockchain) our_blockchain = get_our_stored_blockchain() # Now that we have the current up-to-date blockchain # we simply write our new transaction to our blockchain. our_blockchain.add_new_transaction(new_transaction) All the client code needs to do is to make sure that the blockchain it is working with is up to date by checking the consensus between all the nodes (or servers) in the blockchain network. After the client code has the proper and up to date blockchain, a new transaction can be written. Code That Miners Use """ Code That Miners Use The miners also leverage the blockchain server from above. The role of the miners is to come up with compute possibilities to create new blocks using compute power. They first retrieve the most current blockchain, and then try to mine a new block via calling the following methods, and getting rewarded in the process if they are successful. """ # Code for the generate_possibilities function is application # dependent. possibilities = generate_possibilities() reward = current_blockchain.mine_new_block(possibilities) As the miners keep mining new blocks, the blockchain grows and more transactions can be stored on the blockchain. With understanding the server, client, and miner parts of the blockchain lifecycle you should have a good understanding of different components of a blockchain. There are also more intricacies to a blockchain than the components covered here, such as the details of the proof of work, how transactions are stored, hashed, and regulated, double spending, the verification process, and much more. Taking a course is one of the best ways to understand these nuances. Below are some resources to other simple blockchain implementations if you’re curious. Learn Blockchains by Building One (link) Simple Blockchain in 5 Minutes [Video] In Conclusion Well, there you have it, a good primer on this new technology that is dawning upon us. I hope that by understanding blockchain high-level and by diving deeper into the links provided, you can become proficient with blockchain in no time! Source2 points
-
Kev e in lumea lui. Din ce spui tu aici ti-ar cam trebui drepturi de admin la instalare. Nu stiu daca ai drepturi de administrator pe CARBON. Posibil Helium sa fie admin - motiv pentru care cere user si parola de Helium. Daca mai ai intrebari ... lemme know.1 point
-
Fain! Doar un aspect care cred eu ca merita comentat. Nu-mi place in descriere fraza de genul "Cum sa faci un blockchain". Pentru mine suna similar a: "cum sa faci un internet". Blockchain nu e o chestie "fizica" care sa fie programata, downloadata etc. Blockchainul e un design/ o specificatie. Practic un set de reguli de comunicare, verificare, validare, accesibilitate etc. De aia in opinia mea cel mai bun limbaj sa creezi un blockchain e engleza, intr-o specificatie. (folosesti uml, why3, etc.) Desigur dupa ce ai specificatiile blockchainului trebuie sa implementezi un client. (in orice limbaj de programare vrei tu) Poti sa faci client java pt android/ios, Miner pe GPU etc.1 point
-
tare video-ul Eu m-am jucat cu contuarele de apa si curent super fun ce am avut.1 point
-
Facebook Messenger for Android has an issue where an SdpUpdate message can cause an audio call to connect before the callee has answered the call. Facebook Messenger sets up audio and video calls in WebRTC by exchanging a series of thrift messages between the callee and caller. Normally, the callee does not transmit audio until the user has consented to accept the call, which is implemented by either not calling setLocalDescription until the callee has clicked the accept button, or setting the audio and video media descriptions in the local SDP to inactive and updating them when the user clicks the button (which strategy is used depends on how many endpoints the callee is logged into Facebook on). However, there is a message type that is not used for call set-up, SdpUpdate, that causes setLocalDescription to be called immediately. If this message is sent to the callee device while it is ringing, it will cause it to start transmitting audio immediately, which could allow an attacker to monitor the callee's surroundings. To reproduce this issue: 1) Log into Facebook Messenger on the attacker device 2) Log into Facebook Messenger on the target device. Also log into Facebook in a browser on the same account. (This will guarantee call set-up uses the delayed calls to setLocalDescription strategy, this PoC doesn't work with the other strategy) 3) install frida on the attacker device, and run Frida server 4) make a call to any device with the attacker device to load the RTC libraries so the can be hooked with Frida 5) unzip sdp_update, and locally in the folder, run: python2 modifyout.py \"attacker device name\" (to get a list of devices, run python2 modifyout.py) 6) make an audio call to the target device In a few seconds, audio from the target devices can be heard through the speakers of the attacker device. The PoC performs the following steps: 1) Waits for the offer to be sent, and saves the sdpThrift field from the offer 2) Sends an SdpUpdate message with this sdpThift to the target 3) Sends a fake SdpAnswer message to the *attacker* so the device thinks the call has been answered and plays the incoming audio The python for the PoC was generated using fbthrift, the thrift file used for generation is attached. This PoC was tested on version 284.0.0.16.119 of Facebook Messenger for Android. This bug is subject to a 90 day disclosure deadline. After 90 days elapse, the bug report will become visible to the public. The scheduled disclosure date is 2021-01-04. Disclosure at an earlier date is possible if agreed upon by all parties. Found by: rschoen@google.com Download GS20201207145742.tgz (70.1 KB) Source0 points
-
fi mai explicit, cum adica opium, carbon, si baloane? Nu am accesat link-ul (Nu este indexat in Google). Din ce am observat Samsung Google este un soft pentru Phone Unblock.0 points
-
Some Practice Problems for the C++ Exam and Solutions for the Problems The problems below are not intended to teach you how to program in C++. You should not attempt them until you believe you have mastered all the topics on the "Checklist" in the document entitled "Computer Science C++ Exam". There are 39 problems. The solutions for the problems are given at the end, after the statement of problem 39. Download: C101-PracticeProblems.pdf Source0 points
-
Salut, ulterior am votat, cabinele de votare erau ocupate, doar un spatiu disponibil stanga<->dreapta aveau stikere (selfie). Mi-a fost smuls buletinul de vot, nu voiau sa-mi recuperez actul de identitate. Ce este de facut in acest moment? Pentru alegerile parlamentare?0 points
-
Tu faci off-topic aiurea ai aproximativ 1k posturi si 75 aprecieri Am postat in off-topic, am intrebat. Se pot face si on-line.0 points
-
Diggy is an incredibly powerful, beautiful, easy to use notebook with the SciPy stack preinstalled that works right in your browser without relying on server-side code. Surely, it's free. Our mission is to create the most powerful learning platform accessible to everyone. We are confident that teachers, students, and scientists deserve a better platform. Whether you are researching for an academic essay, a professional report or just for fun, Diggy lets you bring out the best in your data analytics, prepare gorgeous visualization in just about any way you can imagine. And thanks to its intuitive and accessible design, Diggy is delightfully easy to use — whether you’re just starting out with data analysis or you’re a seasoned pro. Our goal is to make coding magnitudes easier, which we believe will allow millions of people to learn and start using Python in daily life. Learn more Diggy Notebook Diggy, like Jupyter is a computational environment that is made up of small blocks called cells. Together they form a notebook. Reactive Programming Diggy is reactive. Meaning that it doesn’t run cells from top to bottom, instead Diggy maintains a special data structure called direct acyclic graph (DAG) that calculates the execution order. When you change a variable, Diggy automatically re-evaluates all its dependencies. Thus, there’s no hidden, no mutable state. It’s always up-to-date, you don’t have to restart & run all cells to make sure that all cells are aligned. Python 3 Diggy runs Python 3. In fact, it runs CPython which is a reference implementation of the Python programming language. No server-side All Diggy notebooks could be edited, written and executed entirely in your browser. There’s no server-side component to execute your code. Therefore, your code could react to user interaction within milli- and nanoseconds. Simplicity in mind There’s only one kind of cell. All cells in Diggy contain Python code; for example, if you need to render a markdown or HTML, there’re special helper functions. The result of evaluation is always based on cell’s type. Secure The browser sandbox lets you run Python code safely, it won’t be able to open a file in your file system or open a TCP socket. Try it out Source0 points
-
Ceva de genul, mi-au dat 5 buletine de vot in selectiile anterioare, iar unul mi-a fost smuls din maini de catre supravechetor.0 points
-
0 points
-
Mama cate suruburi sunt tipul din clip, poarta bratari din silicon anti-electroliza0 points