[bitcoin-dev] Fwd: [ots-dev] miniOTS: ots proofs that fit in a tweet

2019-06-05 Thread Bryan Bishop via bitcoin-dev
-- Forwarded message -
From: William Casarin 
Date: Wed, Jun 5, 2019 at 9:13 AM
Subject: [ots-dev] miniOTS: ots proofs that fit in a tweet
To: 



Hello OTS people,

Following from my previous post about cleartext OTS proof sharing[1],
I've been working on a new OTS format called miniOTS, which is
minimal/compressed format that allows attestations to fit in a tweet[2]
and for other space constrained contexts.

Just stripping out additional attestations in the standard format only
gets it down to just above ~280 bytes when base58 encoded, which is too
much for a tweet, so I decided to roll a custom format that is a bit
more efficient with attestation and op tags.

The goal was to have small enoughs proofs that I could reply to a tweet
with the stamp of the previous message, instead of relying on external
sites such as @otsproofbot


Current format (210 bytes, 288 bytes base58-encoded):

: 004f 7065 6e54 696d 6573 7461 6d70 7300  .OpenTimestamps.
0010: 0050 726f 6f66 00bf 89e2 e884 e892 9401  .Proof..
0020: 08cb 2d4a f572 8d44 a5b0 7c7b f1ff 78a9  ..-J.r.D..|{..x.
0030: 1818 7270 13f1 9bbd f4b0 344b 9e93 0c6b  ..rp..4K...k
0040: 39f0 1020 34fe cad9 edef bab0 3420 e4ee  9.. 4...4 ..
0050: d3a7 c608 fff0 107c 31f7 da6c dbf2 3271  ...|1..l..2q
0060: 904c c5dd f58d eb08 f120 e4f7 3eaf a747  .L... ..>..G
0070: 324a f096 1aa0 928d e1c1 91bf 3c38 237d  2J..<8#}
0080: d412 c1c0 e94c d4ae 3f76 08f1 045c 4cb3  .L..?v...\L.
0090: a4f0 08f7 834d 4b14 68fd 41ff 0083 dfe3  .MK.h.A.
00a0: 0d2e f90c 8e2c 2b68 7474 7073 3a2f 2f62  .,+https://b
00b0: 6f62 2e62 7463 2e63 616c 656e 6461 722e  ob.btc.calendar.
00c0: 6f70 656e 7469 6d65 7374 616d 7073 2e6f  opentimestamps.o
00d0: 7267 rg

miniOTS format (133 bytes, 183 bytes base58-encoded):

: 6f74 7301 8a20 34fe cad9 edef bab0 3420  ots.. 4...4
0010: e4ee d3a7 c683 8a7c 31f7 da6c dbf2 3271  ...|1..l..2q
0020: 904c c5dd f58d eb83 8be4 f73e afa7 4732  .L.>..G2
0030: 4af0 961a a092 8de1 c191 bf3c 3823 7dd4  J..<8#}.
0040: 12c1 c0e9 4cd4 ae3f 7683 8b5c 4cb3 a48a  L..?v..\L...
0050: f783 4d4b 1468 fd41 9a2b 6874 7470 733a  ..MK.h.A.+https:
0060: 2f2f 626f 622e 6274 632e 6361 6c65 6e64  //bob.btc.calend
0070: 6172 2e6f 7065 6e74 696d 6573 7461 6d70  ar.opentimestamp
0080: 732e 6f72 67 s.org


base58 before:

12j6JNmon36jC1MMcpvC8nHqg5p8DAT2mmPQ5aLaBmAbk8naEVt8HFVohRqkuMXZF2Wo2n9kv
5ByeL17yUww4NHuFyCT6PXsGxRuEZ12Z33gsLbXL5FuFmnvMLd3tzf76n69J7qxLPxmoAgm1z
9NEMi2MRypDNKy1GypGN5NLwerzy1nU5g5dZxV6TZ5rBs4gYqnMNJn9VMkfKeDSZ9M8aoMWrL
ShokXUpnS1qrqkTvTwyKMx17fhKfcP9FyhNkb81t8dwYLtBsN4QuP9UAktMUvjEoBzHt

base58 after:

6gQjQUehytgUevKLRtAFYbC6UJX72LCDgVWxAUPsCt3tqEVTEQfmUB1T1Y1GTyY8sugiPY97K
gWRPPXYJmH3J5jqVtyNLrzdkySM6VAYDVckya9BxbUbFB8Gs4U3LHEauTmgCPEhGhiRdC3eFW
63SwfAvKB8Q8Ku8ZM9uASCwWZ8K2AoVabuAn


You can check it out here:

  git clone https://git.sr.ht/~jb55/ots-tool

This is still a work in progress, I haven't built the miniOTS -> OTS
decoder yet.

make
./otsmini file.ots


Cheers,
Will


[1] id:878t1fzn0v@jb55.com
[2] https://twitter.com/jb55/status/1136260220521336832


-- 
- Bryan
http://heybryan.org/
1 512 203 0507
___
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


Re: [bitcoin-dev] OP_SECURETHEBAG (supersedes OP_CHECKOUTPUTSVERIFY)

2019-06-05 Thread Anthony Towns via bitcoin-dev
On Fri, May 31, 2019 at 10:35:45PM -0700, Jeremy via bitcoin-dev wrote:
> OP_CHECKOUTPUTSHASHVERIFY is retracted in favor of OP_SECURETHEBAG*.

I think you could generalise that slightly and make it fit in
with the existing opcode naming by calling it something like
"OP_CHECKTXDIGESTVERIFY" and pull a 33-byte value from the stack,
consisting of a sha256 hash and a sighash-byte, and adding a new sighash
value corresponding to the set of info you want to include in the hash,
which I think sounds a bit like "SIGHASH_EXACTLY_ONE_INPUT | SIGHASH_ALL"

FWIW, I'm not really seeing any reason to complicate the spec to ensure
the digest is precommitted as part of the opcode.

Cheers,
aj

___
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev