Skip to content

Commit

Permalink
Create slip-0077.md
Browse files Browse the repository at this point in the history
  • Loading branch information
romanz committed Jun 27, 2019
1 parent c830761 commit 2992f3f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Each SLIP should provide a concise technical specification of the feature and a
| [SLIP-0039](slip-0039.md) | Shamir's Secret-Sharing for Mnemonic Codes | Standard | Draft |
| [SLIP-0044](slip-0044.md) | Registered coin types for BIP-0044 | Standard | Draft |
| [SLIP-0048](slip-0048.md) | Deterministic key hierarchy for Graphene-based networks | Standard | Draft |
| [SLIP-0077](slip-0077.md) | Deterministic blinding key derivation for Confidential Transactions | Standard | Draft |
| [SLIP-0132](slip-0132.md) | Registered HD version bytes for BIP-0032 | Standard | Draft |
| [SLIP-0173](slip-0173.md) | Registered human-readable parts for BIP-0173 | Standard | Draft |

Expand Down
62 changes: 62 additions & 0 deletions slip-0077.md
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)

0 comments on commit 2992f3f

Please sign in to comment.