<s>
A	O
smart	B-Application
contract	I-Application
is	O
a	O
computer	B-Application
program	I-Application
or	O
a	O
transaction	O
protocol	O
that	O
is	O
intended	O
to	O
automatically	O
execute	O
,	O
control	O
or	O
document	O
events	O
and	O
actions	O
according	O
to	O
the	O
terms	O
of	O
a	O
contract	O
or	O
an	O
agreement	O
.	O
</s>
<s>
The	O
objectives	O
of	O
smart	B-Application
contracts	I-Application
are	O
the	O
reduction	O
of	O
need	O
for	O
trusted	O
intermediators	O
,	O
arbitration	O
costs	O
,	O
and	O
fraud	O
losses	O
,	O
as	O
well	O
as	O
the	O
reduction	O
of	O
malicious	O
and	O
accidental	O
exceptions	O
.	O
</s>
<s>
Smart	B-Application
contracts	I-Application
are	O
commonly	O
associated	O
with	O
cryptocurrencies	O
,	O
and	O
the	O
smart	B-Application
contracts	I-Application
introduced	O
by	O
Ethereum	B-Application
are	O
generally	O
considered	O
a	O
fundamental	O
building	O
block	O
for	O
decentralized	B-Protocol
finance	I-Protocol
(	O
DeFi	B-Protocol
)	O
and	O
NFT	O
applications	O
.	O
</s>
<s>
Vending	O
machines	O
are	O
mentioned	O
as	O
the	O
oldest	O
piece	O
of	O
technology	O
equivalent	O
to	O
smart	B-Application
contract	I-Application
implementation	O
.	O
</s>
<s>
The	O
original	O
Ethereum	B-Application
white	O
paper	O
by	O
Vitalik	O
Buterin	O
in	O
2014	O
describes	O
the	B-General_Concept
Bitcoin	I-General_Concept
protocol	I-General_Concept
as	O
a	O
weak	O
version	O
of	O
the	O
smart	B-Application
contract	I-Application
concept	O
as	O
originally	O
defined	O
by	O
Nick	O
Szabo	O
,	O
and	O
proposed	O
a	O
stronger	O
version	O
based	O
on	O
the	O
Solidity	B-Protocol
language	O
,	O
which	O
is	O
Turing	B-Algorithm
complete	I-Algorithm
.	O
</s>
<s>
Since	O
Bitcoin	B-Protocol
,	O
various	O
cryptocurrencies	O
have	O
supported	O
programming	O
languages	O
which	O
allow	O
for	O
more	O
advanced	O
smart	B-Application
contracts	I-Application
between	O
untrusted	O
parties	O
.	O
</s>
<s>
A	O
smart	B-Application
contract	I-Application
should	O
not	O
be	O
confused	O
with	O
a	O
smart	O
legal	O
contract	O
,	O
which	O
refers	O
to	O
a	O
traditional	O
,	O
natural-language	O
,	O
legally-binding	O
agreement	O
that	O
has	O
selected	O
terms	O
expressed	O
and	O
implemented	O
in	O
machine-readable	O
code	O
.	O
</s>
<s>
Smart	B-Application
contracts	I-Application
were	O
first	O
proposed	O
in	O
the	O
early	O
1990s	O
by	O
Nick	O
Szabo	O
,	O
who	O
coined	O
the	O
term	O
,	O
using	O
it	O
to	O
refer	O
to	O
"	O
a	O
set	O
of	O
promises	O
,	O
specified	O
in	O
digital	O
form	O
,	O
including	O
protocols	O
within	O
which	O
the	O
parties	O
perform	O
on	O
these	O
promises	O
"	O
.	O
</s>
<s>
In	O
1998	O
,	O
the	O
term	O
was	O
used	O
to	O
describe	O
objects	O
in	O
rights	O
management	O
service	O
layer	O
of	O
the	O
system	O
The	O
Stanford	O
Infobus	O
,	O
which	O
was	O
a	O
part	O
of	O
Stanford	B-Application
Digital	I-Application
Library	I-Application
Project	I-Application
.	O
</s>
<s>
A	O
smart	B-Application
contract	I-Application
does	O
not	O
typically	O
constitute	O
a	O
valid	O
binding	O
agreement	O
at	O
law	O
,	O
although	O
a	O
smart	O
legal	O
contract	O
is	O
intended	O
to	O
be	O
both	O
executable	O
by	O
a	O
machine	O
and	O
legally	O
enforceable	O
.	O
</s>
<s>
Smart	B-Application
contracts	I-Application
are	O
not	O
legal	O
agreements	O
,	O
but	O
rather	O
means	O
of	O
performing	O
obligations	O
deriving	O
from	O
agreements	O
that	O
can	O
be	O
executed	O
automatically	O
by	O
a	O
computer	B-Application
program	I-Application
or	O
a	O
transaction	O
protocol	O
,	O
such	O
as	O
technological	O
means	O
for	O
the	O
automation	O
of	O
payment	O
obligations	O
or	O
obligations	O
consisting	O
in	O
the	O
transfer	O
of	O
tokens	O
or	O
cryptocurrencies	O
.	O
</s>
<s>
Some	O
scholars	O
have	O
argued	O
that	O
the	O
imperative	O
or	O
declarative	O
nature	O
of	O
programming	O
languages	O
would	O
impact	O
the	O
legal	O
validity	O
of	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
Since	O
the	O
2015	O
launch	O
of	O
the	O
Ethereum	B-Application
blockchain	B-Application
,	O
the	O
term	O
"	O
smart	B-Application
contract	I-Application
"	O
has	O
been	O
more	O
specifically	O
applied	O
toward	O
the	O
notion	O
of	O
general	O
purpose	O
computation	O
that	O
takes	O
place	O
on	O
a	O
blockchain	B-Application
or	O
distributed	O
ledger	O
.	O
</s>
<s>
The	O
US	O
National	O
Institute	O
of	O
Standards	O
and	O
Technology	O
describes	O
a	O
"	O
smart	B-Application
contract	I-Application
"	O
as	O
a	O
"	O
collection	O
of	O
code	O
and	O
data	O
(	O
sometimes	O
referred	O
to	O
as	O
functions	O
and	O
state	O
)	O
that	O
is	O
deployed	O
using	O
cryptographically	O
signed	O
transactions	O
on	O
the	O
blockchain	B-Application
network	O
"	O
.	O
</s>
<s>
In	O
this	O
interpretation	O
,	O
used	O
for	O
example	O
by	O
the	O
Ethereum	B-Application
Foundation	I-Application
or	O
IBM	O
,	O
a	O
smart	B-Application
contract	I-Application
is	O
not	O
necessarily	O
related	O
to	O
the	O
classical	O
concept	O
of	O
a	O
contract	O
,	O
but	O
can	O
be	O
any	O
kind	O
of	O
computer	B-Application
program	I-Application
.	O
</s>
<s>
A	O
smart	B-Application
contract	I-Application
also	O
can	O
be	O
regarded	O
as	O
a	O
secured	O
stored	B-General_Concept
procedure	I-General_Concept
,	O
as	O
its	O
execution	O
and	O
codified	O
effects	O
(	O
like	O
the	O
transfer	O
of	O
value	O
between	O
parties	O
)	O
are	O
strictly	O
enforced	O
and	O
cannot	O
be	O
manipulated	O
;	O
after	O
a	O
transaction	O
with	O
specific	O
contract	O
details	O
is	O
stored	O
into	O
a	O
blockchain	B-Application
or	O
distributed	O
ledger	O
,	O
it	O
cannot	O
be	O
changed	O
.	O
</s>
<s>
In	O
2017	O
,	O
by	O
implementing	O
the	O
Decree	O
on	O
Development	O
of	O
Digital	O
Economy	O
,	O
Belarus	O
has	O
become	O
the	O
first-ever	O
country	O
to	O
legalize	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
Belarusian	O
lawyer	O
Denis	O
Aleinikov	O
is	O
considered	O
to	O
be	O
the	O
author	O
of	O
a	O
smart	B-Application
contract	I-Application
legal	O
concept	O
introduced	O
by	O
the	O
decree	O
.	O
</s>
<s>
In	O
2018	O
,	O
a	O
US	O
Senate	O
report	O
said	O
:	O
"	O
While	O
smart	B-Application
contracts	I-Application
might	O
sound	O
new	O
,	O
the	O
concept	O
is	O
rooted	O
in	O
basic	O
contract	O
law	O
.	O
</s>
<s>
With	O
smart	B-Application
contracts	I-Application
,	O
a	O
program	O
enforces	O
the	O
contract	O
built	O
into	O
the	O
code.	O
"	O
</s>
<s>
A	O
number	O
of	O
states	O
in	O
the	O
US	O
have	O
passed	O
legislation	O
on	O
the	O
use	O
of	O
smart	B-Application
contracts	I-Application
,	O
such	O
as	O
Arizona	O
,	O
Nevada	O
,	O
Tennessee	O
,	O
and	O
Wyoming	O
.	O
</s>
<s>
And	O
in	O
April	O
2020	O
,	O
Iowa	O
's	O
House	O
of	O
Representatives	O
passed	O
a	O
bill	O
legally	O
recognizing	O
smart	B-Application
contracts	I-Application
in	O
the	O
state	O
.	O
</s>
<s>
In	O
April	O
2021	O
,	O
the	O
UK	O
Jurisdiction	O
Taskforce	O
(	O
UKJT	O
)	O
published	O
the	O
Digital	O
Dispute	O
Resolution	O
Rules	O
(	O
the	O
Digital	O
DR	O
Rules	O
)	O
to	O
help	O
enable	O
the	O
rapid	O
resolution	O
of	O
blockchain	B-Application
and	O
crypto	O
legal	O
disputes	O
in	O
Britain	O
.	O
</s>
<s>
Similar	O
to	O
a	O
transfer	O
of	O
value	O
on	O
a	O
blockchain	B-Application
,	O
deployment	O
of	O
a	O
smart	B-Application
contract	I-Application
on	O
a	O
blockchain	B-Application
occurs	O
by	O
sending	O
a	O
transaction	O
from	O
a	O
wallet	B-Protocol
for	O
the	O
blockchain	B-Application
.	O
</s>
<s>
The	O
transaction	O
includes	O
the	O
compiled	O
code	O
for	O
the	O
smart	B-Application
contract	I-Application
as	O
well	O
as	O
a	O
special	O
receiver	O
address	O
.	O
</s>
<s>
That	O
transaction	O
must	O
then	O
be	O
included	O
in	O
a	O
block	O
that	O
is	O
added	O
to	O
the	O
blockchain	B-Application
,	O
at	O
which	O
point	O
the	O
smart	B-Application
contract	I-Application
's	O
code	O
will	O
execute	O
to	O
establish	O
the	O
initial	O
state	O
of	O
the	O
smart	B-Application
contract	I-Application
.	O
</s>
<s>
Byzantine	B-Operating_System
fault-tolerant	I-Operating_System
algorithms	O
secure	O
the	O
smart	B-Application
contract	I-Application
in	O
a	O
decentralized	O
way	O
from	O
attempts	O
to	O
tamper	O
with	O
it	O
.	O
</s>
<s>
Once	O
a	O
smart	B-Application
contract	I-Application
is	O
deployed	O
,	O
it	O
cannot	O
be	O
updated	O
.	O
</s>
<s>
Smart	B-Application
contracts	I-Application
on	O
a	O
blockchain	B-Application
can	O
store	O
arbitrary	O
state	O
and	O
execute	O
arbitrary	O
computations	O
.	O
</s>
<s>
End	O
clients	O
interact	O
with	O
a	O
smart	B-Application
contract	I-Application
through	O
transactions	O
.	O
</s>
<s>
Such	O
transactions	O
with	O
a	O
smart	B-Application
contract	I-Application
can	O
invoke	O
other	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
These	O
transactions	O
might	O
result	O
in	O
changing	O
the	O
state	O
and	O
sending	O
coins	O
from	O
one	O
smart	B-Application
contract	I-Application
to	O
another	O
or	O
from	O
one	O
account	O
to	O
another	O
.	O
</s>
<s>
The	O
most	O
popular	O
blockchain	B-Application
for	O
running	O
smart	B-Application
contracts	I-Application
is	O
Ethereum	B-Application
.	O
</s>
<s>
On	O
Ethereum	B-Application
,	O
smart	B-Application
contracts	I-Application
are	O
typically	O
written	O
in	O
a	O
Turing-complete	O
programming	O
language	O
called	O
Solidity	B-Protocol
,	O
and	O
compiled	O
into	O
low-level	O
bytecode	O
to	O
be	O
executed	O
by	O
the	O
Ethereum	B-Application
Virtual	O
Machine	O
.	O
</s>
<s>
Some	O
of	O
the	O
other	O
smart	B-Application
contract	I-Application
programming	O
languages	O
missing	O
Turing-completeness	O
are	O
Simplicity	O
,	O
Scilla	O
,	O
Ivy	O
and	O
Bitcoin	B-Protocol
Script	O
.	O
</s>
<s>
However	O
,	O
measurements	O
in	O
2020	O
using	O
regular	B-Language
expressions	I-Language
showed	O
that	O
only	O
35.3	O
%	O
of	O
53,757	O
Ethereum	B-Application
smart	B-Application
contracts	I-Application
at	O
that	O
time	O
included	O
recursions	O
and	O
loops	O
—	O
constructs	O
connected	O
to	O
the	O
halting	O
problem	O
.	O
</s>
<s>
Several	O
languages	O
are	O
designed	O
to	O
enable	O
formal	O
verification	O
:	O
Bamboo	O
,	O
IELE	O
,	O
Simplicity	O
,	O
Michelson	O
(	O
can	O
be	O
verified	O
with	O
Coq	B-Application
)	O
,	O
Liquidity	O
(	O
compiles	O
to	O
Michelson	O
)	O
,	O
Scilla	O
,	O
DAML	O
and	O
Pact	O
.	O
</s>
<s>
+	O
Notable	O
examples	O
of	O
blockchain	B-Application
platforms	O
supporting	O
smart	B-Application
contracts	I-Application
include	O
the	O
following	O
:	O
Name	O
Description	O
Ethereum	B-Application
Implements	O
a	O
Turing-complete	O
language	O
on	O
its	O
blockchain	B-Application
,	O
a	O
prominent	O
smart	B-Application
contract	I-Application
framework	O
Bitcoin	B-Protocol
Provides	O
a	O
Turing-incomplete	O
script	O
language	O
that	O
allows	O
the	O
creation	O
of	O
custom	O
smart	B-Application
contracts	I-Application
on	O
top	O
of	O
Bitcoin	B-Protocol
like	O
multisignature	O
accounts	O
,	O
payment	O
channels	O
,	O
escrows	O
,	O
time	O
locks	O
,	O
atomic	O
cross-chain	O
trading	O
,	O
oracles	O
,	O
or	O
multi-party	O
lottery	O
with	O
no	O
operator	O
.	O
</s>
<s>
Processes	O
on	O
a	O
blockchain	B-Application
are	O
generally	O
deterministic	O
in	O
order	O
to	O
ensure	O
Byzantine	O
fault-tolerance	O
.	O
</s>
<s>
Nevertheless	O
,	O
real	O
world	O
application	O
of	O
smart	B-Application
contracts	I-Application
,	O
such	O
as	O
lotteries	O
and	O
casinos	B-Application
,	O
require	O
secure	O
randomness	O
.	O
</s>
<s>
In	O
fact	O
,	O
blockchain	B-Application
technology	I-Application
reduces	O
the	O
costs	O
for	O
conducting	O
of	O
a	O
lottery	O
and	O
is	O
therefore	O
beneficial	O
for	O
the	O
participants	O
.	O
</s>
<s>
Randomness	O
on	O
blockchain	B-Application
can	O
be	O
implemented	O
by	O
using	O
block	O
hashes	O
or	O
timestamps	O
,	O
oracles	O
,	O
commitment	O
schemes	O
,	O
special	O
smart	B-Application
contracts	I-Application
like	O
RANDAO	O
and	O
Quanta	O
,	O
as	O
well	O
as	O
sequences	O
from	O
mixed	O
strategy	O
Nash	O
equilibria	O
.	O
</s>
<s>
In	O
1998	O
,	O
Szabo	O
proposed	O
that	O
smart	B-Application
contract	I-Application
infrastructure	O
can	O
be	O
implemented	O
by	O
replicated	O
asset	O
registries	O
and	O
contract	O
execution	O
using	O
cryptographic	B-Algorithm
hash	I-Algorithm
chains	I-Algorithm
and	O
Byzantine	B-Operating_System
fault-tolerant	I-Operating_System
replication	O
.	O
</s>
<s>
Askemos	O
implemented	O
this	O
approach	O
in	O
2002	O
using	O
Scheme	B-Language
(	O
later	O
adding	O
SQLite	B-Language
)	O
as	O
the	O
contract	O
script	O
language	O
.	O
</s>
<s>
One	O
proposal	O
for	O
using	O
bitcoin	B-Protocol
for	O
replicated	O
asset	O
registration	O
and	O
contract	O
execution	O
is	O
called	O
"	O
colored	B-Protocol
coins	I-Protocol
"	O
.	O
</s>
<s>
,	O
UBS	O
was	O
experimenting	O
with	O
"	O
smart	O
bonds	O
"	O
that	O
use	O
the	O
bitcoin	B-Protocol
blockchain	B-Application
in	O
which	O
payment	O
streams	O
could	O
hypothetically	O
be	O
fully	O
automated	O
,	O
creating	O
a	O
self-paying	O
instrument	O
.	O
</s>
<s>
Inheritance	B-Language
wishes	O
could	O
hypothetically	O
be	O
implemented	O
automatically	O
upon	O
registration	O
of	O
a	O
death	O
certificate	O
by	O
means	O
of	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
Birth	O
certificates	O
can	O
also	O
work	O
together	O
with	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
Chris	O
Snook	O
of	O
Inc.com	O
suggests	O
smart	B-Application
contracts	I-Application
could	O
also	O
be	O
used	O
to	O
handle	O
real	O
estate	O
transactions	O
and	O
could	O
be	O
used	O
in	O
the	O
field	O
of	O
title	O
records	O
and	O
in	O
the	O
public	O
register	O
.	O
</s>
<s>
Seth	O
Oranburg	O
and	O
Liya	O
Palagashvili	O
argue	O
that	O
smart	B-Application
contracts	I-Application
could	O
also	O
be	O
used	O
in	O
employment	O
contracts	O
,	O
especially	O
temporary	O
employment	O
contracts	O
,	O
which	O
according	O
to	O
them	O
would	O
benefit	O
the	O
employer	O
.	O
</s>
<s>
The	O
transactions	O
data	O
from	O
a	O
blockchain-based	O
smart	B-Application
contract	I-Application
is	O
visible	O
to	O
all	O
users	O
in	O
the	O
blockchain	B-Application
.	O
</s>
<s>
Such	O
an	O
attack	O
,	O
difficult	O
to	O
fix	O
quickly	O
,	O
was	O
successfully	O
executed	O
on	O
The	B-Protocol
DAO	I-Protocol
in	O
June	O
2016	O
,	O
draining	O
approximately	O
million	O
worth	O
of	O
Ether	B-Application
at	O
the	O
time	O
,	O
while	O
developers	O
attempted	O
to	O
come	O
to	O
a	O
solution	O
that	O
would	O
gain	O
consensus	O
.	O
</s>
<s>
The	B-Protocol
DAO	I-Protocol
program	O
had	O
a	O
time	O
delay	O
in	O
place	O
before	O
the	O
hacker	O
could	O
remove	O
the	O
funds	O
;	O
a	O
hard	O
fork	O
of	O
the	O
Ethereum	B-Application
software	O
was	O
done	O
to	O
claw	O
back	O
the	O
funds	O
from	O
the	O
attacker	O
before	O
the	O
time	O
limit	O
expired	O
.	O
</s>
<s>
Other	O
high-profile	O
attacks	O
include	O
the	O
Parity	O
multisignature	O
wallet	B-Protocol
attacks	O
,	O
and	O
an	O
integer	O
underflow/overflow	O
attack	O
(	O
2018	O
)	O
,	O
totaling	O
over	O
million	O
.	O
</s>
<s>
Issues	O
in	O
Ethereum	B-Application
smart	B-Application
contracts	I-Application
,	O
in	O
particular	O
,	O
include	O
ambiguities	O
and	O
easy-but-insecure	O
constructs	O
in	O
its	O
contract	O
language	O
Solidity	B-Protocol
,	O
compiler	O
bugs	O
,	O
Ethereum	B-Application
Virtual	O
Machine	O
bugs	O
,	O
attacks	O
on	O
the	O
blockchain	B-Application
network	O
,	O
the	O
immutability	O
of	O
bugs	O
and	O
that	O
there	O
is	O
no	O
central	O
source	O
documenting	O
known	O
vulnerabilities	O
,	O
attacks	O
and	O
problematic	O
constructs	O
.	O
</s>
<s>
Smart	O
legal	O
contracts	O
are	O
distinct	O
from	O
smart	B-Application
contracts	I-Application
.	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
a	O
smart	B-Application
contract	I-Application
is	O
not	O
necessarily	O
legally	O
enforceable	O
as	O
a	O
contract	O
.	O
</s>
<s>
Therefore	O
,	O
while	O
every	O
smart	O
legal	O
contract	O
will	O
contain	O
some	O
elements	O
of	O
a	O
smart	B-Application
contract	I-Application
,	O
not	O
every	O
smart	B-Application
contract	I-Application
will	O
be	O
a	O
smart	O
legal	O
contract	O
.	O
</s>
