The document discusses modeling token economics and lessons learned from past smart contract failures. It provides examples of smart contract disasters like the DAO hack and Parity wallet bugs that exploited vulnerabilities. Best practices for smart contracts like code audits and verification tools are discussed. Criticisms of Bancor's token model from Emin Gün Sirer are summarized point-by-point. Examples of past token economic disasters like the Maidsafe ICO are provided as warnings. The importance of testing token economic designs is emphasized.
2. Where do
we stand
with project
design now?
–Draw an analogy between smart
contracts and token economics
–Smart contracts have a lot riding on them
–Have been exploited in the past
–Lesson: it’s better to test and verify
before bad things are allowed to happen
3. Smart contract
disasters that
motivate this
space
– DAO hack:
– On June 17, 2016, a hacker found a loophole in
the coding that allowed him to drain funds from
The DAO. In the first few hours of the attack, 3.6
million ETH were stolen, the equivalent of $70
million at the time. Once the hacker had done the
damage he intended, he withdrew the attack.
– Two main issues made this possible: the fact that
when the DAO smart contract was created the
coders did not take into account the possibility of
a recursive call and the fact that the smart
contract first sent the ETH funds and then
updated the internal token balance
4. Smart contract
disasters that
motivate this
space
– Parity wallet bug:
– In November 2017, a Parity user “accidentally
killed” the Parity multisig library by activating a
vulnerability to become the owner of the library,
and then self-destructing it. Prior to that, the
library had been “fixed and re-deployed” with the
vulnerability after Parity was hacked of around
150,000 ETH in July 2017.
– In response to the accidental freeze of the ETH
funds, Parity wrote in a blog post that they are
working on Ethereum Improvement Proposals
(EIP) that could propose ways to unblock the
funds.
7. Bancor point-
by-point
takedown
fromGunSirer
– Bancor uses lots of mumbo jumbo terminology.
– The core problem they want to address, "Double
Coincidence of Wants" is not a real problem.
– One can always use ether as a medium of exchange.
– Bancor is essentially a central bank strategy for
automatically setting a dynamic peg for new coins.
– That's it. That's the whole idea.
– Everything Bancor can do for you on chain, you can do by
yourself off chain.
– It is much better to manage the reserves manually than to
commit to the Bancor strategy.
– The Bancor strategy sets prices independent of the
market.
– The Bancor strategy fails to capitalize on excess value
– The algorithmic dampening provided by Bancor isn't
desirable for already liquid assets whose value is unstable.
– The Bancor strategy will not do anything to find or
maintain the true equilibrium value of an asset.
– Bancor thus acts like a dynamically adjusted currency peg.
– Bancor presents an arbitrage opportunity. It does not lead
the market towards equilibrium, it trails the market,
always and by definition.
– Bancor does not "eliminate labor" in price discovery.
– There is no indication that the Bancor strategy is an
optimal, or even good, use of reserves to discover the
price.
– Bancor is a net negative in markets with substantial
liquidity.
– Bancor claims to provide liquidity, but does not.
– Bancor is open to front-running.
– Bancor's suggested fix to front-running is broken.
– Bancor reimplemented math.
– Bancor did not test their own math.
– Arithmetic errors can be fatal.
– Bancor does not support the notion of supply caps for
Bancor-based tokens.
– Bancor shortchanges its users.
– Bancor code is "difficult to prove correct."
– Bancor code has a reentrancy problem in the sell()
function.
– Bancor code has a different reentrancy problem in the
change() function.
– Bancor code assumes that ERC20 tokens based on Bancor
are cooperative.
8. We’ve
observed some
token
economics
disasters
Maidsafe
– The decentralized internet platform raised $7m in five hours.
However, they made the mistake of accepting payment in two
currencies (BTC and MSC), and giving a favorable rate to MSC
buyers.
– This led to a temporary ~2x appreciation in the MSC price, as users
rushed in to buy MSC to participate in the sale at the more
favorable rate, but then the price saw a similarly steep drop after
the sale ended.
– Many users converted their BTC to MSC to participate in the sale,
but then the sale closed too quickly for them, leading to them
being stuck with a ~30% loss.
– Running a sale that accepts multiple currencies at a fixed
exchange rate is dangerous and bad. Don’t do it
https://vitalik.ca/general/2017/06/09/sales.html
10. Are the
benefits of
creating a
token worth
the long-term
risks?
– Part of your assessment should be to fully appreciate the idea that
attaching a native token to your platform is a risky proposition.
While it may be beneficial for funding and/or marketing purposes,
there may be more downside than upside
– Remember that the market will psychologically attach the value
of your network to the value of your token, regardless of
whether these should be interlinked.
– As such, if your token is not designed according to robust
economic models and realistic projections, you risk devaluing your
entire network in the eyes of the market, even if your network is
otherwise successful.
https://medium.com/@liesleichholz/read-this-before-you-
design-your-token-bdaa1b65e1be
12. Algo
Auctions
– At every auction, a fixed amount of Algos is available for a fixed
amount of time. During the auction the price of the Algo starts at
an initial price and continues to drop until it hits a reserve price or
all Algos for sale are sold at the auction’s clearing price.The price
declines linearly over time
– Upon auction completion, users can see how many Algos they
received. Everyone who receives Algos will pay the same price per
Algo, the “clearing price.”
https://algorand.foundation/token-dynamics
13. Refund
scheme
– Every Algo purchased in one of our auctions carries
with it a refund policy. Should you be dissatisfied with
your purchase for any reason you may return your Algo
one year post-purchase at up to 90% of the value paid.
The details are as follows:
– If the original auction clearing price is $1 or higher, the refund
amount will be 90 percent of the original purchase price.
– If the original auction clearing price is below $1, the refund
amount will be the original purchase price minus $0.10.
16. Angry
investors
– At 6 pm on June 19, the first Algorand dutch auction began. And in
just four hours, 25 million Algo tokens were sold for $2.4 each,
enabling Algo to raise $60 million dollars.
– Since trading began in late June, the Algo token price has
completely crashed in the secondary market. As of July 29, Algo’s
lowest price was $0.58, which was about 75% lower than the
highest point.
– But since the large plunge in the secondary market that drove the
token price down more than half, the Chinese Algorand
community has become even extremely disheartened.
– Now Chinese investors are claiming that Algo is hurting retail folks
and profiting from “chives”(retail folks), while the accusations of
“Turing award winner cutting the chives” and “pyramid scheme”
began to occur.The mood of the retail investors was so low to the
extent that folks in the Algorand’s officialWeChat community
began asking almost every day, “When is Algo going to zero?”.
Some investors have even began to directly call Algo “zerocoin.”
What Algorand’sToken Price Crash CanTeach Projects
18. Ways to claw
back the
money paid
forALGOs
– As an alternative to the original 90% refund option available to
auction buyers on the first anniversary of the first auction, the
foundation will provide an optional Early Redemption Option
– In order to meet eligibility requirements, participants will have
seven days to return all auction Algos to their designated wallet
starting at 8am SGT on August 2nd, 2019 and ending at midnight
SGT on August 9th, 2019.
– The redemption window will open on August 23rd and will
provide an 85% refund of the clearing price at the first
auction. Refunds will be dispersed via the same currency the
auction account was funded by (USD, BTC, ETH).
20. What are we
looking for?
–Reusable design patterns or
primitives
–Validation or verification
tools/techniques/manual
reasoning approaches
21. Patterns and
primitives
– The most notable primitives areToken Curated
Registries (TCRs) and Curved Bonding.
– Both share the same goal to incentivize token holders
to curate information, but differ in behavior and
output:
– Token Curated Registries give you a binary outcome (i.e. is
this thing “in” or “out” of the registry)
– Curved Bonding systems give you a gradient score of the
relevance of something.
https://blog.coinbase.com/the-emergence-of-
cryptoeconomic-primitives-14ef3300cc10
22. Using design
patterns
– AdChain (whereTCRs originated )usesTCRs for maintaining a list
of domain names accredited as non-fraudulent for advertising
purposes
– The Ocean protocol uses bothTCRs and Curved Bonding in its
decentralized data exchange:TCRs are used for the list of
participants and Curved Bonding is used to rate the relevance of
data.
– Relevant uses Curved Bonding in its social news reader app to
create an “Open Quality Metric” for curation
– Messari usesTCRs to create a decentralized Self-Regulatory
Organization that lists legitimate tokens and cryptocurrency
projects
23. Token
engineering
– “I’d love to see token ecosystem design become an engineering
discipline, side-by-side with electrical engineering, software
engineering, civil engineering, aerospace engineering, and so on.
This implies that token ecosystem design would also become a
field of rigorous analysis, design, and verification. It would have
tools that reconcile theory with practice. It would be guided by a
sense of responsibility. It would be token engineering.”
FromTrent McConaghy
https://blog.oceanprotocol.com/towards-a-practice-of-token-engineering-b02feeeff7ca
24. Incentivai aims
to provide
mechanism
testing for
smart
contracts
– Smart contract mechanism design
is about achieving the desired
behaviour in the real world. For that
to happen, not only does the code
need to be bug-free but also the
mechanism itself must be correct.
– Some contracts go beyond basic
functionality and aim at generating
incentives for certain desired user
behaviours. Examples include
prediction markets, decentralised
oracles, decentralised computing,
decentralised storage,
decentralised data exchange or
content curation.
– Incentivai is code that implements
the procedure described above. It
provides ways to represent smart
contract mechanism design in the
right framework, handles training
of AI agents and provides
interpretable results.
– Altogether, it comprises a
customisable, end-to-end
experimentation platform that can
be used to test smart contracts
prior to deployment. Code
development and first experiments
are in progress.
https://medium.com/incentivai/introducing-incentivai-
41ce8ba87152
25. Experimental
procedure with
Incentivai
– Environment representation design
– state
– action space
– reward structure
– objective function
– Training of agents’ policies
– Quantitative and qualitative analysis of trained agents’ behaviour
in the environment
– Refinement of representation design (back to step 1)
27. Incentivai
simulation
– For example, Incentivai might learn that uneven token distribution leads
to pump and dump schemes, so the developer should more evenly divide
tokens and give fewer to early users.
– Or it might find that an insurance product where users vote on what
claims should be approved needs to increase its bond price that voters
pay for verifying a false claim so that it’s not profitable for voters to take
bribes from fraudsters.