7

I read the Wiki example, but I am still confused to be honest. Could someone provide a really simple example?

Helmar
  • 1,293
  • 1
  • 15
  • 28
Muppet
  • 908
  • 5
  • 8

1 Answers1

10

Simplified, Lamport One-Time-Signatures (OTS) work as follows. For illustration purposes I am using Bits and not Trits.

Assume you have a private key PRIV that consists of 100 (random) pairs of numbers, so a total of 200. To create your public key PUB you hash each of these 200 numbers, giving you a new sequence of 100 pairs.

Now if you want to sign any message MSG you hash it and you get back a checksum CHECK of (for argument sake) 100 bits. Then you create a sequence SIG consisting of 100 numbers where each element is picked from the 100 pairs of PRIV based on what the bit in CHECK was. For example, if a given bit of CHECK is 0 you take the first number from the pair, if it was 1 you take the second number. Now you publish PUB, MSG and SIG.

If anyone wants to verify your message MSG, they hash it, and depending on the bits in the hash then pick the corresponding number from each of the 100 pairs in your public key PUB. After hashing the 100 numbers that were picked that way, one should arrive at the same signature SIG you provided, thus verifying the message.

This also explains why you shouldn't re-use a One-Time-Signature private key, because every time you use it your signature SIG reveals 50% of your private key.

Zauz
  • 4,454
  • 15
  • 42
Phil-ZXX
  • 1,663
  • 1
  • 11
  • 17