Programmable Money For The API Economy
Programmable Money For The API Economy
API Economy
Bootcamp 2021
https://panacloud.github.io/bootcamp-2021/
What is an Programmable Money?
⚫ Programmable money is money represented in
digital form, also known as tokens.
⚫ This digital currency is tracked with
corresponding electronic ledgers, most popularly
blockchains, enabling a transactional record that
is publicly and securely shared.
⚫ This ledger should preferably be based on open
source software to promote sound governance,
and to keep the programming interfaces equally
available to banks and other participants.
It is Not Automated Payments
⚫ Programmable money is not the ability to write
arbitrary code that can move money using the
Banking API. Even if it includes complex
business logic and external data as part of the
decision making.
⚫ Nor is it if I instruct my bank to make an
automated monthly payment of $4,000 to my
landlord.
⚫ In each of the above cases, of course the bank
could actually hold back the payment, even
after they have received the payment
instruction.
Then what is it?
⚫ One main characteristic of programmable
money mean that no matter what, the code’s
instructions will be carried out, and no bank
or intermediary can stop it.
⚫ Stable Coin like DAI which are controlled by
Smart Contract on Ethereum achieves this.
⚫ Stable Coin like Diem on Permissioned
blockchain do not achieve this.
Designer Money
⚫ Now you can create money where the money
itself has control logic built into it. This is done at
the smart contract level.
⚫ A smart contract is typically a bunch of code that
is run by all participants in a blockchain network.
⚫ It defines:
1. The characteristics of the money (how many units there are,
who initially owns it, etc)
2. How users can interact with the money (ask for a balance,
make a payment, etc). The constraints are coded here.
DAI the Ideal Currency for the API Economy
⚫ Dai (or DAI) is a stablecoin cryptocurrency which aims
to keep its value as close to one United States dollar
(USD) as possible through an automated system of
smart contracts on the Ethereum blockchain.
⚫ Dai is already powering the digital economy where
people can bypass banks and other financial firms to
transact directly with one another.
⚫ Dia can also power the API Economy where it will allow
the developers to directly transact with one another.
⚫ Dia is programmable money.
DAI Details
⚫ The protocol allows lenders to lock up their funds in ETH
or any other crypto asset through smart contracts on
Ethereum, guaranteeing the issuance of new DAI tokens in
the form of loans.
⚫ The required deposit is greater than the value of the
token.
⚫ In contrast to other crypto assets, it minimizes price
volatility and traded on Crypto Exchanges.
⚫ Anyone can send and receive DAI without the need for
third parties, in a peer-to-peer (P2P) method.
⚫ It is decentralized, resistant to censorship, and
trustworthy.
DAI Benefits for API Economy
⚫ Stable: Has value that is designed to be stable over
any period
⚫ Transparent: Auditable Payments to API Developers
⚫ Borderless: Allows cross-border payments globally
⚫ Faster Speed: Instant settlement
⚫ Lower Fees: after Ethereum 2 it will be even lower,
less than credit card payment of 2%
⚫ Programmable: Feathers can be added on top of Dai
which are useful for the API Economy
DAI Benefits for API Economy
⚫ Stable: Has value that is designed to be stable over
any period
⚫ Transparent: Auditable Payments to API Developers
⚫ Borderless: Allows cross-border payments globally
⚫ Faster Speed: Instant settlement
⚫ Lower Fees: after Ethereum 2 it will be even lower,
less than credit card payment of 2%
⚫ Programmable: Feathers can be added on top of Dai
which are useful for the API Economy
Ethereum is a decentralized platform that runs
smart contracts applications that run exactly
as programmed without any possibility of
downtime, censorship, fraud or third party
interference
The Birth of Ethereum
1. A blockchain without a specific purpose, that could support a
broad variety of applications by being programmed.
2. The idea was that, a developer could program their particular
application without having to implement the underlying
mechanisms of
a. peer-to-peer networks,
b. blockchains,
c. consensus algorithms, etc.
3. The Ethereum platform was designed to abstract these details
and provide a deterministic and secure programming
environment for decentralized blockchain applications.
What Is Ethereum?
From a computer practical perspective:
MetaMask
https://metamask.io
Getting Started with MetaMask
1. Once MetaMask is installed you
should see a new icon in your
browser’s toolbar.
2. Click on it to get started.
3. You will be asked to accept the terms
and conditions and then to create
your new Ethereum wallet by
entering a password
Switching Networks
1. Main Ethereum Network
a. By default, MetaMask will try to connect to the main public network.
b. Real ETH, real value, and real consequences.
2. Ropsten Test Network
a. Ethereum public test blockchain and network.
b. ETH on this network has no value.
3. Kovan Test Network
a. Ethereum public test blockchain and network using consensus protocol -
Proof of authority ETH on this network has no value. The Kovan test network
is supported by Parity only.
Switching Networks
4. Rinkeby Test Network
a. Ethereum public test blockchain and network, using consensus protocol -
proof of authority
b. ETH on this network has no value.
5. Localhost 8545
a. Connects to a node running on the same computer as the browser.
b. The node can be part of any public blockchain (main or testnet), or a private
testnet.
6. Custom RPC
a. Allows you to connect MetaMask to any node with a Geth-compatible
Remote Procedure Call (RPC) interface. The node can be part of any public
or private blockchain
Getting Some Test Ether
1. New transaction will be mined and your
MetaMask wallet will show a balance of
1 ETH.
2. Click on the transaction ID it take you to
a block explorer. MetaMask uses the
Etherscan block explorer,
3. The transaction containing the payment
from the Ropsten Test Faucet is shown
in Etherscan Ropsten block explorer.
Addresses
One of Ethereum’s foundational technologies is cryptography
The private key controls access by being the unique piece of information needed to
create digital signatures, which are required to sign transactions to spend any funds
in the account. Digital signatures are also used to authenticate owners or users of
contracts
first application:
contract ERC20 {
function totalSupply() constant returns (uint theTotalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns
(bool success);
function approve(address _spender, uint _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns
(uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
totalSupply - Returns the total units of this token that currently exist. ERC20 tokens
can have a fixed or a variable supply.
transfer - Given an address and amount, transfers that amount of tokens to that
address, from the balance of the address that executed the transfer.
transferFrom - Given a sender, recipient, and amount, transfers tokens from one
account to another. Used in combination with approve.
ERC20 required functions and events
approve - Given a recipient address and amount, authorizes that address to
execute several transfers up to that amount, from the account that issued
the approval.
A smart contract is just a fancy name for code that runs on a blockchain, and
interacts with that blockchain’s state.
Each Language has its strengths and weaknesses – you’d be crazy to build a
website in C or compress HD video in Ruby.
But in principle at least, you could if you wanted to. You’d just pay a heavy price in
terms of convenience, performance, and quite probably, your hair.
DAI Lab
1. Install Metamask (Ethereum Wallet)
https://metamask.io/
5. To show received Dai in Matamask push Add Token button using the
following DAI contract address:
0xad6d458402f60fd3bd25163575031acdce07538d
DAI Lab
6. Send one Dai or more to my address:
0xA31Fa5D96441645FCeD6F09743cA5703605817Ca
Thank You