Skip to content
Open
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
6c0132d
Create dip-ct.md
hushmirror Nov 6, 2024
b63e46e
Remove implementation-specific details
hushmirror Nov 26, 2024
1b855e9
Define exactly how a CT address is calculated
hushmirror Nov 26, 2024
22fc36e
Update dip-ct.md
hushmirror Dec 13, 2024
0f3922c
Update dip-ct.md
hushmirror Dec 13, 2024
1c1a354
Update dip-ct.md
hushmirror Dec 13, 2024
3519b90
Add original Pederson paper as reference
hushmirror Dec 13, 2024
ce1a18c
Update dip-ct.md
hushmirror Dec 17, 2024
34f767e
Update dip-ct.md
hushmirror Dec 17, 2024
f1ef67b
Update dip-ct.md
hushmirror Dec 17, 2024
dc7f919
Update dip-ct.md
hushmirror Dec 17, 2024
7a16879
Update dip-ct.md
hushmirror Dec 17, 2024
e9f81da
Add direct link to Pederson paper
hushmirror Dec 17, 2024
846e876
Add additional Pedersen reference
hushmirror Dec 17, 2024
ea0671e
Fix the spelling of Pedersen
hushmirror Dec 17, 2024
0b133d4
Update dip-ct.md
hushmirror Dec 17, 2024
fd0d6be
Add refs for secp256k1 and curve25519
hushmirror Dec 17, 2024
a8e329e
Describe reasoning behind CT address calculation
hushmirror Dec 17, 2024
b223cc8
More details about consensus rule changes and activation
hushmirror Dec 17, 2024
a3708c4
Update dip-ct.md
hushmirror Jan 8, 2025
a050397
Update dip-ct.md
hushmirror Jan 12, 2025
3a7abb9
Update dip-ct.md
hushmirror Jan 12, 2025
26faedd
Tweak and explain notation
hushmirror Jan 14, 2025
1bd7573
Better explain additive/multiplicative notation
hushmirror Jan 14, 2025
465e9c6
Update dip-ct.md
hushmirror Jan 14, 2025
9cf7d3a
More explanation about additive/multiplicative notation
hushmirror Jan 14, 2025
c91ab07
Update ConfidentialAmount
hushmirror Jan 14, 2025
89102b9
Update ConfidentialNonce
hushmirror Jan 14, 2025
7cac96a
Use 2^52 - 1 instead of MAX_MONEY
hushmirror Jan 14, 2025
ef058ea
Add reference to Elements confidential addresses
hushmirror Jan 15, 2025
f56afaf
Add ref to elements confidential transactions
hushmirror Jan 15, 2025
50cc11e
Mention HD wallet master blinding keys
hushmirror Jan 15, 2025
17533c1
Add ref to SLIP-0077
hushmirror Jan 15, 2025
46cd72f
Describe how blinding keys for an address are created
hushmirror Jan 15, 2025
53b8f84
Fix formatting
hushmirror Jan 15, 2025
d71a1c1
Update dip-ct.md
hushmirror Jan 15, 2025
65d4144
Add bulletproof notes ref
hushmirror Jan 15, 2025
e7cb62e
Add various useful refs
hushmirror Jan 15, 2025
68ce8d2
Fix typo
hushmirror Jan 15, 2025
d286714
Improve explanation of fee
hushmirror Jan 16, 2025
4cdc00c
Update dip-ct.md
hushmirror Jan 16, 2025
de7728d
Update details about CT addresses
hushmirror Jan 22, 2025
1aa4fe4
Add Risk section and reference to BIP360
hushmirror Jan 22, 2025
04d918b
Max value of range proof must be 2^N - 1
hushmirror Jan 22, 2025
db97c5d
Update dip-ct.md
hushmirror Feb 8, 2025
81a320f
Update description of coinjoin
hushmirror Feb 8, 2025
9b35642
Update dip-ct.md
hushmirror Feb 9, 2025
bc812b8
Mention Shor's algorithm and add to references
hushmirror Feb 9, 2025
bc37f9a
Update Overview as per review comments
hushmirror Feb 9, 2025
ee9b162
Fix formatting of Vector<>'s
hushmirror Feb 12, 2025
937aeb1
Define tx input structure
hushmirror Feb 12, 2025
fbbb1be
ConfidentialProof lenths cannot be null
hushmirror Feb 13, 2025
918b693
Update ConfidentialAmount
hushmirror Feb 18, 2025
d4d0989
Explain how ECDH works in a CT
hushmirror Feb 18, 2025
06fd9f1
Document that public blinding key not is hashed in a CT address
hushmirror Feb 27, 2025
6d2b56a
Fix review nit
hushmirror Mar 20, 2025
19a8dad
Specify base58 prefixes for testnet+regtest
hushmirror Mar 24, 2025
76196f2
bech32m instead of base58
hushmirror Mar 26, 2025
aea1f04
Clarify that these prefixes are HRPs of bech32m addresses
hushmirror Mar 26, 2025
3709a87
DIP23 activation instead of height activation
hushmirror Mar 27, 2025
80e4734
Add DIP23+BIP9 to references
hushmirror Mar 27, 2025
f37ff71
Consensus rule for max confidential utxo amount
hushmirror Mar 28, 2025
543f8f4
Update references to latest version of BIP360
hushmirror Mar 29, 2025
eff5099
Fix typo found by @thephez
hushmirror Apr 1, 2025
7389c27
Include version bytes in address
hushmirror Apr 2, 2025
4404138
Only the pubkey in an address is hashed
hushmirror Apr 2, 2025
4b0aa43
Give an example of what a confidential address looks like
hushmirror Apr 2, 2025
f1767da
Add bech32 python to references
hushmirror Apr 7, 2025
457fab7
Add examples of regtest and testnet confidential addresses
hushmirror Apr 8, 2025
ca38db4
Add consensus rules for confidentialAddressBalance
hushmirror Apr 22, 2025
db50a8f
Remove block header version changes
hushmirror May 1, 2025
87f4ded
DIP32
hushmirror May 3, 2025
1da233f
Rename dip-ct.md to dip-0032.md
hushmirror May 5, 2025
585c260
Merge branch 'dashpay:master' into dip-ct
hushmirror May 5, 2025
71d67dd
Add DIP32 to README
hushmirror May 5, 2025
635f229
style: lint fixes
thephez May 21, 2025
642c3da
docs(dip32): typo fixes
thephez May 21, 2025
f98c083
docs: apply suggestions from code review
thephez Jun 9, 2025
3778d0e
docs: consistently capitalize
thephez Jun 9, 2025
ca5682a
Update dip-0032.md
hushmirror Oct 8, 2025
a63754a
Update dip-0032.md
hushmirror Oct 8, 2025
36b2431
Fix typo
hushmirror Oct 12, 2025
21ee490
These items are variable size because they contain variable sized scr…
hushmirror Oct 12, 2025
53a6adb
Mention CoinJoin relying on masternode honesty
hushmirror Oct 12, 2025
4f28b20
Update dip-0032.md
hushmirror Oct 12, 2025
74f28e1
Add reference to Abelian Group wikipedia page
hushmirror Oct 12, 2025
ecf645b
VarInts were not introduced by Bitcoin
hushmirror Oct 12, 2025
a965eb5
Clarify that x*Y is scalar multiplication
hushmirror Oct 12, 2025
f5a9161
Update dip-0032.md
hushmirror Oct 12, 2025
1e85a37
BP range bound is currently N=40
hushmirror Oct 12, 2025
89e07ff
Change prefix for confidential addresses to lowercase
hushmirror Nov 11, 2025
1dc0cb7
Fix capitalization in bech32m address examples
hushmirror Nov 13, 2025
b2eef9f
Update section headers in dip-0032.md
hushmirror Nov 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions dip-ct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<pre>
DIP: XXX
Title: Confidential Transactions
Author: Duke Leto
Comments-Summary: No comments yet.
Status: In Progress
Type: Standard
Created: 2024-08-13
License: MIT License
</pre>

## Table of Contents

1. [Abstract](#abstract)
1. [Motivation](#motivation)
1. [Conventions](#conventions)
1. [Prior Work](#prior-work)
1. [Consensus Protocol Changes](#consensus-protocol-changes)
1. [Observation](#observation)
Comment thread
hushmirror marked this conversation as resolved.
Outdated
1. [Copyright](#copyright)
Comment thread
thephez marked this conversation as resolved.
Outdated

## Abstract

We outline a Confidential Transaction scheme for Dash. After deployment and
activation, Dash will be able to make transactions which do not leak
the amount being transferred.

## Motivation

Currently Dash transactions can optionally use CoinJoin to increase the privacy of transactions but it
leaves much to be desired. This is because CoinJoin is a mixing protocol which
Comment thread
hushmirror marked this conversation as resolved.
Outdated
is based on amount obfuscation which leaves addresses as public data.

CoinJoin transactions leaks large amounts of transaction metadata which is
accessible via public blockchain data and requires users to learn about various
details and advanced options to use it in a privacy-preserving way. The current
CoinJoin implementation also requires users to wait longer for
increased privacy via more mixing rounds. Most users will have no idea how many rounds they should use or what the implications of this choice will be. This incentivizes users to use fewer mixing
rounds to save time, reducing their privacy as well as the privacy of
all users utilizing CoinJoins.

## Conventions

We will use these abbreviations:
* BP - Bulletproof, a type of size-optimized rangeproof
* BP+ - Bulletproof+
* BP++ - Bulletproof++
* CT - Confidential Transaction

## Scope

This DIP describes how CT can be implemented via the Dash Full Node,
the implementation details of light wallet servers and clients and other nodes is out of scope.

## Prior Work

There are many different types of CTs. The term originally was used in the context
of Bitcoin in 2013 and has grown to a research field with many flavors of CTs. Monero
currently uses RingCT with Bulletproof+ optimizations and the purpose of this DIP is
to decide exactly which kind of CT is appropriate for Dash. Monero first implemented
RingCT in 2017 and then added Bulletproofs in 2018 which allow for an 80% reduction
in size of transactions, reducing blockchain bloat as well as reducing transaction fees.
A further improvement called Bulletproofs+ was completed in 2022 which further reduces
transaction size by roughly 5-10% and improves speed by 10%. Yet another improvement
called Bulletproofs++ is currently being worked on which further reduces transaction
size and speeds up runtime. Since BP++ is still being actively worked on and has not
yet been merged into Monero and BP+ are still not widely used it is currently recommended for Dash to use BPs.

## Consensus Protocol Changes

This DIP proposes a new transaction type as well as new address types and therefore is a consensus change.

## Overview

One of the large differences between Dash and Monero is the Elliptic Curve each is based on. Dash uses secp256k1
which is inherited from Bitcoin Core while Monero uses the Curve25519 curve. Bulletproofs are curve-agnostic, they can be used with any elliptic curve, but when considering exactly how the code will be implemented and which low-level libraries to use, this becomes important. The Monero implementation of Bulletproofs is specific to the elliptic curve they use and can not easily be ported or used in the Dash codebase.
Comment thread
hushmirror marked this conversation as resolved.
Outdated

## Details

This DIP documents how Dash can add CTs using Bulletproofs (BPs). The type of CT we propose using has two main parts, a signature and a Bulletproof. The Bulletproof proves that the signature is valid, in particular, that it's values are in between a certain valid range. This prevents an underflow or overflow of values that could be used to subvert the system. Bulletproofs are a type of Non-Interactive Zero Knowledge proof. They prove that the values are valid or invalid without leaking any information about the values themselves.

### Confidential addresses (CT addresses)

New Dash CTs will need a new type of address, a confidential address, to send and receive CT transactions. This means that the Dash full node will require new RPCs to create, validate, list and import confidential addresses. A prefix will need to be decided upon for these addresses so they can easily be differentiated from other Dash addresses. These addresses will be new data in wallet.dat and the code which reads and writes wallet.dat will need to also be updated to store and retrieve this data. The code which rescans blockchain history for transactions belonging to the current wallet will also need to be updated, i.e. the `-rescan` CLI option.

These new CT addresses require a different base58 prefix to identify them as different from traditional Dash addresses.
Comment thread
hushmirror marked this conversation as resolved.
Outdated

### New RPCs
Comment thread
hushmirror marked this conversation as resolved.
Outdated

The following is a list of new RPCs which will be needed to support CTs:

* `getnewctaddress`
* Takes no arguments.
* Generates a random pubkey as well as a random salt or blinding factor and stores this data in wallet.dat and returns the base58 encoded representation
* This address will have a different base58 prefix from normal Dash addresses
* `listctaddresses`
* Takes no arguments.
* Returns a list of all CT addresses

### Modified RPCs
Comment thread
hushmirror marked this conversation as resolved.
Outdated

The following RPCs will be modified to support CTs:

* `importprivkey`
* Add ability to import a CT address private key
* `createrawcttransaction`
* Add ability to create raw CT transactions via specifying the amount of an input UTXO
* `getrawtransaction`
* Add ability to return data about CT transactions
* `gettransaction`
* Add ability to return data about CT transactions
* `getreceivedbyaddress`
* Add ability to get data about a CT address
* `dumpprivkey`
* Add ability to dump a CT address private key
* `dumpwallet`
* Add ability to dump CT address data
* `rescanblockchain`
* Add ability to recognize CT transactions owned by current wallet during a rescan
* `sendmany`
* Add ability to send to one or more CT addresses
* `sendtoaddress`
* Add ability to send to a CT address
* `validateaddress`
* Add ability to recognize CT addresses as valid and return metadata about them

### Confidential transactions

A confidential transaction contains the following data :

* A 33 byte Pederson commitment to the amount being transferred
* A BP rangeproof that ensures the amount transferred is inside a certain interval between 0 and 2^N - 1
* To support all potential value transfers between 0 and 21M the BP rangeproof needs N equal to 52
Comment thread
hushmirror marked this conversation as resolved.
Outdated
* The exact size of the proof depends on the number of inputs and outputs
Comment thread
hushmirror marked this conversation as resolved.
Outdated
* An explicit fee, since the fee cannot be computed by the network since the amount is hidden
Comment thread
hushmirror marked this conversation as resolved.
Outdated
* A list of input UTXOs
* A list of one or more output addresses
* These may be normal or CT addresses
Comment thread
hushmirror marked this conversation as resolved.
Outdated


A Pederson commitment can be thought of as a sealed box which is tamper-proof and contains a secret. Mathematically a Pederscon commitment is defined as

```
P(v,s) = v[G] + s[Q]
```

where

* P(v,s) means P is a function of the variables v and s
* v is a value to be committed
* s is a salt AKA blinding factor
Comment thread
hushmirror marked this conversation as resolved.
Outdated
* [G] and [Q] are elliptic curve points on secp256k1 both known to committer and verifier
* The committer is the creator of a transaction
* The verifier is any node which processes the transaction to see if it is valid
* x[Y] means multiplication of value x by curve point [Y]

[G] and [Q] MUST be randomly chosen curve points such that

```
[Q] = d[G]
Comment thread
hushmirror marked this conversation as resolved.
Outdated
```

is unknown, which is equivalent to

```
log[G]
```
Comment thread
hushmirror marked this conversation as resolved.
Outdated

is unknown. This is known as the Discrete Logarithm Problem (DLP) and the security of Pederson commitments is based on the hardness assumption that the DLP on appropriately chosen elliptic curves have no efficient algorithm to find a solution.


### New consensus rules for CTs

* If at least one input of a CT is confidential, at least one of the outputs must also be confidential. This prevents metadata leaking about the exact amount in a confidential output. A confidential output may have an amount equal to zero.
* If all inputs are public, i.e. not confidential, the number of confidential outputs must be zero or greater than or equal to two, i.e. having all public inputs with a single confidential output is not allowed, as it leaks the metadata about exactly how much value is in the confidential output.
Comment thread
hushmirror marked this conversation as resolved.
Outdated

## References

* Original post about Confidential Transactions https://bitcointalk.org/index.php?topic=305791.0
* RingCT https://eprint.iacr.org/2015/1098
* BP https://eprint.iacr.org/2017/1066.pdf
* BP+ https://eprint.iacr.org/2020/735
* BP++ https://eprint.iacr.org/2022/510
* BP++ CCS https://ccs.getmonero.org/proposals/bulletproofs-pp-peer-review.html
* BP++ Audit by CypherStack https://github.com/cypherstack/bppp-review
* libsecp256k1 https://github.com/bitcoin-core/secp256k1
* libsecp256k1 Bulletproofs: https://github.com/BlockstreamResearch/secp256k1-zkp/tree/master/src/modules/rangeproof
* Example of bulletproof API in libsecp256k1 https://github.com/guillaumelauzier/Bulletproofs-libsecp256k1/blob/main/src.cpp

## Copyright

[Licensed under MIT License](https://opensource.org/licenses/MIT)