Here is a suggested learning path for getting started with blockchain and smart contracts development:
1. Learn the fundamentals of blockchain technology - how it works, key components, types of blockchains.
2. Understand cryptography basics - hashes, digital signatures, public/private key encryption.
3. Learn the Solidity programming language for writing Ethereum smart contracts.
4. Build simple smart contracts and deploy them to testnets.
5. Learn how to develop decentralized applications (dApps) using smart contracts.
6. Explore blockchain development platforms like Ethereum, Hyperledger, etc.
7. Learn frontend libraries like Web3.js for interacting with blockchains.
8.
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Introduction to Solidity and Smart Contract Development (9).pptx
1. INTRODUCTION TO SOLIDITY
AND SMART CONTRACT
DEVELOPMENT
Gene Leybzon
Blockchain Applications and
Smart Contracts Meetup
2/2/2023
2. DISCLAIMER
§ The views and opinions expressed by the Presenter are those of the Presenter.
§ Presentation is not intended as legal or financial advice and may not be used as
legal or financial advice.
§ Every effort has been made to assure this information is up-to-date as of the date
of publication.
4. has property
Blockchain
Records transactions across a network of computers
Decentralized Digital Ledger
Ledger is composed of a chain of blocks, where each block contains a number of
transactions
Chain of Blocks
The transactions are grouped together and added to the chain in a linear, chronological
order and once added, the information in the block cannot be altered or deleted
Records are Immutable
Cryptography is used to secure the information stored in the blocks, and enables secure
transfer of digital assets and information
Cryptographic Security
Blockchain
“Blockchain is a digital ledger that keeps a record of all
transactions across a network of computers.”
composed of
is
is based on
5. Block N-2 Block N-1 Block N Block N+1 Block N+2 Block N+3 ...
Blockchain
Blockchain from the technical point of view
Block N
Block N Header
Block N Transactions
Hash(Block N-1 header)
Hash of (Block N
transactions) Hash()
Block N-1
Block N Header
Block N-1 Transactions
Hash(Block N-2 header)
Hash of (Block N-1
transactions)
Hash()
Hash()
7. Blockchain Technology Choices
Ethereum is the standard for
smart contracts and
blockchain based finance
applications
Ethereum Virtual Machine (EVM) is the
runtime environment for transaction
execution in Ethereum-like networks
EVM-based
Custom Blockchain
solutions based on open-
source code
Tendermint- and similar consensus-based
solutions. Polkadot and Cosmos
parachains. Substrate framework for use
case-optimized blockchains
Custom
Foundation for enterprise-
grade blockchain software
projects
Hyperledger technologies are open source
code bases built with collaborative design
and governance, enterprises have
embraced them as trusted infrastructure
for building blockchain utions.
Hyperledger
8. Ether (ETH)
Ether is the native
cryptocurrency of the Ethereum
network. It is used to pay for
transactions and smart contract
execution, and it is also used as
a form of payment for gas.
Solidity
Solidity is the primary
programming language used
for writing smart contracts on
the Ethereum network. It is a
contract-oriented, high-level
language for implementing
smart contracts.
SMART
CONTRACTS
These are self-executing contracts with
the terms of the agreements directly
written into lines of code. Smart
contracts are used to facilitate, verify,
and enforce the negotiation or
performance of a contract.
Ethereum Virtual
Machine (EVM)
EVM is the runtime environment for
smart contracts in Ethereum. It is a
virtual machine that executes the
code of smart contracts on the
Ethereum network.
Ethereum Blockchain
“Ethereum is a blockchain with a computer embedded in it. It is the foundation for
building apps and organizations in a decentralized, permissionless, censorship-
resistant way.”
9. Ethereum Gas
“Ethereum gas is a unit of measurement for the computational effort required to
execute transactions on the Ethereum blockchain.”
Gas prices in Ethereum are dynamic and
determined by market demand. When the
demand for gas is high, the gas price
increases, and when demand is low, the
gas price decreases.
Gas is required for every transaction and
smart contract execution on the
Ethereum network, and is used to pay for
the computational resources consumed
by the nodes that validate and execute
the transactions. The amount of gas
required for a transaction or smart
contract execution is dependent on the
complexity of the operation
ADD .... 3
MUL .... 5
SUB .... 3
DIV .... 5
MOD .... 5
ADDMOD . 8
MULMOD . 8
10. EVM Compatible Blockchains
Some of the blockchain networks that use the EVM and are able to interact
with the Ethereum ecosystem through smart contracts
11. Traditional Architecture Decentralized l Architecture
Decentralized Application and Smart Contracts
Web
Server
Database
Decentralized
Application
Blockchain
Smart Contract
12. Benefits of Decentralized Applications
1
Once data is recorded on a blockchain, it cannot be altered, which provides a high
level of trust and security.
Immutability
2
Decentralized blockchains do not rely on a central authority, which reduces the
risk of censorship or control.
Decentralization
3
Blockchain technology allows for a high degree of transparency, as all
transactions are recorded on a public ledger that is accessible to anyone.
Transparency
4
Blockchain technology allows for the creation of smart contracts which can
automate the execution of agreements without the need for intermediaries.
Uses Smart Contracts
13. Exemplary Blockchain Development Tools
Wallet and key
management
Code
Development
SDKs and
APIs
Explorer and
Analytics
Security
Interoperability
and cross-
chain
Decentralized
App
Development
14. Smart Contract Development and Deployment
1
Design
Design the contract,
including defining its
structure, state
variables, functions,
and events
Code Writing
Implementing the
functions, events,
and conditions
defined in the design
step
2
Compilation
Solidity code
compiled into
bytecode that can
be deployed on the
blockchain.
3
Deployment
Compiled code get
deployed on the
blockchain and
make it available to
the network
4
Testing
Performing various
tests on the contract,
including unit tests
integration tests,
security tests
5
Maintenance
Monitoring
performance and
detecting abnormal
usage
6
15. Solidity Language
Solidity is a high-level, contract-oriented programming language that is used for
writing smart contracts on the Ethereum -compatible blockchain
● Solidity developed specifically for the Ethereum platform and is influenced by
C++, Python, and JavaScript.
● Solidity is designed to provide a simple and secure way to create self-executing
contracts that enforce the rules and conditions of an agreement between parties
● Solidity contracts are executed on the Ethereum Virtual Machine, which is built
into the Ethereum blockchain and allow developers to create decentralized
applications and automate the transfer of digital assets based on the conditions
encoded in the contract.
● Supports features such as multiple inheritance, user-defined types, events,
modifiers which makes it possible to write complex, feature-rich smart contracts
16. Examples of Smart Contracts
A smart contract is a computer program that automatically executes the terms of a contract
when certain conditions are met.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Hello {
function sayHello() public pure
returns (string memory) {
return 'Hello World!';
}
}
pragma solidity >=0.7.0 <0.9.0;
contract Count {
uint public value = 0;
event Changed(
uint _value
);
function plus() public returns (uint) {
value++;
emit Changed(value);
return value;
}
}
https://github.com/leybzon/solidity-baby-steps/blob/master/contracts/00_hello.sol
https://github.com/leybzon/solidity-baby-steps/blob/master/contracts/03_count.sol
18. Blockchain Explorer
Allows users to search and view detailed
information about blocks, transactions,
and addresses on the Ethereum network
Users can verify and call smart contracts
on the Ethereum network
Tracks the movement and distribution of
Ethereum-based tokens
Provides real-time network statistics and
charts on various metrics such as hash
rate, gas usage, and active addresses
Offers various analytics tools for
Ethereum network data analysis, such as
rich list, token holders, and top contracts
24. ChatGPT3 generated Solidity Code
pragma solidity ^0.8.0;
contract MeetupGold {
string public name = "Meetup Gold";
string public symbol = “MG";
uint256 public totalSupply = 1000000000000000000000;
uint256 public decimals = 18;
mapping(address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() public {
balanceOf[msg.sender] = totalSupply;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(balanceOf[msg.sender] >= _value && _value > 0, "Insufficient balance");
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
}
25. Blockchain Research Areas
1. Decentralized finance (DeFi): The development of decentralized financial applications on blockchain
platforms such as Ethereum.
2. Scalability: Improving the speed, capacity, and efficiency of blockchain networks to handle increasing
numbers of users and transactions.
3. Privacy and Confidentiality: Research into ways to enhance the privacy and confidentiality of data stored
on blockchains.
4. Interoperability: Developing solutions that allow different blockchain networks to communicate and
interact with each other.
5. Regulation: Studying the impact of regulatory frameworks on the adoption and development of
blockchain technology.
6. Blockchain for Supply Chain Management: The integration of blockchain technology into supply chain
management systems to improve transparency and efficiency.
7. Energy Efficiency: Research into ways to make blockchain more energy-efficient, particularly for proof-
of-work consensus algorithms.
8. Identity Management: The use of blockchain technology for secure and efficient identity management.
9. Security: Further research into the security of blockchain networks, including the prevention of hacking
attacks and the protection of user data.
26. Blockchain and Smart Contracts Learning Path
1. Fundamentals of Blockchain Technology: Start by learning the basics of blockchain technology, including how it works, its
key components, and the different types of blockchain networks. Study the history of blockchain, its potential applications,
and its current status.
2. Cryptography: Study the basics of cryptography, including symmetric and asymmetric encryption, hashes, and digital
signatures. Understanding cryptography is crucial for building secure blockchain systems.
3. Solidity and Smart Contracts: Study Solidity, the programming language used for writing smart contracts on the Ethereum
platform. Learn how to write, deploy, and execute smart contracts.
4. Decentralized Applications (dApps): Study the design and development of decentralized applications (dApps) on blockchain
platforms. Learn about the key components of dApps, such as smart contracts, consensus algorithms, and storage
solutions.
5. Blockchain Development Platforms: Study popular blockchain development platforms, such as Ethereum, EOS, and
Hyperledger. Learn how to use these platforms to build decentralized applications.
6. Web3.js: Study the Web3.js library, which is used to interact with blockchain networks from web applications. Learn how to
send transactions, retrieve data, and interact with smart contracts using Web3.js.
7. Cryptocurrency: Study cryptocurrency and the different types of tokens that exist, including utility tokens, security tokens,
and stablecoins. Learn how cryptocurrencies can be used in decentralized applications.
8. Blockchain Security: Study the security aspects of blockchain technology, including the prevention of hacking attacks, the
protection of user data, and the mitigation of security risks.
9. Project Work: Work on building a decentralized application using blockchain technology. This could be a simple smart
contract or a more complex dApp.
10. Stay up-to-date with the latest developments: Keep up-to-date with the latest developments in blockchain technology by
attending meetups, workshops, and conferences, and by following key players in the industry.