renepickhardt / The-Lightning-Network-Book

An open source and crowdfunded book about Bitcoins Lightning Network to scale blockchain technologies.
Other
165 stars 19 forks source link

Asymmetric cryptographic system properties and examples #9

Open renepickhardt opened 5 years ago

renepickhardt commented 5 years ago

I have put three main properties of asymmetric cryptographic systems in the second section of the book.

  1. Asymmetry: The public key can be derived from the private one
  2. Encryption: the public key can be used for encrypted messages which can be decrypted with the private key
  3. Signatures: private keys can produce signatures which can be verified with the public key

I have just realized that in ECDSA the second property hardly plays a role. There is only a DH key exchange to produce a symmetric key which can be used for de- and encryption.

I think explaining diffie hellman does not make sense in the beginning sections and for lightning I only need it if I go down all the way with the sphinx mix format.

stefanwouldgo commented 5 years ago

I'm not quite convinced that you are writing on the right level of abstraction. I believe that anybody who hasn't understood the basic principle of asymmetric encryption isn't qualified to read a technical book about LN at all. On the other hand, there must be hundreds of really great explanations for this kind of stuff on the Internet.

Maybe you can shorten this stuff very much (most of it feels trivial to me) and give a proper treatment of EC cryptography in the appendix.

conscott commented 5 years ago

I just looked over the first draft on this here

FYI - If you wanted some ECC examples instead of RSA, John Newbery (@jnewbery) has a nice small implementation of secp256k1 here along with some examples in this notebook

jnewbery commented 5 years ago

That code is from Jimmy Song's Programming Blockchain course and is BSD 2-clause licensed. I've updated the file in my repo to include the license and copyright info.