<s>
OpenTimestamps	B-General_Concept
(	O
OTS	O
)	O
is	O
an	O
open-source	B-Application
project	O
that	O
aims	O
to	O
provide	O
a	O
standard	O
format	O
for	O
blockchain	O
timestamping	O
.	O
</s>
<s>
With	O
the	O
advent	O
of	O
systems	O
like	O
Bitcoin	B-Protocol
,	O
it	O
is	O
possible	O
to	O
create	O
and	O
verify	O
proofs	O
of	O
existence	O
of	O
documents	O
(	O
timestamps	O
)	O
without	O
relying	O
on	O
a	O
trusted	O
third	O
party	O
;	O
this	O
represents	O
an	O
enhancement	O
in	O
term	O
of	O
security	O
,	O
since	O
it	O
excludes	O
the	O
possibility	O
of	O
a	O
malicious	O
(	O
or	O
careless	O
)	O
trusted	O
third	O
party	O
to	O
compromise	O
the	O
timestamp	O
.	O
</s>
<s>
Currently	O
,	O
timestamping	O
with	O
Bitcoin	B-Protocol
is	O
fully	O
supported	O
,	O
however	O
the	O
format	O
is	O
flexible	O
enough	O
to	O
support	O
a	O
variety	O
of	O
methods	O
.	O
</s>
<s>
The	O
proof	O
consists	O
in	O
a	O
sequence	O
of	O
commitment	O
operations	O
,	O
such	O
as	O
sha256	B-Algorithm
,	O
append	O
,	O
prepend	O
.	O
</s>
<s>
To	O
verify	O
the	O
commitment	O
,	O
the	O
operations	O
are	O
applied	O
in	O
sequence	O
to	O
the	O
data	O
d	O
,	O
then	O
the	O
result	O
,	O
which	O
should	O
be	O
the	O
transaction	O
merkle	B-Algorithm
root	I-Algorithm
,	O
is	O
checked	O
to	O
be	O
equal	O
to	O
the	O
one	O
observed	O
in	O
the	O
blockchain	O
;	O
if	O
the	O
check	O
goes	O
fine	O
,	O
then	O
one	O
can	O
assert	O
that	O
d	O
existed	O
prior	O
to	O
the	O
block	O
.	O
</s>
<s>
With	O
in	O
Python	B-Language
;	O
</s>
<s>
In	O
the	O
following	O
sections	O
it	O
is	O
shown	O
an	O
example	O
of	O
the	O
usage	O
of	O
the	O
Python	B-Language
client	O
.	O
</s>
<s>
The	O
stamp	O
operation	O
calculates	O
the	O
SHA256	B-Algorithm
hash	I-Algorithm
of	O
the	O
original	O
file	O
,	O
concatenates	O
a	O
random	O
128-bit	O
nonce	O
to	O
maintain	O
privacy	O
,	O
and	O
recalculates	O
the	O
SHA256	B-Algorithm
hash	I-Algorithm
,	O
sending	O
this	O
unique	O
value	O
to	O
the	O
calendar	O
servers	O
.	O
</s>
<s>
Each	O
of	O
the	O
calendar	O
servers	O
will	O
add	O
the	O
received	O
hash	O
to	O
its	O
Merkle	B-Algorithm
tree	I-Algorithm
and	O
return	O
the	O
necessary	O
response	O
to	O
generate	O
the	O
initial	O
OTS	O
file	O
.	O
</s>
<s>
This	O
will	O
communicate	O
with	O
the	O
calendar	O
servers	O
and	O
update	O
the	O
OTS	O
file	O
with	O
the	O
Bitcoin	B-Protocol
block	O
header	O
attestation	O
.	O
</s>
<s>
In	O
that	O
case	O
,	O
the	O
stamp	O
operation	O
will	O
send	O
a	O
single	O
request	O
to	O
the	O
calendar	O
servers	O
with	O
a	O
Merkle	B-Algorithm
root	I-Algorithm
derived	O
from	O
the	O
original	O
files	O
,	O
and	O
later	O
,	O
that	O
same	O
operation	O
will	O
calculate	O
the	O
Merkle	B-Algorithm
tree	I-Algorithm
paths	O
and	O
create	O
the	O
timestamps	O
for	O
each	O
one	O
of	O
the	O
original	O
files	O
.	O
</s>
<s>
The	O
user	O
must	O
also	O
have	O
an	O
up-to-date	O
Bitcoin	B-Protocol
node	B-Protocol
on	O
their	O
own	O
machine	O
to	O
perform	O
the	O
verification	O
without	O
relying	O
on	O
trusted	O
third	O
parties	O
.	O
</s>
<s>
The	O
timestamp	O
is	O
saved	O
in	O
a	O
binary	O
file	O
to	O
save	O
space	O
and	O
avoid	O
problems	O
of	O
interpretation	O
,	O
encoding	B-General_Concept
and	O
compatibility	O
between	O
systems	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
a	O
single	O
attestation	O
of	O
the	O
hello.txt	O
file	O
is	O
shown	O
,	O
which	O
hashes	O
all	O
the	O
way	O
to	O
the	O
Bitcoin	B-Protocol
block	O
header	O
at	O
block	O
518387	O
.	O
</s>
