SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Ethereum Blockchain
dengan Python
asofyan@python.or.id
Apa Blockchain?
•  Cryptographically	Secure		
seluruh	transaksinya	diamankan	dengan	kriptografi	
•  Transaction	Singleton	Machine			
Ada	satu	‘mesin’	yang	dipercaya	memproses	seluruh	transaksi	
•  With	Shared	State			
‘state’	mesin	terakhir	dibagi	dan	terbuka	bagi	semua	orang
Crypto Currency
Proof	of	work	(PoW)	sederhana
Apa Ethereum?
•  Diusulkan	2014,	oleh	Vitalik	Buterin,	Gavin	Wood,	dan	
Jefrey	Wickle	
•  Distributed	Computing	Platform	
•  Sistem	operasi	
•  Open	Source	
•  Public	
•  Berbasis	Blockchain	
•  Dengan	fitur	utama	smart	contract
Block	1	 Block	2	
Block	3	
Smart	
Contract	
Ethereum	Node	1	
Block	1	 Block	2	
Block	3	
Smart	
Contract	
Ethereum	Node	2	
Ethereum	Node	4	
Ethereum	Node	n..	
Block	
1	
Block	
2	
Block	3	
Smart	
Contract	
Ethereum	Node	1	
Block	
1	
Block	
2	
Block	3	
Smart	Contract	
Ethereum	Node	2	
Ethereum	Node	4	
Ethereum	Node	n..	
Rinkeby	Test	Network	
Private	Network	
Block	
1	
Block	
2	
Block	3	
Smart	
Contract	
Ethereum	Node	1	
Block	
1	
Block	
2	
Block	3	
Smart	Contract	
Ethereum	Node	2	
Ethereum	Node	4	
Ethereum	Node	n..	
Ethereum Networks
Metropolis	Live	Network	
EVM	 EVM	
EVM	
EVM	
EVM	 EVM
Rinkeby Test Network
Smart Contract
•  Di	atur	oleh	private	key	
•  Tidak	punya	code/seperangkat	fungsi	
•  Bisa	insiasi	transaksi	sendiri	
Contract	Account	
•  Di	atur	oleh	code	di	dalam	contract	
•  Punya	code/seperangkat	fungsi	
•  Tidak	bisa	inisiasi	sendiri,	harus	
ditrigger	dari	Owned	Account
Smart Contract 2
Block	1	 Block	2	
Block	3	
Smart	
Contract	
Ethereum	Node	
Smart	
Contract	
Code	
Compile	to	Evm	
Byte	Code	
Web	3	Interface	
Distributed	App	(Dapp)	
Default	Tools	&	Interface	
EVM
Python Stack di Ethereum
No	 App	 Go/JS	 Python	
1	 Node	Client	 geth,	parity	 py-geth,	pyethapp	
2	 RPC	API	 Web3	 web3.py	
3	 Smart	Contract	Framework	 Truffle	 Populus	
4	 Test	RPC	Node	 Ganache-cli	 Eth-testrpc	
5	 EVM	 Go-ethereum	 Pyethereum,	Py-evm	
6	 Smart	Contract	Language	 Solidity	 Serpent
Contoh Py-Geth
*	hanya	untuk	initiate	ethereum	node,	lewat	subprocess	memanggil	geth
Contoh eth-testrpc + web3
Node	siap	di	localhost:8545	
Transfer	ether,	tanpa	mining
Smart
Contracts
Implementasi Hybrid
•  Kontrak	dibuat	dalam	solidity,	kompilasi	dengan	solc	(atau	py-solc	wrapper	jika	dibutuhkan)	–	dengan	
memanfaatkan	seluruh	ekosistem	yang	ada	seperti	remix,	truffle,	zeppelin	dll.	
•  Akses	dan	manipulasi	via	web3.py	
•  Di	atasnya	framework	web	based	seperti	flask	atau	Django,	atau	desktop	base	berbasis	PyQT	
Block	1	 Block	2	
Block	3	
Smart	
Contract	
Go-Ethereum	
Solidity	
Compile	to	Evm	
Byte	Code	
Web3.py	
Flask/Django/PyQT	
EVM	
Remix	 Truffle	
Solc/py-solc
Full Stack Python
•  Pyethereum,	ciptaan	Vitalik	Buterin	sebagai	backbone	kurang	terpelihara	
•  Py-EVM	sebagai	alternative,	masih	fase	alpha	
•  Serpent	mengandalkan	fungsi-fungsi	di	pyethereum	untuk	berinteraksi	dengan	kontrak	yang	dibuat	
Block	1	 Block	2	
Block	3	
Smart	
Contract	
PyEthereum	
Serpent	
Compile	to	Evm	
Byte	Code	
pyethapp	RPC	client	
Flask/Django/PyQT	
EVM	
Serpent	Compiler
Kesimpulan
•  Ekosistem	Python	di	Ethereum	masih	dalam	
pengembangan	
•  web3.py	sebagai	library	wrapper	untuk	akses	EVM,	
sudah	sangat	memadai	untuk	dibuat	Dapp	
•  Saran	implementasi	untuk	produksi:	Hybrid
Terima Kasih
asofyan@python.or.id

Mais conteúdo relacionado

Destaque

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Mengenal Ethereum dengan Python