Você está na página 1de 22

1.

ORACLE – BASICS OF CONTRAT LAW


An oracle, in the context of blockchains and smart contracts, is an agent that finds and verifies
real-world occurrences and submits this information to a blockchain to be used by smart
contracts.
Smart contracts contain value and only unlock that value if certain pre-defined conditions are
met. When a particular value is reached, the smart contract changes its state and executes the
programmatically predefined algorithms, automatically triggering an event on the blockchain. The
primary task of oracles is to provide these values to the smart contract in a secure and trusted
manner.
Blockchains cannot access data outside their network. An oracle is a data feed – provided by
third party service – designed for use in smart contracts on the blockchain. Oracles provide
external data and trigger smart contract executions when pre-defined conditions meet. Such
condition could be any data like weather temperature, successful payment, price fluctuations,
etc.
Oracles are part of multi-signature contracts where for example the original trustees sign a
contract for future release of funds only if certain conditions are met. Before any funds get
released an oracle has to sign the smart contract as well.

Source: smartcontract.com
Types of oracles

There are different types of oracles based on the type of use. We differentiate between software
oracles, hardware oracles, consensus oracles and inbound and outbound oracles.

 Software Oracles
Software oracles handle information available online. An example could be the temperature,
prices of commodities and goods, flight or train delays, etc. The data originates from online
sources, like company websites. The software oracle extracts the needed information and
pushes it into the smart contract.
 Hardware Oracles
Some smart contracts need information directly from the physical world, for example, a car
crossing a barrier where movement sensors must detect the vehicle and send the data to a smart
contract. Another use case is RFID sensors in the supply chain industry. The biggest challenge
for hardware oracles is the ability to report readings without sacrificing data security..Oracalize
proposes a two-step solution to the risks, by providing cryptographic evidence of the sensor’s
readings and anti-tampering mechanisms rendering the device inoperable in the case of a
breach.
 Inbound Oracles
These provide the smart contract with data from the external world. Example use case will be an
automatic buy order if the USD hits a certain price.
 Outbound Oracles
These provide smart contracts with the ability to send data to the outside world. An example
would be a smart lock in the physical world which receives a payment on its blockchain address
and needs to unlock automatically.
 Consensus Based Oracles
Prediction markets like Augur and Gnosis rely heavily on oracles to confirm future outcomes.
Using only one source of information could be risky and unreliable. To avoid market manipulation
prediction market implement a rating system for oracles. For further security, a combination of
different oracles may be used, where for example 3 out of 5 oracles could determine the
outcome of an event.

Security Challenges

Oracles are third party services which are not part of the blockchain consensus mechanism.
The main challenge with oracles is that people need to trust these sources of information.
Whether a website or a sensor, the source of information needs to be trustworthy. Different
trusted computing techniques can be used as a way of solving these issues. Companies
like ,Oracalize for example, have been leveraging Amazon with the TLS Notary-based
proofs. Town Crier, another company, is focusing on the utilization of the Intel Software
Guard Extensions (SGX). Providing smart contracts with trusted information sources is
crucial for the users because in case of mistakes there are no rollbacks.

2.SMART CONTRACT AND THEIR POTENTIAL TRUST IN


ALGORITHM
A smart contract is similar to a contract in the physical world, but it’s digital and is represented by
a tiny computer program stored inside a blockchain. More specifically, a smart contract is a piece
of software that stores rules for negotiating the terms of an agreement, automatically verifies
fulfillment, and then executes the agreed terms.

The main idea of smart contract is since a smart contract removes reliance on a third party when
establishing business relations, the parties making an agreement can transact directly with each
other. Consider the example of a crowdfunding platform where product teams share their
projects and collect money from supporters until a goal is reached.

If such a platform is centralized – like Kickstarter, for instance – then it acts as a third party
between product teams and supporters who donate their money. This means both sides need to
trust Kickstarter and, in fact, pay an additional fee to Kickstarter to serve as an intermediary.

A smart contract, alternatively, can perform the same crowdfunding actions – sharing projects,
setting goals, and collecting donations – but without a third party. Simply put, we can program a
smart contract to execute all of these actions.

More precisely, we can program a smart contract to receive funds until a goal is reached. If the
project gets fully funded before the deadline, the money raised automatically goes to the product
team. If the project fails, the money automatically goes back to supporters.
Since a smart contract is stored inside a blockchain where all data is stored in a distributed
manner, no one is in control of the money. In a decentralized business model, smart contracts
replace any other trusted third party.

To Trust a Smart Contract

Smart contracts are designed and implemented within blockchains, and therefore they inherit

some of the blockchain’s properties:

 They’re immutable, which means a smart contract can never be changed and no one
can tamper with or break a contract.

 They’re distributed, which means that the outcome of the contract is validated by
everyone in the network, just like any transaction on a blockchain. Distribution makes it
impossible for an attacker to force control to release funds, as all other participants would
detect such an attempt and mark it as invalid.

Smart Contract Working

A smart contract is a program, or more simply put, code. The code behind a smart contract
contains specific terms that are executed when triggered by specific agreed events.

Let's consider an example of how a smart contract might work if Alice is renting an apartment in
Los Angeles and Bob from New York is looking to rent an apartment for his journey there.

A Logically Behaved Algorithm

Typically, Alice and Bob would use some platform that unites hosts and guests to agree on
renting. This kind of platform would serve as a third party and would certainly take responsibility
for compliance with the agreed terms. However, both Alice and Bob would be charged a fee by
the platform. Besides, if either of them failed to fulfill their commitment, dispute resolution may be
time-consuming and require a detailed review.
If Alice and Bob instead make an agreement using a smart contract, the smart contract will
behave logically based on its algorithm and will guarantee that all the agreed terms and
conditions are fulfilled. Immutability, which is in the DNA of a smart contract, won’t let Alice or
Bob cheat.Thus, the following terms and events can be set out in a smart contract between Alice
and Bob:

1. Independent storage is created, where both Alice and Bob can put value but can’t
easily take out.

2. Bob puts money for rent in storage.

3. Alice puts the address and the code to her apartment in storage.

4. Alice gets payment confirmation and Bob receives the address and apartment code.

5. If Bob comes to LA and the address and code provided by Alice are right, Alice gets
the payment.

6. If it appears that the address or code supplied by Alice are wrong, Bob gets his money
back.

7. If Bob doesn’t come to LA, Alice gets her liquidated damages payment and Bob gets
the rest of what he paid.

8. At the end of the agreement, the smart contract is considered fulfilled and remains
stored in the blockchain network.
This set of conditions and events represents the most basic one-time smart contract. Setting up
terms in the code of a smart contract ensures satisfactory fulfillment.

Overall contract fulfillment is guaranteed by the blockchain technology itself, as a complete copy
of the blockchain is publicly stored by all network participants and the smart contract remains
immutable.

The Logic of the One-Size-Fits-All Smart Contract

Once Alice generates a smart contract that automatically and transparently works for her when
renting out her apartment to Bob, she might think about creating a universal agreement for all
further renters so she doesn’t need to create a new smart contract for each new guest.

With this universal agreement, anyone on the blockchain network can rent Alice’s apartment by
following the algorithm above: the potential guest transfers rent payment, gets the address and
apartment code, and then Alice gets her payment if everything works according to the contract
terms for both sides.

Moreover, smart contracts can be even more universal. We could program a smart contract to be
used not only by Alice but by any person who wants to rent out his or her flat. And certainly,
smart contracts can contain more specific conditions, such as automatically adjusted prices,
discounts, partial payments, and nearly any other imaginable option.
Blockchain Networks Using Smart Contracts

Much has been said about smart contracts in relation to blockchain technology. While there are
plenty of examples of smart contracts implemented within different blockchain networks and
projects, the most notable remain Bitcoin and Ethereum.

Bitcoin

Though Bitcoin is mostly known for transactions of the Bitcoin cryptocurrency, its protocol can
also be used to create smart contracts. Bitcoin provides a programming language that allows for
custom smart contracts like multi signature accounts, payment channels, escrows, and time
locks. In particular, there’s a separate smart contract platform called RootStock built on Bitcoin’s
blockchain.

Ethereum

Ethereum is the most prominent smart contract framework, created and designed especially to
support smart contracts. This framework, programmed in the Solidity language, is a
decentralized platform that runs smart contracts without any possibility of downtime, censorship,
fraud, or third-party interference. The Ethereum blockchain database stores transactions
between people, transactions involving smart contracts, and their source code.

Smart Contract Benefits

Explicit programming algorithms in core and blockchain properties like decentralization,


transparency, fraud resistance, and others make smart contracts a credible alternative for
establishing business relations and performing transactions.

As an alternative to traditional contracts with a central business model, here are the benefits that
smart contracts offer businesses:

 Direct dealings with customers. Smart contracts remove the need for intermediaries
and allow for transparent, direct relationships with customers.

 Resistance to failure. Since businesses aren’t dependent on a third party, no single


person or entity is in control of data or money. Decentralization means that even if any
individual leaves the blockchain network, the network will continue to function with no
loss of data or integrity.

 More trust. Business agreements are automatically executed and enforced. Plus, these
agreements are immutable and therefore unbreakable.
 Fraud reduction. Since smart contracts are stored in a distributed blockchain network,
their outcome is validated by everyone in that network. Therefore, no one can force
control to release other people’s funds or data, as all other blockchain participants would
spot this and mark such an attempt as invalid.

 Cost efficiency. Eliminating intermediaries removes additional fees, allowing businesses


and their customers not only to interact and transact directly but also to do so with low to
no fees for transactions.

 Record keeping. All contract transactions are stored in chronological order in the
blockchain and can be accessed along with the complete audit trail.

Smart Contract Use Cases

Smart contracts are gaining popularity and have already been implemented in various blockchain
projects. Here are just several promising examples of smart contract implementations in different
industries.

Banking

Banking might be the primary industry where smart contracts appear to be the most significant
alternative to the traditional model of transactions. Smart contracts make payments as well as
loans, and nearly all others financial operations literally automated.

KYC-Chain implements smart contracts for individuals, businesses, and financial institutions. In
the core of KYC-Chain are mechanisms allowing clients to comply with regulatory norms, such
as automatic smart checks, as well as to share pertinent documents and get them digitally
attested by notaries and institutions.

Healthcare

Smart contracts can also improve healthcare. They can streamline processes for insurance trials,
increase access to cross-institutional data, and boost confidence in patient privacy.
Authentication, authorization, and identity confirmation remain open issues for smart contracts
executed on blockchain networks. An example of smart contracts in the healthcare industry
is Dentacoin. Dentacoin aims to bring patients and dentists together in communities to improve
dental care and make it affordable worldwide.

Supply Chain

Another area where smart contracts can provide real-time visibility is supply chains. Smart
contracts ensure granular inventory tracking, benefitting supply chain financing as well as
reducing the risk of theft and fraud.

Smart contracts can effectively be used regardless of marketplace type or goods sold. For
example, Name Bazaar is implementing smart contract technology within a peer-to-peer
marketplace where users can exchange cryptographic assets on the blockchain in the form of
domains.

Legal Issues

The traditional model of resolving legal issues and certifying documents is also giving way to
smart contracts. Smart contracts eliminate the need for notarization, offering not only an
automated and unbiased but also a cost-efficient solution.

Real Estate

For instance, FOAM is a stock market for real estate that uses technology to let users make
property transactions, get financing and funding, and manage leases.

Government

It might be most interesting to investigate the potential impact of decentralization technologies on


monopolistic spheres, especially government systems.

Australian company Horizon State is working to provide voting and other tools to help the
democratic process. Particularly, Horizon State intends to offer a blockchain-based voting
ecosystem that supports secure, cost-effective campaign operations for a range of election types
and voting parameters. The primary goal of Horizon State is to enable transparent, unbiased
voting in countries around the world.

Internet of Things Networks

There are areas where smart contracts intersect with other technologies, and the Internet of
Things (IoT) is one of them. A combination of smart contracts and IoT is powerful and can enable
significant transformations across industries, paving the way for new distributed applications.
Oaken provides autonomous IoT hardware and software coupled with blockchain technology.
Altogether, these components make it possible to use Oaknen with nearly any device to build an
IoT network and therefore apply it to various real-life needs.

Final thoughts

Unlike the traditional centralized business model, smart contracts foster a new kind of business
relationship built on trust.

By inheriting blockchain properties, smart contracts offer immutability and distributed storage,
which is what distinguishes them most from traditional agreements. Immutability and distributed
storage allow smart contracts to become a credible means for making business agreements and
performing transactions.

Blockchain technology is already impacting businesses. Of course, it is hard – or even


impossible – to revolutionize the way industries operate with the snap of a finger. Significant
changes take time. However, successful and promising use cases for the blockchain and smart
contract technologies in particular are laying the groundwork for the future of business.

3.INTEGRATION WITH EXISTING LEGAL SYSTEM

The Emer platform claims to offer Digital proof-of-ownership to merchants who are looking for
both scalably and to transparently store records of both digital and physical assets on the
blockchain.

From a resolution of land title disputes between law offices to licensing associated with anything
from streaming video services to anti-virus software subscription, the Emer platform claims the
ability to manage these processes. In addition, the verification of these records is much simpler
to access and complete using the Emer platform as all records are kept securely and accurately
on the blockchain. This can lower costs and the time spent both from a customer perspective and
from a lawyer’s perspective, removing the need to deal with physical documents to complete
routine transactions.

4.OPEN LAW
OpenLaw is a blockchain-based protocol for the creation and execution of legal agreements. Our
aim is to comprehensively stitch together traditional legal agreements with blockchain-based
smart contracts in a user-friendly (through our markup language) and legally compliant manner.
Using OpenLaw, users can more efficiently engage in transactional work and digitally sign and
store legal agreements in a highly secure manner, all while leveraging next generation blockchain-
based smart contracts.

Prerequisites

1. You have an OpenLaw account. If you don’t already have one, you can sign up for a free

account at OpenLaw.io.

2. You have some experience developing smart contracts using the Solidity programming
language.

3. You have the tooling in place to develop smart contracts, such as Meta Maskor the Mist
Wallet and understand how to develop code locally or via an online development tool such
as Remix.

Creating a Legally Enforceable Contract with Open Law’s Markup Language

In Open Law, the first step is to create (or reuse) a legally enforceable contract. A contract is
created by first writing a template. Templates contain natural language, such as legal terms and
conditions of the agreement between the parties, as well as markup tags. Open Law uses
common, well-known markup tag syntax as well as some special tags, which are specific to our
protocol. Once the template has been defined, a draft of the contract can be sent to the parties to
electronically sign the contract. Evidence of the signature and the agreement will be memorialized
on the blockchain once executed.

Start with a Blank Document


Normally, contract professionals start with an example and then tailor it to meet the needs of the
parties. In this tutorial, however, we will start from scratch to show you how to construct a template
using the powerful Open Law mark up language.

Interacting with the Ethereum Blockchain

Contracts developed on the Open Law platform can also interact with Ethereum-based
blockchains. They do this through smart contracts. Smart contracts are small programs deployed
on the blockchain at an Ethereum address which can transfer digital assets (i.e., crypto, property,
etc.) among many other uses. Open Law is able to interact with smart contracts via function calls
at those addresses using the same mark up language we used to document the legal terms
between the parties.
5.APPLICATION OF CRYPTOGRAPHY TO BLOCKCHAIN

Cryptography is the method of disguising and revealing, otherwise known as encrypting and
decrypting, information through complex mathematics. This means that the information can only
be viewed by the intended recipients and nobody else. The method involves taking unencrypted
data, such as a piece of text, and encrypting it using a mathematical algorithm, known as
a cipher. This produces a ciphertext, a piece of information that is completely useless and
nonsensical until it is decrypted. This method of encryption is known as symmetric-key
cryptography.

An early example of cryptography was the Caesar cipher, used by Julius Caesar to protect
Roman military secrets. Each letter in a messages was substituted with the letter 3 spaces to the
left in the alphabet, this knowledge was essentially the key that encrypted the message. Caesar’s
generals knew that to decode the letters they only had to shift each to the right by three, whilst
the information remained safe if intercepted by Caesar’s enemies. Modern cryptography works
on a similar concept, albeit with far greater levels of complexity.

The code base for most ciphers are open source projects, meaning their code can be examined
by anyone. The most widely used cipher in the world called is AES and is free for anyone to use.
The AES libraries, that are implementing the algorithm, are open to viewing by the public and
have been fully investigated over a five year period. As a result, it has been studied in
considerable detail and to date no vulnerabilities have been discovered. So much so, that the
cipher is also used by the NSA, the United States intelligence agency, as the tool of choice for
encrypting information.

Blockchain technology utilizes cryptography as a means of ensuring transactions are done


safely, while securing all information and storages of value. Therefore, anyone using blockchain
can have complete confidence that once something is recorded on a blockchain, it is done so
legitimately and in a manner that preserves security.

Despite being founded upon a similar framework, the type of cryptography used in blockchain,
namely public-key cryptography, is considerably better suited to the functions associated with the
technology than symmetric-key cryptography.
Public-Key Cryptography

Public-key cryptography, also known as asymmetric cryptography, represents an improvement


on standard symmetric-key cryptography as it allows information to be transferred through a
public key that can be shared with anyone.

Rather than using a single key for encryption and decryption, as is the case with symmetric key
cryptography, separate keys (a public key and a private key) are used.

A combination of a users public key and private key encrypt the information, whereas the
recipients private key and sender's public key decrypt it. It is impossible to work out what the
private key is based on the public key. Therefore, a user can send their public key to anyone
without worrying that someone will gain access to their private key. The sender can encrypt files
that they can be sure will only be decrypted by the intended party.
Furthermore, through public-key cryptography a digital signature is produced, securing the
integrity of the data that is being shown. This is done by combining a user's’ private key with the
data that they wish to sign, through a mathematical algorithm.

Since the actual data itself is part of the digital signature, the network will not recognize it as valid
if any part of it is tampered with. Editing even the slightest aspect of the data reshapes the whole
signature, making it false and obsolete. Through this, blockchain technology is capable of
guaranteeing that any data being recorded onto it is true, accurate and untampered with. Digital
signatures are what give the data recorded on a blockchain its immutability.

6.USING HASH FUNCTION TO CHAIN BLOCKS

The reliability and integrity of blockchain is rooted in there being no chance of any fraudulent
data or transactions, such as a double spend, being accepted or recorded. A cornerstone of the
technology as a whole and the key components in maintaining this reliability is hashing.

Hashing is the process of taking an input of any length and turning it into a cryptographic fixed
output through a mathematical algorithm (Bitcoin uses SHA-256, for example). Examples of such
inputs can include a short piece of information such as a message or a huge cache of varying
pieces of information such as a block of transactions or even all of the information contained on
the internet.
Securing Data with Hashing

Hashing drastically increases the security of the data. Anyone who may be trying to decrypt the
data by looking at the hash will not be able to work out the length of the encrypted information
based on the hash. A cryptographic hash function needs to have several crucial qualities to be
considered useful, these include:

Impossible to produce the same hash value for differing inputs:


This is important because if it were not the case it would be impossible to keep track of the
authenticity of inputs.

The same message will always produce the same hash value:
The importance of this is similar to the prior point.

Quick to produce a hash for any given message:


The system would not be efficient or provide value otherwise.

Impossible to determine input based on hash value:


This is one of the foremost aspects and qualities of hashing and securing data.

Even the slightest change to an input completely alters the hash:


This is also a matter of a security. If a slight change only made a slight difference it would be
considerably easier to work out what the input was. The better and more complex the hashing
algorithm, the larger the impact of changing an input will be on what the output is.

Hashing secures data by providing certainty that it hasn’t been tampered with before being seen
by the intended recipient. So, as an example, if you downloaded a file containing sensitive
information, you could run it through a hashing algorithm, calculate the hash of that data and
compare it to the one shown by whoever sent you the data. If the hashes don’t match, you can
be certain that the file was altered before you received it.
Blockchain Hashing

In blockchain, hashes are used to represent the current state of the world, or to be more precise,
the state of a blockchain. As such, the input represents everything that has happened on a
blockchain, so every single transaction up to that point, combined with the new data that is being
added. What this means is that the output is based on, and therefore shaped by, all previous
transactions that have occurred on a blockchain.

As mentioned, the slightest change to any part of the input results in a huge change to the
output; in this lies the irrefutable security of blockchain technology. Changing any record that has
previously happened on a blockchain would change all the hashes, making them false and
obsolete. This becomes impossible when the transparent nature of blockchain is taken into
account, as these changes would need to be done in plain sight of the whole network.

The first block of a blockchain, known as a genesis block, contains its transactions that, when
combined and validated, produce a unique hash. This hash and all the new transactions that are
being processed are then used as input to create a brand new hash that is used in the next block
in the chain. This means that each block links back to its previous block through its hash, forming
a chain back to the genesis block, hence the name blockchain. In this way, transactions can be
added securely as long as the nodes on the network are in consensus on what the hash should
be.

Data Structure

Data structures are a specialized way of storing data. The two foremost hashing objects carrying
out this function are pointers and linked lists. Pointers store addresses as variables and as such
point to the locations of other variables. Linked lists are a sequence of blocks connected to one
another through pointers. As such, the variable in each pointer is the address of the next node,
with the last node having no pointer and the pointer in the first block, the genesis block, actually
lying outside of the block itself. At its simplest, a blockchain is simply a linked list of recorded
transactions pointing back to one another through hash pointers.

Hash pointers are where blockchain sets itself apart in terms of certainty as pointers not only
contain the address of the previous block, but also the hash data of that block too. As described
earlier, this is the foundation of the secure nature of blockchain. For example, if a hacker wanted
to attack the ninth block in a chain and change its data, he would have to alter the data in all
following blocks, as their hash would also change. In essence, this makes it impossible to alter
any data that is recorded on a blockchain.

Hashing is of the core fundamentals and foremost aspects of the immutable and defining
potential of blockchain technology. It preserves the authenticity of the data that is recorded and
viewed, and as such, the integrity of a blockchain as a whole. It is one of the more technical
aspect of the technology, however understanding it is a solid step in understanding how
blockchain functions and the immeasurable potential and value that it has.

Merkle Tree

A merkle tree, otherwise called a hash tree, is a data structure of hashes used to record data
onto a blockchain in a secure and efficient manner. The concept was patented by Ralph Merkle
in 1979.

The system works by running a block of transactions through an algorithm to generate a hash as
a means of verifying the validity of that data based on the original transactions. An entire block of
transactions is not run through a hash function at once, but rather each transaction is hashed,
with those transactions being linked and hashed together. Eventually, this creates one hash for
the entire block.

When visualized, the structure resembles that of a tree, albeit in a simplified manner as each
block will normally contain hundreds, if not thousands, of transactions. Hashes on the bottom row
are known as ‘leaves’, while middle hashes are referred to as ‘branches’ with the hash at the top
being the ‘root’.

Merkle trees are especially useful as they allow anyone to confirm the validity of an individual
transaction without having to download a whole blockchain. For instance, as long as you have
the root hash (12345678), you can easily confirm transaction (8) by accounting for the hashes
(7), (56) and (1234). As long as they are all there on a blockchain, transaction (8) is surely there
and as such accounted for and as a result true, and meant to be there.
The Hash of the merkle root is normally contained in a block header along with:

 Hash of the previous block


 Timestamp
 Nonce
 The block version number
 The current difficulty target

Merkle trees and hashes are a key component in allowing blockchain technology to function
whilst providing security, integrity and irrefutability and, alongside consensus protocols, are
arguably the most important aspects of blockchain technology.

7.DIGITAL SIGNATURES TO SIGN TRANSACTION

Digital signatures, like real signatures, are a way to prove that somebody is who they say they
are, except that we use cryptography or math, which is more secure than handwritten signatures
that can be easily forged. A digital signature is a way to prove that a message originates from a
specific person and no one else, like a hacker.

Digital signatures are used today all over the Internet. Whenever you visit a website over
ACTPS, you are using SSL, which uses digital signatures to establish trust between you and the
server. This means that when you visit Facebook.com, your browser can check the digital
signature that came with the web page to verify that it indeed originated from Facebook and not
some hacker.

In asymmetric encryption systems, users generate something called a key pair, which is a public
key and a private key using some known algorithm. The public key and private key are
associated with each other through some mathematical relationship. The public key is meant to
be distributed publicly to serve as an address to receive messages from other users, like an IP
address or home address. The private key is meant to be kept secret and is used to digitally sign
messages sent to other users. The signature is included in the message so that the recipient can
verify using the sender’s public key. This way, the recipient can be sure that only the sender
could have sent this message. Generating a key pair is analogous to creating an account on the
blockchain, but without having to actually register anywhere. Pretty cool. Also, every transaction
that is executed on the blockchain is digitally signed by the sender using their private key. This
signature ensures that only the owner of the account can move money out of the account.

To bring it all together, blockchain could not exist without hashing and digital signatures. Hashing
provides a way for everyone on the blockchain to agree on the current world state, while digital
signatures provide a way to ensure that all transactions are only made by the rightful owners. We
rely on these two properties to ensure that the blockchain has not been corrupted or
compromised.

8.USING HASH FUNCTION FOR PROOF OF WORK


A proof of work is a piece of data which is difficult (costly, time-consuming) to produce but easy
for others to verify and which satisfies certain requirements. Producing a proof of work can be a
random process with low probability so that a lot of trial and error is required on average before a
valid proof of work is generated. Bitcoin uses the Hash cash proof of work system.

One application of this idea is using Hash cash as a method to preventing email spam, requiring
a proof of work on the email's contents (including the to address), on every email. Legitimate
emails will be able to do the work to generate the proof easily (not much work is required for a
single email), but mass spam emailers will have difficulty generating the required proofs (which
would require huge computational resources).

Hash cash proofs of work are used in Bitcoin for block generation. In order for a block to be
accepted by network participants, miners must complete a proof of work which covers all of the
data in the block. The difficulty of this work is adjusted so as to limit the rate at which new blocks
can be generated by the network to one every 10 minutes. Due to the very low probability of
successful generation, this makes it unpredictable which worker computer in the network will be
able to generate the next block.

For a block to be valid it must hash to a value less than the current target; this means that each
block indicates that work has been done generating it. Each block contains the hash of the
preceding block, thus each block has a chain of blocks that together contain a large amount of
work. Changing a block (which can only be done by making a new block containing the same
predecessor) requires regenerating all successors and redoing the work they contain. This
protects the block chain from tampering.
9.EXAMPLES OF IMPLEMENTATION WITH THEIR
TRADEOFFS
Sidechains, state channels and off-chain messaging are all ways to further sequester data from
the main blockchain. They differ in the extent to which the blockchain is retained as a definitive
record. In systems like JPMorgan’s Quorum, private messages are relayed off-chain while their
cryptographic fingerprints, or hashes, are included in the blockchain as verification that the
events occurred.

Hashes are a one-way scrambling function; if all you have is the hash, a random-looking string of
numbers, it should be unbearably time-consuming to figure out the original data, but that data will
instantly produce the same hash every time. Even the tiniest modification to the data will
completely change the hash, as shown in the table below:

Input data Hash using SHA-256 algorithm

The quick brown fox


jumps over the lazy d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
dog

The quick fox jumps


over the 109d51daea4988dbbcf10113bd7de272d5df5af1739844f4e3a0fb0f4b4567db
lazy brown dog

The quick fox jumps


over the lazy brown 90894b449198193133b3acd96561d61d677e48fe760071e0277ea70b900bf5c1
dog.

No one shall be
subjected to arbitrary
interference with his 57fda799521f01c9f1a2c320cd37dc1e2882790ba59729ee7357e5b236736871
privacy, family, home
or correspondence,
nor to attacks upon
his honour and
reputation. Everyone
has the right to the
protection of the law
against such
interference or
attacks.

No one shall be
subjected to arbitrary
interference with his
privacy, family, home
or correspondence,
nor to attacks upon
his e4998f47c86fb13f4107729ae2a589b857c867f0b8093b562250316c8bef65d5
honour or reputation.
Everyone has the
right to the protection
of the law against
such interference or
attacks.

Sidechains and state channels allow parties to conduct transactions on parallel, privately
controlled, chains with assets that are represented, and therefore reconcilable, on a more public
chain.

While solving many of the privacy concerns, these off-chain approaches abandon one of the
main features of open blockchain technology, which is the resilience that comes from having the
same data duplicated on multiple computers.

“Because blockchains are a distributed technology, it means that you don’t have a single point of
failure,” said Jack Gavigan, the lead author of the R3 study and another Zcash founder. “For
example, if Facebook goes down, you can’t access Facebook. But if a single blockchain node
goes down, that doesn’t mean you can’t access the blockchain. It just means that you end up
connecting to a different node.”

When transactions occur off the main, universally shared blockchain, they do not benefit from
this key feature.

Você também pode gostar