Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
スマートコントラクトデザイン / Smart Contract Design
Search
Kenji Saito
PRO
October 27, 2025
Technology
0
24
スマートコントラクトデザイン / Smart Contract Design
慶應義塾大学大学院メディアデザイン研究科「サービスデザインプロジェクトB」2025秋 第4回にて使用したスライドです。
Kenji Saito
PRO
October 27, 2025
Tweet
Share
More Decks by Kenji Saito
See All by Kenji Saito
ブロックチェーンとこれからの金融システム / Blockchain and the Future of Financial Systems
ks91
PRO
0
20
デザイン相談会 / Design Consultation
ks91
PRO
0
4
マーケティング / Marketing
ks91
PRO
0
6
イノベーション / Innovation
ks91
PRO
0
6
ミッション / Mission
ks91
PRO
0
10
リーダーシップ / Leadership
ks91
PRO
0
7
ミッションとリーダーシップ / Mission and Leadership
ks91
PRO
0
31
ウェブサービスデザイン 2 / Web Service Design 2
ks91
PRO
0
10
Learning to Govern the Orbital Commons: A Serious Game on Incentivizing Debris Removal
ks91
PRO
0
5
Other Decks in Technology
See All in Technology
命名から始めるSpec Driven
kuruwic
3
810
生成AIシステムとAIエージェントに関する性能や安全性の評価
shibuiwilliam
2
310
Design System Documentation Tooling 2025
takanorip
1
880
mablでリグレッションテストをデイリー実行するまで #mablExperience
bengo4com
0
470
OpenShiftのBGPサポート - MetalLB+FRR-k8s編
orimanabu
0
140
意外と難しいドメイン駆動設計の話
zozotech
PRO
0
1k
2025 DORA Reportから読み解く!AIが映し出す、成果を出し続ける組織の共通点 #開発生産性_findy
takabow
2
1k
AI時代のインシデント対応 〜時代を切り抜ける、組織アーキテクチャ〜
jacopen
4
190
シンプルを極める。アンチパターンなDB設計の本質
facilo_inc
1
980
MCP・A2A概要 〜Google Cloudで構築するなら〜
shukob
0
140
How native lazy objects will change Doctrine and Symfony forever
beberlei
1
360
Flutter Thread Merge - Flutter Tokyo #11
itsmedreamwalker
1
130
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing Experiences People Love
moore
142
24k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
It's Worth the Effort
3n
187
29k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Automating Front-end Workflow
addyosmani
1371
200k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Transcript
generated by Stable Image Ultra B 2025 4 ( )
B 2025 — 4 — 2025-10-27 – p.1/30
https://speakerdeck.com/ks91/collections/service-design-project-b-2025-fall ( ) ( ) Discord Discord ( / /
) Zoom URL ( ) B 2025 — 4 — 2025-10-27 – p.2/30
( ) 1 10 6 • 2 10 13 •
3 10 20 • 4 10 27 • 5 11 10 1 6 11 24 2 7 12 1 8 12 8 ( ) ( ) 4 ( 3 ) ↓ B 2025 — 4 — 2025-10-27 – p.3/30
( ) — (3) : Web3 B 2025 — 4
— 2025-10-27 – p.4/30
( ) — Ethereum Sepolia B 2025 — 4 —
2025-10-27 – p.5/30
infura.io Brownie https://infura.io SIGN UP PROJECT ID infura Ethereum API
infura . . . infura.io Amazon infura.io PROJECT ID WEB3_INFURA_PROJECT_ID PROJECT ID (∼/.bash_profile ) $ export WEB3_INFURA_PROJECT_ID= PROJECT ID B 2025 — 4 — 2025-10-27 – p.6/30
Sepolia ETH brownie console Sepolia >>> network.disconnect() >>> network.connect(’sepolia’) >>>
len(accounts) 0 >>> accounts.add() <LocalAccount object ’ 16 ’> >>> accounts[0].private_key 16 >>> quit() Sepolia Testnet ETH Faucet ETH https://sepoliafaucet.com ( ) ( ) . . . Ethereum 0.001 ETH 0.1 Sepolia ETH B 2025 — 4 — 2025-10-27 – p.7/30
Sepolia ETH brownie console Sepolia ETH >>> network.disconnect() >>> network.connect(’sepolia’)
>>> len(accounts) 0 >>> accounts.add( 16 ) <LocalAccount object ’ 16 ’> >>> accounts[0].balace() ETH >>> quit() ETH >>> accounts[0].transfer(accounts[1], "0.01 ether") B 2025 — 4 — 2025-10-27 – p.8/30
(3) : B 2025 — 4 — 2025-10-27 – p.9/30
transfer settle, retrieve asset, retrieve token 3 B 2025 —
4 — 2025-10-27 – p.10/30
1. ( ) 2. ( ) 3. ( ) B
2025 — 4 — 2025-10-27 – p.11/30
OneTimeEscrow settle() function settle() public returns (bool) { require(_token_.balanceOf(address(this)) >=
_price_); /* this */ require(_asset_.getOwner() == address(this)); _token_.transfer(_seller_ , _price_); _asset_.transfer(_buyer_); emit Settled(); /* */ return true; } settle() transfer ( / ) $ brownie compile B 2025 — 4 — 2025-10-27 – p.12/30
(1) from brownie import * import pytest seller = accounts[0]
buyer = accounts[1] def test_deploy_and_settle(Token, IndivisibleAsset, OneTimeEscrow): asset = accounts[0].deploy(IndivisibleAsset, "5322 Endo", "mˆ2", 300) token = accounts[0].deploy(Token, "Test Token", "TEST", 18, "1000 ether") B 2025 — 4 — 2025-10-27 – p.13/30
(2) token.transfer(buyer, 300, {’from’: accounts[0]}) escrow = accounts[0].deploy(OneTimeEscrow, token, buyer,
asset, seller, 300) accounts[0]/seller accounts[1]/buyer 300 300 TX buyer seller 300 bake Token 300 ETH wei B 2025 — 4 — 2025-10-27 – p.14/30
(3) token.transfer(escrow, 300, {’from’: buyer}) asset.transfer(escrow, {’from’: seller}) assert token.balanceOf(seller)
== 999999999999999999700 assert token.balanceOf(buyer) == 0 assert token.balanceOf(escrow) == 300 assert asset.getOwner() == escrow buyer ( ) 300 seller ( ) B 2025 — 4 — 2025-10-27 – p.15/30
(4) escrow.settle({’from’: seller}) assert token.balanceOf(seller) == 1000000000000000000000 assert token.balanceOf(buyer) ==
0 assert token.balanceOf(escrow) == 0 assert asset.getOwner() == buyer settle() seller OK B 2025 — 4 — 2025-10-27 – p.16/30
$ pytest tests/test_one_time_escrow.py : settle() ⇒ Discord B 2025 —
4 — 2025-10-27 – p.17/30
B 2025 — 4 — 2025-10-27 – p.18/30
1. (1) (2) Ethereum 2025 10 25 ( ) 23:59
JST B 2025 — 4 — 2025-10-27 – p.19/30
. . . . . . 3 1 ( )
( ) ( ) B 2025 — 4 — 2025-10-27 – p.20/30
A ⇒ B 2025 — 4 — 2025-10-27 – p.21/30
A Ethereum NFT NFT NFT B 2025 — 4 —
2025-10-27 – p.22/30
A — NFT NFT NFT ⇒ ( ) B 2025
— 4 — 2025-10-27 – p.23/30
⇒ 20 Discord . . . ( ) B 2025
— 4 — 2025-10-27 – p.24/30
Web3 Web3 HTTPS B 2025 — 4 — 2025-10-27 –
p.25/30
B 2025 — 4 — 2025-10-27 – p.26/30
miro ( ) ( ) B 2025 — 4 —
2025-10-27 – p.27/30
B 2025 — 4 — 2025-10-27 – p.28/30
2. API (1) ( ) (2) Web API 2025 11
8 ( ) 23:59 JST B 2025 — 4 — 2025-10-27 – p.29/30
B 2025 — 4 — 2025-10-27 – p.30/30