-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 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
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,62 @@ | ||
# SLIP-0077 : Deterministic blinding key derivation for Confidential Transactions | ||
|
||
``` | ||
Number: SLIP-0077 | ||
Title: Deterministic blinding key derivation for Confidential Transactions | ||
Type: Standard | ||
Status: Draft | ||
Authors: Roman Zeyde <mail@romanzey.de> | ||
Created: 2019-06-15 | ||
``` | ||
|
||
## Abstract | ||
|
||
This document describes a method for blinding key derivation | ||
for Confidential Transactions, using a determinstic hierarchy. | ||
|
||
## General design | ||
|
||
In confidential transactions, the sender and the receiver use ECDH to derive a shared nonce, which is then used for hiding/recovering of the actual value and asset type being transacted. | ||
In Elements/Liquid, the receiver uses the following derivation scheme for his ECDH public/private keys: | ||
|
||
``` | ||
blinding_private_key := HMAC_SHA256(key=master_blinding_key, msg=script_pubkey) | ||
blinding_public_key := secp256k1_publickey(private_key=blinding_private_key) | ||
``` | ||
|
||
The receiver is using `blinding_public_key` construct a "blinded address", which is used by the sender to blind the relevant transaction outputs. Each such blinded transaction output also contains the sender's ECDH public key, so the receiver would be able to recover the shared nonce using its `blinding_private_key`. | ||
|
||
An additional use-case is sharing some/all of the receiver's blinding private keys with an external auditor, allowing unblinding the audited outputs without being able to spend them. | ||
|
||
## Design details | ||
|
||
### Master blinding key derivation | ||
|
||
In order to use similar blinding key derivation scheme on TREZOR, we suggest using [SLIP-0021](https://github.com/satoshilabs/slips/blob/master/slip-0021.md) derivation scheme for `master_blinding_key`: | ||
|
||
``` | ||
domain := b"Symmetric key seed" | ||
root := HMAC_SHA512(key=domain, msg=seed) | ||
label := b"SLIP-0077" | ||
node := HMAC_SHA512(key=root[0:32], msg=(b"\x00" + label)) | ||
master_blinding_key := node[32:64] | ||
``` | ||
|
||
### Shared nonce derivation | ||
|
||
The shared nonce is derived using ECDH and double-SHA256 of the compressed shared public key: | ||
|
||
``` | ||
shared := secp256k1_multiply(blinding_private_key, sender_public_key, compressed=True) | ||
nonce := SHA256(SHA256(shared)) | ||
``` | ||
|
||
## References | ||
|
||
* [An investigation into Confidential Transactions](https://github.com/AdamISZ/ConfidentialTransactionsDoc/blob/master/essayonCT.pdf) | ||
* [Confidential Transactions tutorial](https://elementsproject.org/elements-code-tutorial/confidential-transactions#blindingkey) | ||
* [Liquid Developer Guide](https://docs.blockstream.com/liquid/developer-guide/developer-guide-index.html#confidential-transactions) | ||
* [Elements' blinding key derivation](https://github.com/ElementsProject/elements/blob/a6beb256ed5195c2a1014a34fdf354d5797247a8/src/wallet/wallet.cpp#L5594) | ||
* [Elements' output unblinding using ECDH](https://github.com/ElementsProject/elements/blob/66c015529e7846f8491bcafd986326bcafc1bfcb/src/blind.cpp#L53) |