Submit Search
Upload
在 Kotlin/Android 使用 Ethereum Smart Contract
•
Download as PPTX, PDF
•
5 likes
•
1,100 views
Yenwen Feng
Follow
在 Kotlin/Android 使用 Ethereum Smart Contract
Read less
Read more
Software
Report
Share
Report
Share
1 of 30
Download now
Recommended
A tour of ethereum ecosystem
A tour of ethereum ecosystem
Chang-Wu Chen
Block chain
Block chain
Jini Lee
Cloud native
Cloud native
Ci Jie Li
[Crypto Course] Blockchain Security
[Crypto Course] Blockchain Security
WEI CHIEH CHAO
區塊鏈創新基地 - 區塊鏈
區塊鏈創新基地 - 區塊鏈
Hu Kenneth
20201006 meta_coin 六角學院
20201006 meta_coin 六角學院
Hu Kenneth
ICO、智能合約與代幣經濟
ICO、智能合約與代幣經濟
InfiniteChain
金融革命?談區塊鏈上的去中心化金融應用
金融革命?談區塊鏈上的去中心化金融應用
Yao-Wei Ou
Recommended
A tour of ethereum ecosystem
A tour of ethereum ecosystem
Chang-Wu Chen
Block chain
Block chain
Jini Lee
Cloud native
Cloud native
Ci Jie Li
[Crypto Course] Blockchain Security
[Crypto Course] Blockchain Security
WEI CHIEH CHAO
區塊鏈創新基地 - 區塊鏈
區塊鏈創新基地 - 區塊鏈
Hu Kenneth
20201006 meta_coin 六角學院
20201006 meta_coin 六角學院
Hu Kenneth
ICO、智能合約與代幣經濟
ICO、智能合約與代幣經濟
InfiniteChain
金融革命?談區塊鏈上的去中心化金融應用
金融革命?談區塊鏈上的去中心化金融應用
Yao-Wei Ou
投資還是投機?帶你入門虛擬貨幣與區塊鏈
投資還是投機?帶你入門虛擬貨幣與區塊鏈
Yao-Wei Ou
Ethereum Smart Contract Development
Ethereum Smart Contract Development
Titan gene
Blockchain Development Presentation part-2
Blockchain Development Presentation part-2
Clement Hsieh
Blockchain Tutorial for Lawyers
Blockchain Tutorial for Lawyers
Blokcert
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
inwin stack
blockchain&cryptocurrency
blockchain&cryptocurrency
Sean Liu
Blockchain introduction for sharing
Blockchain introduction for sharing
Lman Chu
Blockchain 2.0 : Smart Contract 的美麗與哀愁
Blockchain 2.0 : Smart Contract 的美麗與哀愁
Tom Yang
線上區塊鏈投票.pdf
線上區塊鏈投票.pdf
BrownWood28
blockchain course (chinese)
blockchain course (chinese)
Moving Up Mobile
智能合約結合區塊鏈簡介
智能合約結合區塊鏈簡介
Nicholas Lin
Introduction bytom architecture 2018
Introduction bytom architecture 2018
Guofeng Wang
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
imtoken social
Intro to TrueBit
Intro to TrueBit
Yao-Hsin Chen
Blockchain 101 & 201
Blockchain 101 & 201
Benson Sun
201004 virtual data room advantages (chinese) (1)
201004 virtual data room advantages (chinese) (1)
EthosData
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in Java
Yenwen Feng
Product Market Fit
Product Market Fit
Yenwen Feng
Introduction to Growth
Introduction to Growth
Yenwen Feng
Growth
Growth
Yenwen Feng
Growth
Growth
Yenwen Feng
消費性 APP 的募資經驗分享
消費性 APP 的募資經驗分享
Yenwen Feng
More Related Content
Similar to 在 Kotlin/Android 使用 Ethereum Smart Contract
投資還是投機?帶你入門虛擬貨幣與區塊鏈
投資還是投機?帶你入門虛擬貨幣與區塊鏈
Yao-Wei Ou
Ethereum Smart Contract Development
Ethereum Smart Contract Development
Titan gene
Blockchain Development Presentation part-2
Blockchain Development Presentation part-2
Clement Hsieh
Blockchain Tutorial for Lawyers
Blockchain Tutorial for Lawyers
Blokcert
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
inwin stack
blockchain&cryptocurrency
blockchain&cryptocurrency
Sean Liu
Blockchain introduction for sharing
Blockchain introduction for sharing
Lman Chu
Blockchain 2.0 : Smart Contract 的美麗與哀愁
Blockchain 2.0 : Smart Contract 的美麗與哀愁
Tom Yang
線上區塊鏈投票.pdf
線上區塊鏈投票.pdf
BrownWood28
blockchain course (chinese)
blockchain course (chinese)
Moving Up Mobile
智能合約結合區塊鏈簡介
智能合約結合區塊鏈簡介
Nicholas Lin
Introduction bytom architecture 2018
Introduction bytom architecture 2018
Guofeng Wang
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
imtoken social
Intro to TrueBit
Intro to TrueBit
Yao-Hsin Chen
Blockchain 101 & 201
Blockchain 101 & 201
Benson Sun
201004 virtual data room advantages (chinese) (1)
201004 virtual data room advantages (chinese) (1)
EthosData
Similar to 在 Kotlin/Android 使用 Ethereum Smart Contract
(16)
投資還是投機?帶你入門虛擬貨幣與區塊鏈
投資還是投機?帶你入門虛擬貨幣與區塊鏈
Ethereum Smart Contract Development
Ethereum Smart Contract Development
Blockchain Development Presentation part-2
Blockchain Development Presentation part-2
Blockchain Tutorial for Lawyers
Blockchain Tutorial for Lawyers
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
blockchain&cryptocurrency
blockchain&cryptocurrency
Blockchain introduction for sharing
Blockchain introduction for sharing
Blockchain 2.0 : Smart Contract 的美麗與哀愁
Blockchain 2.0 : Smart Contract 的美麗與哀愁
線上區塊鏈投票.pdf
線上區塊鏈投票.pdf
blockchain course (chinese)
blockchain course (chinese)
智能合約結合區塊鏈簡介
智能合約結合區塊鏈簡介
Introduction bytom architecture 2018
Introduction bytom architecture 2018
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
imtoken官网imtoken钱包imtoken冷钱包APP下载.pdf
Intro to TrueBit
Intro to TrueBit
Blockchain 101 & 201
Blockchain 101 & 201
201004 virtual data room advantages (chinese) (1)
201004 virtual data room advantages (chinese) (1)
More from Yenwen Feng
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in Java
Yenwen Feng
Product Market Fit
Product Market Fit
Yenwen Feng
Introduction to Growth
Introduction to Growth
Yenwen Feng
Growth
Growth
Yenwen Feng
Growth
Growth
Yenwen Feng
消費性 APP 的募資經驗分享
消費性 APP 的募資經驗分享
Yenwen Feng
Thoughts behind Cubie Messenger
Thoughts behind Cubie Messenger
Yenwen Feng
Facebook flash api and social game development
Facebook flash api and social game development
Yenwen Feng
Our experience to start a startup
Our experience to start a startup
Yenwen Feng
GWT: Our Experiences
GWT: Our Experiences
Yenwen Feng
Entrepreneurship3
Entrepreneurship3
Yenwen Feng
Intro to Google Gadgets
Intro to Google Gadgets
Yenwen Feng
Suggestions for Building Websites
Suggestions for Building Websites
Yenwen Feng
Ajax by Examples 2
Ajax by Examples 2
Yenwen Feng
Hibernate Cache
Hibernate Cache
Yenwen Feng
More from Yenwen Feng
(15)
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in Java
Product Market Fit
Product Market Fit
Introduction to Growth
Introduction to Growth
Growth
Growth
Growth
Growth
消費性 APP 的募資經驗分享
消費性 APP 的募資經驗分享
Thoughts behind Cubie Messenger
Thoughts behind Cubie Messenger
Facebook flash api and social game development
Facebook flash api and social game development
Our experience to start a startup
Our experience to start a startup
GWT: Our Experiences
GWT: Our Experiences
Entrepreneurship3
Entrepreneurship3
Intro to Google Gadgets
Intro to Google Gadgets
Suggestions for Building Websites
Suggestions for Building Websites
Ajax by Examples 2
Ajax by Examples 2
Hibernate Cache
Hibernate Cache
在 Kotlin/Android 使用 Ethereum Smart Contract
1.
在 Kotlin/Android 使用 Ethereum
Smart Contract 馮彥文 tempofeng@gmail.com http://m.me/tempofeng https://medium.com/@tempofeng
2.
Agenda • Ethereum 乙太幣,Smart
Contract 智慧合約,Solidity • 不信任的環境下的好處 • EtherSpace • A Retrofit-like Ethereum client for Android, Java, and Kotlin
3.
Ethereum 乙太幣 Smart Contract
智慧合約 Solidity
4.
什麼是 Blockchain 區塊鏈?
5.
Blockchain 區塊鏈 • 去中心化的分散式資料庫 •
運行在不被信任的 node 節點上 • 每個節點皆儲存且驗證資料的正確性來獲得獎勵 • 已經存入的資料不可更改 • 用戶/錢包 • private key • public address • 所有對 Blockchain 的操作都會簽章
6.
什麼是 Ethereum 乙太幣? •
可以執行程式(智慧合約)的區塊鏈系統 • 節點(礦工)驗證程式與交易的正確性 • 第二大的虛擬貨幣經濟體 • 最多人使用的智慧合約區塊鏈 • 每次執行智慧合約需要付費給節點(礦工),稱為 gas
7.
Ethereum 與 Blockchain 呼叫
Smart Contract 節點執行 Smart Contract
8.
什麼是 Smart Contract
智慧合約? • 智慧合約在 Ethereum 不是合約,是一段程式 • 在不信任的節點上的 EVM 執行,所有資訊都是公開的 • 執行結果的 log 會被合併進 Block 區塊 • 合約不可更改 • 只有 Address,沒有 Private Key • 使用 Solidity 為程式語言
9.
什麼是 Solidity? • 以太幣的智慧合約語言 •
類似 Javascript • Type-Safe • 物件導向 • 執行在 EVM 之上
10.
Solidity 範例
11.
Solidity 範例
12.
Solidity 範例
13.
什麼是 Ethereum Virtual
Machine (EVM)? • Ethereum Smart Contract 的執行環境 • Sandbox 環境,沒辦法存取外界資訊,如時間,網路,...
14.
AWS Lambda 與
EVM 比較 AWS Lambda EVM 執行環境 Java, Javascript, … Solidity 執行速度 快 超級慢(每秒 20 筆) Scalability 根據流量擴充 單執行緒般 信任 可信任的環境(Amazon) 在不信任的環境
15.
不信任的環境下的好處
16.
不信任的環境下的好處? • Ethereum 是不信任的環境,完全公開的資料,資料不可修改 •
反而造成程式與資料可以被信任 • 參與者可以達到共識
17.
什麼環境是參與者互相敵對不信任? • 毒品 • 對方是否為臥底? •
轉帳是否為假錢? • 賭博 • Random number 怎麼產生? • 莊家是否有特別照顧某一方?
18.
在信任的環境下,智慧合約可以用在哪裡? • 虛擬貨幣 • 交易所 •
中心化 vs 去中心化 • Programmable Money • 選擇權 • 投票 • 新組織 Decentralized autonomous organization • Incentive
19.
在信任的環境下,智慧合約可以用在哪裡? • 供需關係 • 礦工
vs 使用者 vs ... • filecoin: https://filecoin.io/ • 資料保存 • 收集品 • 遊戲角色 • cryptokitties: https://cryptokitties.co
20.
在信任的環境下,智慧合約可以用在哪裡? • Hybrid Application •
On-chain vs Off-chain • 追求最小程度信任
21.
EtherSpace
22.
如何在 Java 環境下呼叫
Ethereum Smart Contract? • Web3j • https://github.com/web3j/web3j • Codegen • solidity → java file • EtherSpace • https://github.com/Wraecca/etherspace-java • Retrofit style • 推薦使用!
23.
如何使用 EtherSpace?
24.
如何使用 EtherSpace?
25.
如何使用 EtherSpace?
26.
EtherSpace 的 Smart
Contract 設定 • Annotation • @Call • 不會變更 Smart Contract 內容的 Transaction 的呼叫 • 與一般 RPC 相同,速度快 • @Send • 會變更 Smart Contract 內容的呼叫 • @Gas • 設定交易所需的 Gas
27.
EtherSpace 的 Smart
Contract 設定 • Solidity ⟷ Java Data Types • https://github.com/Wraecca/etherspace-java/wiki/Smart-Contract-Interface
28.
EtherSpace 範例 • Java •
https://github.com/Wraecca/etherspace-java/tree/master/etherspace-java- example • Android • https://github.com/Wraecca/etherspace-java/tree/master/etherspace- android-example
29.
EtherSpace 使用情境 • Server-side •
使用固定的 Private Key 呼叫 Smart Contracts • Android • 提供用戶錢包功能 • DApp 開發不應該承受這個風險 • 錢包與 DApp 分離(MetaMask 方式) • Future Work!
30.
Thank You!
Download now