-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[src/crypto] crypto spec keypair, note
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | |