Intro to Token Engineering by Michael Zargham and Matthew Barlin of BlockScience at the global token engineering workshop during blockchain week NYC, May 2018.
2. Goals
⢠Understand Engineering Math âToolsâ
⢠Understanding of the design process
⢠Methodologies used in development
⢠Tools to evaluate results
3. Michael Zargham
⢠Actively Researching Blockchain enabled
Coordination and Decision Systems
⢠Contributor & Advisor, Sweetbridge
⢠Former Director of Data Science and Architect of
Data & Decision Systems at Cross MediaWorks
⢠PhD in Systems Engineering, UPENN
⢠Research Ares: Decentralized Optimization,
Decision Science, Operations Management
⢠Academic expertise in optimal and stochastic
Control Theory, Game Theory & Applied Math
⢠Quantitative Analyst and Decision Systems
Engineer since 2005.
⢠Research engineer and data scientist at
BlockScience, specializing in systems engineering
crypto-economic environments. He has developed,
simulated, and tested token mechanics for smart
contracts on the blockchain.
⢠Advisory board on AeroChain and Fr8 Network
⢠Directed model test programs for US and foreign
navies.
⢠Masterâs degree from MIT in Ocean Systems
Management
Matthew Barlin
4. Preliminaries
⢠Definition of a Network
⢠Definition of a Blockchain Network
⢠Important Token Distinctions
⢠Coordination Problem
⢠Feedback
9. Generalizing Crypto-Assets
Fungible Unique
Divisible Cryptocurrencies
Equity or Shares
in specific Assets
Discrete
Tokens representing
physical Commodities
Tokens representing
Titles or Deeds
⢠Tokens are digital representations of Assets which may or many not be tangible (goods vs rights)
⢠Ownership in the asset is governed by a decentralized ledger
⢠Crypto-Assets allow ownership to be transferred via smart contract
10. States in the âEconomic Networkâ
â˘Smart Contracts and non-asset states
â˘automate the execution of workflows defined in legal contracts (discrete states)
â˘maintain account balances and other dynamic values (continuous states)
â˘Enforce the set of legal state transitions for all types of states
â˘Economic Systems Have âconfiguration spacesâ implied by their initial state and the valid state transitions
â˘Curse of dimensionality
â˘Bitcoin example â low dimension space restrictions
https://www.cs.cmu.edu/~motionplanning/lecture/Chap3-Config-Space_howie.pdf
http://web.eecs.umich.edu/~ocj/courses/autorob/autorob_14_configuration_spaces.pdf
11. Economic System Layer is Dynamical
https://ocw.mit.edu/courses/electrical-engineering-and-
computer-science/6-241j-dynamic-systems-and-control-spring-
2011/readings/MIT6_241JS11_chap10.pdf
12. Economic System Layer is Discrete
https://web.stanford.edu/class/archive/ee/ee392m/ee392m.1
056/Lecture9_ModelSim.pdf
Finite State Machine for
TCP/IP
13. Economic System Layer is a Hybrid System
http://www-
inst.cs.berkeley.edu/~ee291e/sp09/ha
ndouts/book.pdf
Math example for a water tank switching model
14. Peers Coordinate to Validate the Current State
Agree On Prior State
Compute locally
by operating on the same priors
One Agent Declares
âsolutionâ
candidate posterior state
Network Validates
Solution, adopting the
Posterior state
15. Coordination Platforms and/or Applications
Front End User Interface
Decentralized (Self-sovereign) Identity Decentralized Payment System
Core functionality for dApp
Application Token
Private or
Permissioned
Data Layer
(Thin) Centralized Backend
- Basic business logic
- ML microservices
- Application data
- APIs to other systems
- Other Oracles
Users of all roles
18. Sweetbridge Vision: Protocol Stack
Core Features
â˘Stable Token driven to par by
commerce not by trading
â˘Self-lending
â˘Continuously Audited financial
system
â˘Financial base layer building
towards ecosystem level
operations management
algorithms via smart contracts
https://sweetbridge.com/public/docs/Sweetbridge-Whitepaper.pdf
19. Liquidity Protocol: 2 Currency System
https://sweetbridge.com/public/docs/Sweetbridge-Whitepaper.pdf
20. Human Actions: Taking & Repaying UOUs
https://sweetbridge.com/public/docs/Sweetbridge-Whitepaper.pdf
25. Example: Transportation System Incentive Research
https://forum.stanford.edu/events/posterslides/CapriCongestionandParkingReliefIncentives.pdf
https://web.stanford.edu/~balaji/
26. Key Concepts
⢠Systems Engineering
⢠Model
⢠Model Based Systems Engineering
⢠Requirements
27. Systems Engineering Principles
Introduction to Systems Engineering
Project Performance (Australia) Pty Ltd
DO:
⢠Establish an objectively adequate problem definition before committing
significant resources to design and development
⢠Design a solution by dividing the big problem into a set of individually
sufficiently-well-defined smaller problems, by defining the required
characteristics of each element of the solution.
ELSE:
⢠Inadequate requirements have consistently been the single biggest
cause of project failures and losses in all sectors. The cost of inaction
typically exceeds the cost of prevention by a factor of 10-100 to one.
⢠Results in design errors, the need for much increased design verification,
and problems first revealed in system integration (or later).
28. Systems Engineering Design Process
SYSTEMS ENGINEERING FUNDAMENTALS, Department of
Defense, Systems Management College, January 2001
29. Requirements Key Points:
The 4-C's of requirements:
Ă Clear: understandable so that all stakeholders can participate in validation
and all developers know what to build and test
Ă Concise: Short requirements are more understandable and maintainable.
And, they can often be more precise when you use formalisms.
Ă Correct: Incorrect requirements will lead to reduced revenue, or major
rework.
Ă Complete: Incomplete requirements also leads to major rework and last-
minute schedule changes.
30. Requirements Key Points:
Ă The specification should not bias the design or implementation.
Ă Don't get ahead of yourself, you will do design later
Ă Design details make the system requirements for non-technical
stakeholders to understand
Ă Design details are irrelevant to system test.
Ă You may come up with better ideas for the design later, you do should not
have to change the system requirements unless your goals for the product
change.
31. Types of Requirements
Ă Performance
Ă To what extent is the function executed? What are the quality and quantity of
the function?
Ă Design
Ă How will we build? What are the technical needs?
Ă Derived
Ă Implied from a higher-level requirement
Ă Allocated
Ă Established by dividing a top-level requirement into multiple lower-level ones
Ă Operational
Ă How well the system serves users and under what conditions?
Ă Functional
Ă What are necessary the tasks or actions? Top-level for functional analysis
32. Requirements Analysis
⢠Inputs converted to outputs:
â Customer requirements â
â SE outputs from prior development efforts
⢠Controls:
â Laws and organizational policies and procedures â
â Tech base and other constraints
⢠Enablers:
â Multi-disciplinary product teams
â Decision and requirements database including system/configuration item
descriptions from prior efforts
â System analysis and control
SYSTEMS ENGINEERING FUNDAMENTALS, Department of
Defense, Systems Management College, January 2001
REQUIREMENTS
ANALYSISInputs converted to outputs
Controls
Enablers
Outputs
35. Model
§ A simplified version of a concept, phenomenon, relationship, structure or system
§ A graphical, mathematical or physical representation
§ An abstraction of reality by eliminating unnecessary components
The objectives of a model include:
Ă to facilitate understanding
Ă to aid in decision making, examine 'what if' scenarios
Ă to explain, control, and predict events
Introduction To Model-Based System Engineering (MBSE) and SysML
Laura E. Hart Lockheed Martin, IS&GS
36. System Model
⢠Requirements
What are the stakeholder goals, purposes, and success conditions for the system
Specification of black box behavior and characteristics
⢠Behavior
What the system has to do to meet the requirements
Transformations of inputs to outputs (functional/activity models)
State/Mode-based behavioral differences (state models)
⢠Structure
The parts that exhibit the behavior
The component hierarchy, elements, and stores
⢠Properties
The performance, physical characteristics and governing rules that constrain the structure and
behavior
⢠Interconnections
The way the structural elements arrange and communicate to achieve the required behavior
under the given constraints
Introduction To Model-Based System Engineering (MBSE) and SysML
Laura E. Hart Lockheed Martin, IS&GS
37. Model Based Systems Engineering in a Nutshell
Traditional Systems Engineering Model Based Systems Engineering
Image credit to NASA/JPL-Caltech
40. Model Breakdown:
(Token or Economic Engineering)
BlockScience Solution
High Level Formal Specification
SPEC
High Level Analysis
SPEC SPEC SPEC
REQUIREMENTS
INTEGRATION
COMPONENT SIMULATION AND TESTING, REQUIREMENTS MET?
41. Sell Line
Triggering
Vault State
Legal Vault
State*
Liquidation
Event
Return Vault to Legal State
Vault States
LV/AV
Continuous Vault States
Liability Value as a % of Asset Value
Good Standing Valid Sell Line Triggering Default
Vault States: Original Customer
Requirements
42. Example from Sweetbridge: Sell Line Vault Controls
Collateralized debt positions have rules which trigger control actions which prevent loans from defaulting
https://images.sweetbridge.org/main/Sweetbridge-WP-LiquidityProtocolMath-v1-01.pdf
Hybrid System Controller designed to massively reduce the
probability of reaching the state of invalid vault despite it being
possible due to outside volatility in asset value
43. Automated Actions: Sell Line Vault Controls
Formal Proof creates a cushion between Valid and Triggering states with a tunable parameter, Theta
But we check our work numerically and use the simulations to guide parameter decisions
https://images.sweetbridge.org/main/Sweetbridge-WP-LiquidityProtocolMath-v1-01.pdf
44. Asset
Value
Asset
Value*
Figure 3: Asset and Liabilities at New State
Sweetbridge
Transaction
Fee
Liability
Value
Liability
Value*
-ÎLV
Penalty Fee
-ÎLV(1+PF)(1+TF)
Vault States: Revised Customer
Requirements
0 0.2 0.4 0.6 0.8 1 1.2
LV/AV
Vault States
Vault States with Sell Line
Liability Value as a % of Asset Value
Good Valid Sell Line Triggering Cannot Cover Fees Cannot Cover Liabilities
48. Sweetcoin Design Preserves an Invariant:
The Ratio of Fees incurred to Fees Paid!
We didnât yet understand the generality of invariants when working on this
49. Sweetcoin Intrinsic Valueâ Marketprice Independence
Tokens in use:
Locked for the period
Based on level of service
Tokens owned
Purchase tokens
Sell tokens
Market value of
tokens owned
Discount capacity of
tokens owned
Network state:
Total tokens activated
Total platform use Token utility:
Financial value of using the
tokens based on costs offset
over a period of repeated use
use
From Discount Token Framework Published by Sweetbridge Inc
https://images.sweetbridge.org/main/WP-Sweetbridge-Discount-
Tokens.pdf
Discount Token
reduces platform fees by a percentage
F = total fees Network-wide
f = individual user fee without token
A = total activated tokens network-wide
a = individual user activated tokens
Discount Capacity = phi * a/A*F/f
Userâs Discount = phi * a/(a+A)*(f+F)/f
phi = network-wide discount rate
zero fee when: a = f*A/( phi*F +(1-phi)*f)
Utility= Discount Capacity;
NOT dependent on Token Market Price
50. Discount Token as an On-chain Microservice
History of all
(f,a,fâ)
Stored in Ledger
(f,a) fâfâ= f*(1-phi * a/(a+A)*(f+F)/f)
f = fees incurred
a= tokens activated
activated tokens
remain locked for
N blocks in the future
fâ = fees due
after accounting
for locking a
Fâ = Sum: fâ
over N blocks
look back N blocks
F = Sum: f
A = Sum: a
System tends to the intended property
Fâ = (1-phi)* F
But we added a low pass filter reduce noise in discount capacity experienced by Sweetcoin users
53. What about Games?
Actions and Reward are fixed: play best response
Design the game, but once deployed the game is fixed
But in the world of blockchain networks the game itself can change in time!
54. How does our "Control Systemâ Relate to Games?
⢠Think of it as engineering how the âGameâ itself is evolving
⢠The players actions move the state within the âpossibleâ configurations
⢠We make no claims about what any player actual does
⢠We only make claims about what those âpossibleâ configurations are
⢠In practice this means careful selection of smart contract methods to be
mathematically consistent with fixed point properties in the manner of
Lyapunov Optimization
⢠Only After Characterizing the Possible configurations does it really make
sense to design incentive profiles over actions
https://en.wikipedia.org/wiki/Lyapunov_optimization
56. Moving through the systems design process:
VERIFICATION
SYSTEMS ENGINEERING FUNDAMENTALS, Department of
Defense, Systems Management College, January 2001
57. Simulation Principles
§ Build tool using mathematical model
§ Determine assumptions
§ Define ranges
§ Validate Tool
§ Define test
§ Run test to answer right questions,
§ Deterministic vs Stochastic
§ Stochastic processes
§ Monte Carlo Simulation
59. Sweetcoin Macro-Economic Research
Statistics for Global Discount Ratios and Discount Capacity KPIs over 100 unique trials
At system launch few discounts are achieved
but the system evolves toward the designed
discount equilibrium point
The discount capacity of tokens grows roughly
proportionally with the growth in network
utilization as measured by fees incurred
61. Integration Key Points
⢠Systems Integration is the process of:
Assembling the constituent parts of a system in a logical, cost-effective way,
comprehensively checking system execution (all nominal & exceptional paths),
and including a full functional check-out.
⢠Systems Test is the process of:
⢠Verifying that the system meets its requirements
⢠Validating that the system performs in accordance with the customer/user
expectations
⢠Manage system integration and system test based upon subsystems that can be
end-to-end tested against system level requirements; manage system design &
development based upon components that can be independently developed and
checked.
⢠Success
⢠All subsystems integrated; all subsystem & system threads exercised
successfully.
⢠System is robust and is ready for formal requirements verification.
63. Bridgecoin Economy Research
System without Depositor Policy Implemented by Treasury
System with simple Depositor policy offering
interest bearing loans to lock up BRC
65. Measuring, Monitoring and Maintenance
How:
⢠Collect data in real time from blockchain and other
data sources
Why:
⢠To be good stewards of shared infrastructure, system
(maintenance) tuning and well informed governance
requires data
⢠Owe it to your stakeholders to be informed about the
performance of your system
⢠Ability to gain insight, tune, foresee, and learn about
your blockchain environment
⢠Consider the operational life cycle of the product
66. Measuring, Monitoring and Maintenance
Example: CryptoKitties (AxiomZen)
https://drive.google.com/file/d/1soo-
eAaJHzhw_XhFGMJp3VNcQoM43byS/vie
w
⢠Low Stakes
Build a âtoyâ system but release it
into the real world to learn a lot. âItâs
just a game after all.â
⢠Low Risk
No major harm if something goes
wrong
⢠High Reward
Real data about real activity with
respect to an explicit incentive is
available and can be analyzed!
72. Midwives Go Professional: Smart Contracts
Instead of âexternal accountsâ â Smart contracts specialized to call give Birth Emerged a few weeks in
78. Identity and Privacy
All blockchain âaccountsâ have public key addresses
Networks are Psuedo-nonymous
Government Issued
âLegalâ Identity
Public Ledgers are a double-edged sword not a Panacea
Layered Architectures and Nuanced thinking around Policy
and Regulation are required build and regulate systems that
store, manage or make decisions using
Personally Identifying Information (PII)
Map
79. Regulation and Governance
Technology is what can be done
but Society needs to think about
What the technology is used for.
When economic ârobotic agentsâ are part of the economyâŚ.
Who decides what their objective functions are allowed to be?
Who is responsible for monitoring the health of the economy?
⌠for tuning network or agent parameters?
⌠for decommissioning them?
Do we need professional engineering licenses for economic agents?
How do we make sure they arenât taking advantage of people?
⌠or incentivizing or enabling nefarious behavior?
80. Scifi Dystopian Future?
A synthetic world interwoven with the physical one
in which autonomous software agents interact with
each other, their environment and humans.
Trending up
Trending down
Emergence of a hyper-intelligent AI that has central
command of legions of robotic agents; coordination
issues: Byzantine Generalâs Problem