Note: This is a client-side playground. All operations run in your browser using JavaScript cryptography libraries. No data is sent to any server.
POST Generate Key Pair

Generate a new secp256k1 key pair for DSPIP signing operations. Returns both private and public keys.

🧪 Try It
Warning: The generated private key is displayed for testing purposes only. In production, never expose private keys.
Response Waiting
{
  "message": "Click 'Run' to generate a new key pair"
}
Code Samples
// Using @noble/secp256k1
import * as secp from '@noble/secp256k1';

// Generate random private key
const privateKey = secp.utils.randomPrivateKey();

// Derive compressed public key
const publicKey = secp.getPublicKey(privateKey, true);

// Convert to hex strings
const privateKeyHex = bytesToHex(privateKey);
const publicKeyHex = bytesToHex(publicKey);

// Base64 for DNS record
const publicKeyBase64 = btoa(
  String.fromCharCode(...publicKey)
);
# Using coincurve library
from coincurve import PrivateKey
import base64

# Generate new key pair
private_key = PrivateKey()
public_key = private_key.public_key

# Get hex representations
private_key_hex = private_key.to_hex()
public_key_hex = public_key.format(True).hex()

# Base64 for DNS record
public_key_base64 = base64.b64encode(
    public_key.format(True)
).decode()
// Using go-ethereum/crypto
import (
    "crypto/ecdsa"
    "encoding/base64"
    "encoding/hex"
    "github.com/ethereum/go-ethereum/crypto"
)

// Generate new key pair
privateKey, _ := crypto.GenerateKey()
publicKey := privateKey.PublicKey

// Compress public key
pubBytes := crypto.CompressPubkey(&publicKey)

// Encode
privHex := hex.EncodeToString(
    crypto.FromECDSA(privateKey))
pubBase64 := base64.StdEncoding.EncodeToString(
    pubBytes)
# Key generation is done client-side
# For testing, use OpenSSL:

# Generate private key
openssl ecparam -name secp256k1 \
  -genkey -noout -out private.pem

# Extract public key
openssl ec -in private.pem \
  -pubout -out public.pem

# Get hex format
openssl ec -in private.pem \
  -text -noout
Response Schema
{
  "privateKey": "string (64 hex chars)",
  "publicKey": {
    "hex": "string (66 hex chars)",
    "base64": "string (44 chars)"
  },
  "ethereumAddress": "string (optional)"
}
POST Derive Public Key

Derive the public key from a private key. Useful for verifying key pairs.

🧪 Try It
Parameters
privateKey * hex string
Response Waiting
{
  "message": "Enter a private key and click 'Run'"
}
POST Create Payload

Create a DSPIP payload structure and encode it to Base64.

🧪 Try It
Required Fields
parcelId * string
senderCountry * ISO 3166-1
recipientCountry * ISO 3166-1
Optional Fields
senderName string
recipientName string
message string
Response Waiting
{
  "message": "Fill in the fields and click 'Run'"
}
POST Sign Payload

Sign a DSPIP payload using ECDSA with SHA-256. Creates a DER-encoded signature.

🧪 Try It
Parameters
privateKey * hex string
keyLocator * string
encodedPayload * base64
Response Waiting
{
  "message": "Enter parameters and click 'Run'"
}
POST Generate QR Data

Generate complete DSPIP QR code data string from components.

🧪 Try It
Parameters
version string
keyLocator * string
encodedPayload * base64
signature * hex string
Response Waiting
{
  "message": "Enter parameters and click 'Run'"
}
POST Parse QR Data

Parse a DSPIP QR code string into its components and decode the payload.

🧪 Try It
Parameters
qrData * string
Response Waiting
{
  "message": "Enter QR data and click 'Run'"
}
POST Verify Signature

Verify an ECDSA signature against a public key and message.

🧪 Try It
Parameters
publicKey * base64
message * string
signature * hex string
Response Waiting
{
  "message": "Enter parameters and click 'Run'"
}
GET DNS Lookup

Look up a DSPIP public key from DNS TXT records using DNS over HTTPS.

🧪 Try It
Parameters
keyLocator * string
Uses Cloudflare DNS over HTTPS (1.1.1.1) for lookups. For the test key locator, a simulated response is returned.
Response Waiting
{
  "message": "Enter key locator and click 'Run'"
}
POST SHA-256 Hash

Calculate the SHA-256 hash of input data. Used internally for signature creation.

🧪 Try It
Parameters
data * string
Response Waiting
{
  "message": "Enter data and click 'Run'"
}
POST Base64 Encode/Decode

Encode or decode data using Base64. Used for payload encoding in DSPIP.

🧪 Try It
Parameters
data * string
Response Waiting
{
  "message": "Enter data and click 'Encode' or 'Decode'"
}