API Playground
Interactive testing environment for DSPIP protocol operations
Generate a new secp256k1 key pair for DSPIP signing operations. Returns both private and public keys.
{
"message": "Click 'Run' to generate a new key pair"
}
// Using @noble/secp256k1 for DSPIP shipping import * as secp from '@noble/secp256k1'; // Generate random private key const privateKey = secp.utils.randomPrivateKey(); // Derive compressed public key (33 bytes) const publicKey = secp.getPublicKey(privateKey, true); // Convert to hex strings const privateKeyHex = bytesToHex(privateKey); const publicKeyHex = bytesToHex(publicKey); // Base64 for DNS TXT record (p= tag) const publicKeyBase64 = btoa( String.fromCharCode(...publicKey) ); // DNS record format with lifecycle fields: // v=DSPIP1; k=ec; c=secp256k1; p={base64}; // t={created}; exp={sign_expires}; exp-v={verify_expires}; // s=active; seq=1; types=SHIP
# 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
{
"privateKey": "string (64 hex chars)",
"publicKey": {
"hex": "string (66 hex chars)",
"base64": "string (44 chars)"
},
"ethereumAddress": "string (optional)"
}
Derive the public key from a private key. Useful for verifying key pairs.
{
"message": "Enter a private key and click 'Run'"
}
Create a DSPIP SHIP payload with issuer/subject structure and privacy mode selection. Encodes to Base64.
{
"message": "Fill in the fields and click 'Run'"
}
Sign a DSPIP payload using ECDSA with SHA-256. Creates a DER-encoded signature.
{
"message": "Enter parameters and click 'Run'"
}
Generate complete DSPIP SHIP QR code data string with 6-7 pipe-delimited fields: DSPIP|version|type|keyLocator|payload|signature
{
"message": "Enter parameters and click 'Run'"
}
Parse a DSPIP QR code string (6-7 pipe-delimited fields) into its components, validate type=SHIP, and decode the payload.
{
"message": "Enter QR data and click 'Run'"
}
Verify an ECDSA signature against a public key and message.
{
"message": "Enter parameters and click 'Run'"
}
Look up a DSPIP public key from DNS TXT records using DNS over HTTPS.
{
"message": "Enter key locator and click 'Run'"
}
Calculate the SHA-256 hash of input data. Used internally for signature creation.
{
"message": "Enter data and click 'Run'"
}
Encode or decode data using Base64. Used for payload encoding in DSPIP.
{
"message": "Enter data and click 'Encode' or 'Decode'"
}
Encrypt data for a recipient using ECIES (Elliptic Curve Integrated Encryption Scheme). Used in privacy modes to encrypt recipient information for Last Mile Providers (Section 4.3).
{
"message": "Enter recipient public key and plaintext, then click 'Encrypt'"
}
Decrypt ECIES-encrypted data using the recipient's private key. Used by Last Mile Providers to access encrypted recipient information.
{
"message": "Enter private key and ciphertext, then click 'Decrypt'"
}
Generate an Ed25519 key pair for split-key labels. Ed25519 provides fast signing for physical anti-cloning mechanisms (Section 7.3).
{
"message": "Click 'Generate' to create a new Ed25519 key pair"
}
Check if an item ID has been revoked using Bloom filter (Section 5.5). Returns probable revocation status for high-volume checking.
{
"message": "Enter item ID and click 'Check'"
}
Create a cryptographic challenge for delivery confirmation (Section 5.6). The recipient must sign this challenge to prove possession of their private key.
{
"message": "Enter parameters and click 'Create Challenge'"
}
Look up Last Mile Providers by postal code or geographic location (Section 7.2.5). Returns providers that service the specified area.
{
"message": "Enter postal code and click 'Lookup'"
}
Parse a DSPIP address field from DNS TXT records (Section 5.2.1). Supports Plus Codes, street addresses, geographic coordinates, and facility codes.
{
"message": "Enter address field and click 'Parse'"
}