Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
45
0
Share
スマートコントラクトデザイン / Smart Contract Design
慶應義塾大学大学院メディアデザイン研究科「サービスデザインプロジェクトB」2025秋 第4回にて使用したスライドです。
Kenji Saito
PRO
October 27, 2025
More Decks by Kenji Saito
See All by Kenji Saito
インターネットの技術 / Internet technology
ks91
PRO
0
19
大規模言語モデルの原理と使いこなしの原則 / Principles of Large Language Models and How to Use Them Effectively
ks91
PRO
0
8
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
87
研究って何だっけ / What is research anyway?
ks91
PRO
0
15
ブロックチェーンと分散ファイナンス概論 / Introduction to Blockchain and Decentralized Finance
ks91
PRO
0
10
サイバーフィジカル社会とは何か / What Is a Cyber-Physical Society?
ks91
PRO
0
170
本授業におけるエージェント・ハブの使い方 / How to Use the Agent Hub in This Course
ks91
PRO
0
67
LLM とプロンプトエンジニアリング/チューターを定義する / LLMs and Prompt Engineering, and Defining Tutors
ks91
PRO
0
360
Running Coding Agents (Windows WSL Edition)
ks91
PRO
0
44
Other Decks in Technology
See All in Technology
CloudSec JP #005 後締め ~ソフトウェアサプライチェーン攻撃から開発者のシークレットを守る~
lhazy
0
180
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
74k
Azure Lifecycle with Copilot CLI
torumakabe
3
710
組織的なAI活用を阻む 最大のハードルは コンテキストデザインだった
ixbox
6
1.8k
Proxmox超入門
devops_vtj
0
190
JEDAI in Osaka 2026イントロ
taka_aki
0
130
幾億の壁を超えて/Beyond Countless Walls(JP)
ikuodanaka
0
120
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.2k
BigQuery × dbtでコスト削減した話
rightcode
0
110
数案件を同時に進行するためのコンテキスト整理術
sutetotanuki
2
230
ある製造業の会社全体のAI化に1エンジニアが挑んだ話
kitami
2
920
AIを活用したアクセシビリティ改善フロー
degudegu2510
1
170
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
520
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
490
What's in a price? How to price your products and services
michaelherold
247
13k
Git: the NoSQL Database
bkeepers
PRO
432
67k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
Mobile First: as difficult as doing things right
swwweet
225
10k
Design in an AI World
tapps
0
190
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
720
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
The SEO identity crisis: Don't let AI make you average
varn
0
440
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
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