Xrpl.Keypairs
11.27.0
dotnet add package Xrpl.Keypairs --version 11.27.0
NuGet\Install-Package Xrpl.Keypairs -Version 11.27.0
<PackageReference Include="Xrpl.Keypairs" Version="11.27.0" />
<PackageVersion Include="Xrpl.Keypairs" Version="11.27.0" />
<PackageReference Include="Xrpl.Keypairs" />
paket add Xrpl.Keypairs --version 11.27.0
#r "nuget: Xrpl.Keypairs, 11.27.0"
#:package Xrpl.Keypairs@11.27.0
#addin nuget:?package=Xrpl.Keypairs&version=11.27.0
#tool nuget:?package=Xrpl.Keypairs&version=11.27.0
Xrpl.Keypairs
Generate XRP Ledger seeds, derive Ed25519 and secp256k1 keypairs and addresses, and sign and verify messages in C#.
This is a base package of the Xrpl SDK, which already depends on it and offers XrplWallet for everyday key handling. Install it on its own when you only need key operations. It targets .NET Standard 2.1.
dotnet add package Xrpl.Keypairs
Generate a seed and derive an address
GenerateSeed uses secp256k1 unless you pass "ed25519". DeriveKeypair reads the algorithm from the seed. On the keypair, Id() returns the public key and Pk() the private key, both as hex strings:
using Xrpl.Keypairs;
string seed = XrplKeypairs.GenerateSeed(algorithm: "ed25519");
IXrplKeyPair keypair = XrplKeypairs.DeriveKeypair(seed);
string publicKey = keypair.Id();
string privateKey = keypair.Pk();
string address = XrplKeypairs.DeriveAddress(publicKey);
Anyone who has the seed or the private key controls the account. Keep both out of logs and source control.
Sign and verify a message
Sign and Verify take the message as a hex string or as a byte array, and pick the algorithm from the key. Continuing from the example above:
string signature = XrplKeypairs.Sign("DEADBEEF", privateKey);
bool isValid = XrplKeypairs.Verify("DEADBEEF", signature, publicKey);
// true
To sign a transaction, build the message with XrplBinaryCodec.EncodeForSigning from Xrpl.BinaryCodec.
More information
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Chaos.NaCl.Standard (>= 1.0.0)
- Microsoft.CSharp (>= 4.7.0)
- NBitcoin.Secp256k1 (>= 4.0.4)
- Xrpl.AddressCodec (>= 11.27.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Xrpl.Keypairs:
| Package | Downloads |
|---|---|
|
Xrpl
A C# library to interact with the XRP Ledger (XRPL) blockchain |
|
|
XrplCSharp
A C# library to interact with the XRP Ledger (XRPL) blockchain |
GitHub repositories
This package is not used by any popular GitHub repositories.