A lightweight .NET library providing utilities for blockchain integration. This package contains common types and helpers that are useful when working with any blockchain from .NET applications.
dotnet add package Evoq.Blockchain
- Type-safe blockchain primitives
- Common blockchain data structures
- Utility methods for blockchain operations
- Framework-agnostic design (works with any blockchain implementation)
- Merkle trees with selective disclosure and automatic random salts
Comprehensive documentation is available in the docs directory:
- Merkle Tree Implementation
- Selective Disclosure in Merkle Trees (includes complete examples)
// Create a Merkle tree
var tree = new MerkleTree();
// Add leaves with automatic random salts
var data = new Dictionary<string, object?>
{
{ "name", "John" },
{ "age", 30 },
{ "ssn", "123-45-6789" }
};
tree.AddJsonLeaves(data);
// Compute the root hash
tree.RecomputeSha256Root();
// Create a selective disclosure version (hiding sensitive data)
Predicate<MerkleLeaf> privateSsn = leaf =>
leaf.TryReadText(out string text) && text.Contains("ssn");
// Convert to JSON with selective disclosure
string json = tree.ToJson(privateSsn);
This package targets .NET Standard 2.0 for maximum compatibility across:
- .NET 6.0+
- .NET Framework 4.6.1+
- .NET Core 2.0+
- Xamarin
- Unity
dotnet build
dotnet test
The repository includes shell scripts to simplify the build and publishing process:
This script automates the build process:
- Cleans previous artifacts
- Builds the project in Release configuration
- Runs all tests
- Creates a NuGet package in the ./artifacts directory
# Make the script executable
chmod +x build.sh
# Run the build script
./build.sh
This script publishes the NuGet package to NuGet.org:
- Requires the NUGET_API_KEY environment variable to be set
- Finds the .nupkg file in the artifacts directory
- Pushes the package to NuGet.org
# Make the script executable
chmod +x publish.sh
# Set your NuGet API key
export NUGET_API_KEY="your-nuget-api-key"
# Run the publish script
./publish.sh
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Luke Puplett