CryptoHBPS 1.0.0

dotnet add package CryptoHBPS --version 1.0.0                
NuGet\Install-Package CryptoHBPS -Version 1.0.0                
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="CryptoHBPS" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CryptoHBPS --version 1.0.0                
#r "nuget: CryptoHBPS, 1.0.0"                
#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 CryptoHBPS as a Cake Addin
#addin nuget:?package=CryptoHBPS&version=1.0.0

// Install CryptoHBPS as a Cake Tool
#tool nuget:?package=CryptoHBPS&version=1.0.0                


HBPS means Hash Based Property Signatures (or System, as it fits more)

A new system of digital property proof, with this you can get, send and proof that you're, for example, owner of specific amount in coins. It's a "new" standart in the sense that it's entirely developed by mine withing my own thinkings these days after reading about post-quantum hash-based cryptography schemes, and it is secure in the same sense that cryptographic hash functions are for obvious reasons.

The system works based on the assumption that for some given property recipient public key PK, there are only one, only known by the owner of PK, private key K that generates PK. While it is okay to receive payments and properties on PK, it is when the transaction occurs this simple idea shines, K is spent on the chain (or whatever else you use), making a proof of PK owning and transfering all founds and properties into another PK', this way, an K/PK pair will never be used for spending more than once and can still make a proof of property and property transferences. The key advantages of this system are that it is not needed to have more than 256 or 512 bits key to make a proof and, for any problems encountered in hash functions the underlying system can ever expand the system to another strong one. Hash functions are believed to be resistant to quantum computers so, similarly, this system should be post-quantum resistant. An disavantage is that you need to keep in mind the K/PK pairs you're using currently in order to not lost your funds control, but an advantage is, after some K/PK have been spent you can safely discard it to nothing as the key-pair will not be used anymore.

An multi-signature system is been developed too but, currently, the system works as is and don't need such a thing.

There are too a implementation of master key generation (with seeds and so on), and K/PK generation based on it, and it is actually functional (the owner only need to store the private key with the rounds to generate every time new keys).

For a brief conceptualization on Master Key MK key-pair generation, see:

Master Key → Key → Public Key generation scheme

And for a brief explanation of this multi-signature system, see this image: Master Private/Master Public Key multi-signature scheme

Also, for further reading on theory itself see (subject to changes in future as algorithm is updated, but nothing that will change already developed concepts itself): The paper of this system

How to use

In order to use this library, you can just create a new instance of IRandomGenerator (recommended using the existing one based on .NET RandomNumberGenerator), and a new instance of IHashGenerator (use the HMACSHA256 one)


// Namespace
using CryptoHBPS;
using System.Text;

Basic Setup of Generators

// For random generation of values inside HBPS
var randomGenerator = new HBPSRandomGenerator();

// For hashing inside HBPS (extensible)
var hashGenerator = new HMACSHA256Generator();

Finally, the creation of HBPS instance

var hbps = new HBPS(randomGenerator, hashGenerator);

To get a new key pair

var (key, pkey) = hbps.Get();

Verify if a given public key PK is derived from private key K

// (one time function)
bool validPublicKey = hbps.Validate(key, pkey);

To sign an arbitrary message with key pair

var message = Encoding.Unicode.GetBytes("I am sending to <Bob> [3000 BTC]");

byte[] signature = new byte[hashGenerator.Size * 2];
hbps.Sign(key, pkey, message, signature);

To verify if a signature was made with some given public key PK

bool signedWithPublicKey = hbps.IsSignedWithPublicKey(pkey, message, signature);

To prove if a signature was made from a given set of public and private key pair K/PK

bool fullySigned = hbps.IsSignedWithPrivateKey(key, pkey, message, signature);

Donations are welcome

BTC: bc1qy009xk2wgve56adrkpqsur7njmjf7tp9rgd6vq


Monero: 8A2PBhRt7Zn59wvhtLr5jRPGJG1g9pmjt6236qCFdVcHHgPN8vhAD5578n7Np5xKSPCEtUQeWwJmVfps3YsT7uuw1noVzcY

QR Code Monero

Nano: nano_1rd8uiqxws711hn591kac4hotqs6uf73o6wowmns8f8cckudkggykrkdy9ie

QR Code Nano

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.

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.0.0 260 2/2/2022

First package upload, all features actually on docs