From 6ef6f107fb0607abd3241bdcc13b68e7bb3945f4 Mon Sep 17 00:00:00 2001 From: ertosns Date: Thu, 19 Oct 2023 18:27:39 +0300 Subject: [PATCH] [src/crypto] crypto spec keypair, note --- doc/src/architecture/crypto/keypair.md | 11 +++++++++++ doc/src/architecture/crypto/note.md | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 doc/src/architecture/crypto/keypair.md create mode 100644 doc/src/architecture/crypto/note.md diff --git a/doc/src/architecture/crypto/keypair.md b/doc/src/architecture/crypto/keypair.md new file mode 100644 index 000000000000..f92f1c544e5e --- /dev/null +++ b/doc/src/architecture/crypto/keypair.md @@ -0,0 +1,11 @@ +# keypair + +key pair over the elliptic curve finite field with generator `g` + +## secret key + +secret key `sk` is a finite field element over the elliptic curve. + +## public key + +public key `pk` is a finite field element over the elliptic curve $g*sk$ diff --git a/doc/src/architecture/crypto/note.md b/doc/src/architecture/crypto/note.md new file mode 100644 index 000000000000..bdfd3b354072 --- /dev/null +++ b/doc/src/architecture/crypto/note.md @@ -0,0 +1,18 @@ +# note +coin is stream cipher encrypted with symmetric key `key` derived from shared key[^1]. +`key` = hash(sharedSecret, ephemeralKey) +$sharedSecret = ephemeralSecret \mul publicKey$ where `publicKey` is recipient public key. based off diffie-hellman shared secret. + +## payment note +Note = (sn, value, tokenId, spendHook, data, blind^{value}, blind^{token}, memo) + +| note | description | +|-----------------|--------------------------------| +| sn | serial number sampled at random| +| value | payment value | +| tokenId | token id | +| spendHook | coin related contract | +| data | data used by the coin contract | +| $blind^{value}$ | value commitment blinding term | +| $blind^{token}$ | token commitment blinding term | +| memo | arbitrary data |