You are on page 1of 17

DEMO ON BLOCKCHAIN

ETHEREUM(SOLIDITY)
PROGRAMMING

BY RAJASEKHAR DINAVAHI
AGENDA

• BRIEF ABOUT TRAINER


• INTRODUCTION TO BLOCKCHAIN
• INTRODUCTION TO CRYPTOCURRENCIES
• SMART CONTRACTS
• SOLIDITY
BRIEF ABOUT TRAINER
SAP Sr Technical Consultant with 10+ years of
experience.

Organizations worked for:


I. Rockwell
Collins
II. Accenture
III. Satyam
Computers (Tech Mahindra)
IV. IBM
V. Intelligroup
(NTT DATA)

Technologies:
• Blockchain /
Solidity
• SAP UI5
INTRODUCTION TO BLOCKCHAIN

• Historically, when it comes to


transacting money or anything of
value, people and businesses have
relied heavily on intermediaries like
banks and governments to ensure
trust and certainty.
• Middlemen perform a range of
important tasks that help build trust
into the transactional process like
authentication & record keeping.
• Currently the system looks as below:
BLOCKCHAIN

• “Blockchain is a distributed, shared ledger.”


• A blockchain is a historical record of transactions, much like a database.
• Blocks in a chain = similar to pages in a book. Each page in a book contains:
1) The text: the story
2) page info: The title of the book, chapter title, page number etc (metadata)

Similarly, in a blockchain, each block has:


- A header which contains the data about the block: e.g. technical information, a
reference to the previous block, and a digital fingerprint (aka “hash”) of the data
contained in this block, among other things. This hash is important for ordering and
block validation.

- The contents of the block, e.g. information about the transaction(s)


• When a digital transaction is carried out, it is grouped
together in a cryptographically protected block with other
transactions that have occurred in the last 10 minutes and
sent out to the entire network. Miners (members in the
network with high levels of computing power) then
compete to validate the transactions by solving complex
coded problems. The first miner to solve the problems and
validate the block receives a reward. (In the Bitcoin
Blockchain network, for example, a miner would receive
Bitcoins).

• The validated block of transactions is then timestamped


and added to a chain in a linear, chronological order. New
blocks of validated transactions are linked to older blocks,
making a chain of blocks that show every transaction made
in the history of that blockchain. The entire chain is
continually updated so that every ledger in the network is
the same, giving each member the ability to prove who
owns what at any given time.
• Advantages of Blockchain:
Blockchain’s decentralized, open & cryptographic nature
allow people to trust each other and transact peer to peer,
making the need for intermediaries obsolete. This also brings
unprecedented security benefits. Hacking attacks that
commonly impact large centralized intermediaries like banks
would be virtually impossible to pull off on the blockchain.
For example — if someone wanted to hack into a particular
block in a blockchain, a hacker would not only need to hack
into that specific block, but all of the proceeding blocks going
back the entire history of that blockchain. And they would
need to do it on every ledger in the network, which could be
millions, simultaneously.
• Through Blockchain trust is established not by central intermediaries
but through consensus and complex computer code.

• Blockchain will profoundly disrupt hundreds of industries that rely on


intermediaries, including banking, finance, academia, real estate,
insurance, legal, health care and the public sector — amongst many
others.
BLOCKCHAIN USE CASES
• Smart Contracts
– Digitizing law; contractual instruments
– Execute commercial transactions and agreements automatically
• Smart Assets
– Trade finance, supply chain, workflow, rich data
• Clearing and Settlement
– Greater trade accuracy, and a shorter settlement process
– Short-term win with real cost savings
• Payment
– Reducing friction (time & cost) from the current framework ACH, SWIFT
– Speed up and simplify cross-border payments
SOME EXCITING NEWS/SUCCESS STORIES
INTRODUCTION TO CRYPTO CURRENCIES
INTRODUCTION TO ETHEREUM

• "Ethereum combines the power of decentralized transactions with Turing-complete


contracts!“
• Ethereum - a blockchain that can perform any computation as part of a
transaction.
• Ether - Although Ethereum brings general computations to the blockchain, it still
makes use of a "coin". Its coin is called "ether", and, as any coin, it is a number
that can be stored into account addresses and can be spent or received as part of
transactions or block generation. To run certain transactions, users must spend
Ether.
• A Turing-complete language is a language that, by definition, can perform any
computation. In other words, if there is an algorithm for something, it can express
it. Ethereum scripts, called smart contracts, can thus run any computation.
Computations are run as part of a transaction. This means each node in the
SMART CONTRACTS

• Smart contracts are the key element of Ethereum. In them any algorithm can be encoded.
Smart contracts can carry arbitrary state and can perform any arbitrary computations. They
are even able to call other smart contracts. This gives the scripting facilities of Ethereum
tremendous flexibility.
• A node can create a special transaction that assigns an address to a contract. This
transaction can also run code at the moment of creation. After this initial transaction, the
contract becomes forever a part of the blockchain and its address never changes.
Whenever a node wants to call any of the methods defined by the contract, it can send a
message to the address for the contract, specifying data as input and the method that
must be called. The contract will run as part of the creation of newer blocks up to the gas
limit or completion. Contract methods can return a value or store data. This data is part of
the state of the blockchain.
SOLIDITY

• Smart contracts run on the Ethereum Virtual Machine, which in turn runs on
each node. Though powerful, the Ethereum Virtual Machine works at a level
too low to be convenient to directly program (like most VMs). For this
reason, several languages for writing contracts have been developed. Of
these, the most popular one is Solidity.
• Solidity is a JavaScript-like language developed specifically for writing
Ethereum Smart Contracts. The Solidity compiler turns this code into
Ethereum Virtual Machine bytecode, which can then be sent to the
Ethereum network as a transaction to be given its own address.
OUR FIRST “HELLO WORLD”

• Let’s build our first “Hello world” Smart Contract in Solidity. [As we
learn any new language, we first try out with a simple program which
just displays a simple message (“Hello world”) as output.]

• Here we go….. Remix

You might also like