ProjectOrigin.PedersenCommitment 1.1.1

dotnet add package ProjectOrigin.PedersenCommitment --version 1.1.1
NuGet\Install-Package ProjectOrigin.PedersenCommitment -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProjectOrigin.PedersenCommitment" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ProjectOrigin.PedersenCommitment --version 1.1.1
#r "nuget: ProjectOrigin.PedersenCommitment, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ProjectOrigin.PedersenCommitment as a Cake Addin
#addin nuget:?package=ProjectOrigin.PedersenCommitment&version=1.1.1

// Install ProjectOrigin.PedersenCommitment as a Cake Tool
#tool nuget:?package=ProjectOrigin.PedersenCommitment&version=1.1.1

Project-Origin Pedersen Commitment

The library allows construction of Pedersen commitments and rangeproofs along with verification.

This library wraps the rust bulletproofs and curve25519-dalek libraries using the ristretto group.

Release notes

All release notes can be found on GitHub.

How to

To create a Pedersen Commitment one must create a new instance of a SecretCommitmentInfo with the quantity (message : uint) one wants to hide.


var secret = new SecretCommitmentInfo(250);

The secret has two fields that must be persisted to later prove the data, the Message and BlindingValue.

// store these values
uint message = secret.Message;
ReadOnlySpan<byte> blinding = secret.BlindingValue;

The commitment to share publicly can be gotten directly from the SecretCommitmentInfo.

ReadOnlySpan<byte> commitment = secret.Commitment.C;

Range proofs

If one wants to prove the commitment is within the allowed value, one can easily create a range proof using a label.

Note: In ProjectOrigin Electricity the label is always the string representation of certificate uuid.

string someLabel = "foobar";
ReadOnlySpan<byte> rangeProof = secret.CreateRangeProof(someLabel);

The range proof in this library is currently hardcoded to allow values between 0 and uint.Max (32 bits).

Why use a label?

The label is to ensure that the range proof is unique as to ensure that the same range proof is not used for multiple commitments. This is important as the range proof is a zero-knowledge proof, and if the same range proof is used for multiple commitments, one could use the range proof for exploits.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 2,545 4/3/2024
1.0.3 8,979 8/31/2023
1.0.2 112 8/31/2023
1.0.1 143 8/24/2023
1.0.0 121 8/23/2023
0.2.2 138 8/21/2023
0.2.1 130 8/14/2023
0.2.0 244 8/14/2023
0.2.0-rc.17 3,932 6/28/2023
0.2.0-rc.16 929 6/28/2023
0.2.0-rc.15 72 6/27/2023
0.2.0-rc.14 69 6/26/2023
0.2.0-rc.13 91 6/23/2023
0.2.0-rc.12 59 6/21/2023
0.2.0-rc.11 68 6/16/2023
0.2.0-rc.10 57 6/16/2023
0.2.0-rc.9 104 6/16/2023
0.2.0-rc.4 67 6/16/2023
0.2.0-rc.3 65 6/12/2023
0.2.0-rc.2 65 6/12/2023
0.2.0-rc.1 73 6/12/2023