Technical Specifications
Complete technical details for implementing DSPIP shipping protocol: SHIP payload format,
privacy modes, cryptographic operations, DNS key distribution, and delivery confirmation.
Cryptographic Specifications
DSPIP uses multiple cryptographic algorithms depending on the privacy mode:
secp256k1 for standard signatures, Ed25519 for split-key labels, and ECIES for recipient encryption.
Standard Signatures (secp256k1)
| Parameter |
Value |
| Curve |
secp256k1 (SEC 2) |
| Signature Algorithm |
ECDSA + SHA-256 |
| Private Key Size |
256 bits (32 bytes) |
| Public Key Size |
264 bits (33 bytes compressed) |
| Signature Encoding |
DER format, hex-encoded |
| Use Case |
Standard and encrypted privacy modes |
Split-Key Signatures (Ed25519)
| Parameter |
Value |
| Curve |
Curve25519 (Edwards form) |
| Signature Algorithm |
Ed25519 |
| Private Key Size |
256 bits (32 bytes) |
| Public Key Size |
256 bits (32 bytes) |
| Signature Size |
512 bits (64 bytes) |
| Use Case |
Physical anti-cloning labels with scratch-off zones |
Recipient Encryption (ECIES)
| Parameter |
Value |
| Key Agreement |
ECIES (secp256k1) |
| Symmetric Cipher |
AES-256-GCM |
| Key Derivation |
HKDF-SHA256 |
| Nonce Size |
96 bits (12 bytes) |
| Auth Tag Size |
128 bits (16 bytes) |
| Use Case |
Encrypted recipient for last mile provider |
Payload Structure
The payload contains shipping information encoded as JSON with type "SHIP".
Required fields: type, issuer, itemId, timestamp.
{
"type": "SHIP", // REQUIRED: Fixed for shipping
"issuer": { // REQUIRED: Sender information
"name": "string",
"organization": "string",
"facility": "string",
"address": {
"city": "string",
"state": "string",
"country": "string"
}
},
"subject": {
"name": "string",
"address": { ... },
"lastMileProvider": "string"
},
"itemId": "string", // REQUIRED: Unique tracking ID
"timestamp": number, // REQUIRED: Unix timestamp (ms)
"typeData": {
"privacyMode": "standard|encrypted|split-key",
"parcelId": "string",
"carrier": "string",
"service": "string",
"lastMileProvider": "string",
"encryptedRecipient": "base64",
"labelSerial": "string",
"gs1": "string",
"ediRef": "string"
}
}
For encrypted and split-key modes, the subject contains only the last mile provider
reference. The actual recipient is encrypted in typeData.encryptedRecipient.
QR Data Serialization
QR data MUST be serialized using pipe (|) delimiters. The pipe delimiter was chosen
for its low frequency in Base64 and domain names.
DSPIP|<version>|<type>|<keyLocator>|<encodedPayload>|<signature>[|<privateMessage>]
Implementations MUST validate that exactly 6 or 7 pipe-delimited fields are present.
| Field |
Description |
| protocol |
Fixed string "DSPIP" |
| version |
Semantic version (e.g., "1.0") |
| type |
Fixed to "SHIP" for shipping applications |
| keyLocator |
DNS path for public key lookup (or label serial for split-key) |
| encodedPayload |
Base64-encoded JSON payload |
| signature |
Hex-encoded signature (ECDSA for standard, Ed25519 for split-key) |
| privateMessage |
Optional: Base64-encoded ECIES-encrypted recipient data |
QR Code Requirements
| Error Correction |
Level M (15% recovery) recommended |
| Version |
40 or automatic selection |
| Encoding Mode |
Binary for optimal density |
| Max Capacity (Level M) |
2,331 bytes |
DNS Key Distribution
DSPIP uses DNS TXT records for public key distribution, following the model established by DKIM.
Key locators MUST follow this pattern:
<selector>._dspip.<domain>
Examples:
warehouse._dspip.example.com // Shipping warehouse
lmp._dspip.carrier.com // Last mile provider
omaha-main._dspip.usps.gov // Post office
DNS TXT Record Format
The DNS TXT record MUST contain a semicolon-separated list of tag=value pairs:
v=DSPIP1; k=ec; c=secp256k1; p=<base64_public_key>; types=SHIP; [optional tags]
Required Tags
v
Protocol version (MUST be "DSPIP1")Required
k
Key type: "ec" (secp256k1) or "ed" (Ed25519)Required
c
Curve: "secp256k1" or "ed25519"Required
p
Public key in Base64 encodingRequired
types
Supported types (e.g., "SHIP")Required
Key Lifecycle Tags (SHOULD include)
t
Key creation timestamp (Unix time). If omitted, key is valid from indefinite past.Recommended
exp
Signing expiration timestamp (Unix time). After this time, key MUST NOT sign new items.Recommended
exp-v
Verification expiration timestamp (Unix time). After this time, key MUST NOT verify any signatures. Defaults to exp value if omitted.Recommended
Optional Tags
s
Key status: "active" (default), "verify-only", or "revoked"Optional
seq
Sequence number for key updates. Higher values supersede lower for same selector.Optional
rsig
Record signature - cryptographic authentication of lifecycle metadata (t, exp, exp-v, s, seq). Protects against DNS cache manipulation.Optional
auth
Authorization level: "shipper", "lmp", "government"Optional
coverage
Geographic coverage for LMPs (postal codes, regions)Optional
address
Physical facility location. Schemes: plus: (Plus Code), street: (percent-encoded), geo: (lat,lng), facility: (reference ID)Optional
n
Human-readable notes (percent-encoded)Optional
eth
Ethereum address for blockchain integrationOptional
Shipper Key Example (with lifecycle fields)
warehouse._dspip.example.com. IN TXT "v=DSPIP1; k=ec; c=secp256k1;
p=AzmjYBMwFZfa70H75ZOgLMUT0LVVJ+wt8QUOLo/0nIXC; types=SHIP;
t=1703548800; exp=1735084800; exp-v=1766620800; s=active; seq=1;
n=Main%20Warehouse%20Key%202025"
Last Mile Provider Key Example
omaha-main._dspip.usps.gov. IN TXT "v=DSPIP1; k=ec; c=secp256k1;
p=AzmjYBMwFZfa70H75ZOgLMUT0LVVJ+wt8QUOLo/0nIXC; types=SHIP;
auth=government; address=86HJW222+22; coverage=68101,68102,68103,68104,68105"
Key Lifecycle States
Keys transition through the following states:
| State |
Condition |
Can Sign |
Can Verify |
| Active |
s=active (or omitted), current time < exp |
Yes |
Yes |
| Verify-Only |
s=verify-only, or exp < current time < exp-v |
No |
Yes |
| Expired |
s=revoked, or current time > exp-v |
No |
No |
Recommended key lifetime: Active signing: 365 days. Verify-only period: 365 additional days. Total: 730 days (2 years).
Signature Operations
Standard/Encrypted Mode (ECDSA)
For standard and encrypted privacy modes:
- Construct signable content:
protocol|version|type|keyLocator|encodedPayload
- Calculate SHA-256 hash of signable content
- Sign hash using ECDSA with secp256k1 private key
- Encode signature in DER format, hex-encoded
Split-Key Mode (Ed25519)
For physical anti-cloning labels:
- Sender reveals Zone A (scratch-off) to obtain Ed25519 private key
- Construct signable content:
protocol|version|type|labelSerial|encodedPayload
- Sign using Ed25519 with revealed private key
- Hex-encode 64-byte signature
- Destroy private key after signing (one-time use)
Verification (Standard/Encrypted)
- Reconstruct signable content from QR data
- Query DNS TXT record at keyLocator
- Verify ECDSA signature with public key
- Check key lifecycle: verify
s status and exp-v expiration
- Verify
rsig if present (protects against DNS cache manipulation)
- Query key revocation list at
_revoked-key._dspip.<domain>
- Query item revocation list for itemId
Verification (Split-Key)
- Recipient reveals Zone B (scratch-off) to obtain Ed25519 public key
- Reconstruct signable content from QR data
- Verify Ed25519 signature with revealed public key
- Verify Zone B scratch-off was previously intact (visual inspection)
- Cloned QRs will fail: no matching physical public key
Note: Split-key verification is offline - no DNS lookup required.
This enables verification in areas without network connectivity.
Privacy Modes
DSPIP defines three privacy modes for different security and privacy requirements:
Mode
Standard
Traditional shipping with full transparency
- Full recipient info in payload
- ECDSA signature (secp256k1)
- DNS key lookup
- Business-to-business shipments
- Internal transfers
Mode
Encrypted
Privacy-preserving consumer delivery
- Recipient encrypted with ECIES
- LMP reference in subject
- ECDSA signature (secp256k1)
- DNS key lookup
- Consumer privacy protection
Mode
Split-Key
Maximum security with anti-cloning
- Ed25519 signature from Zone A
- Physical label with scratch-offs
- Offline verification (no DNS)
- One-time-use private key
- High-value shipments
Key Revocation
When a signing key is compromised or must be retired, organizations publish key revocation records
at a dedicated DNS endpoint. This operates independently of key record caching for faster propagation.
Key Revocation Record Format
_revoked-key._dspip.example.com. IN TXT "v=DSPIP1; type=key-revocation;
selector=warehouse; revoked=1703548900; reason=compromised; replacement=warehouse-v2"
Revocation Reasons
compromised
Private key was exposed or stolen
retired
Key reached end of lifecycle
superseded
Key replaced by newer key
suspended
Temporarily disabled (may be reactivated)
Important: Key revocation takes precedence over s=active in the key record.
Verifiers SHOULD use short TTLs (60-300 seconds) when caching key revocation records.
Item Revocation Lists
Senders can revoke shipping labels for lost, stolen, damaged, or recalled packages.
Revocation lists auto-prune entries older than 180 days for SHIP type.
Revocation List Format
{
"version": "1.0",
"issuer": "warehouse._dspip.example.com",
"updated": 1703548800,
"expires": 1719316800,
"revoked": [
{
"itemId": "TRACK-2025-000123",
"revoked": 1703548900,
"reason": "lost|stolen|damaged|recalled",
"replacementId": "TRACK-2025-000124"
}
],
"signature": "issuer_signature"
}
DNS Revocation Pointer
revocation._dspip.example.com. IN TXT "v=DSPIP1; type=revocation;
url=https://example.com/dspip/revoked.json; updated=1703548800; ttl=86400"
Delivery Confirmation
Cryptographic proof of delivery using challenge-response protocol.
Provides non-repudiable evidence of successful delivery.
Confirmation Protocol
- Carrier generates time-bounded challenge at delivery
- Recipient signs challenge with their delivery key
- Carrier verifies signature and records confirmation
- Optional: Record confirmation hash to blockchain
Confirmation Format
{
"itemId": "TRACK-2025-000123",
"deliveryTimestamp": 1703635200000,
"status": "delivered",
"carrierKeyLocator": "lmp._dspip.carrier.com",
"recipientSignature": "base64_signature",
"location": {
"lat": 41.2565,
"lng": -95.9345
},
"carrierSignature": "base64_signature"
}
Performance Guidelines
Expected operation times for typical implementations:
| Operation |
Expected Time |
| Key generation (secp256k1) |
5-10 ms |
| Key generation (Ed25519) |
2-5 ms |
| Signature creation |
2-5 ms |
| DNS lookup |
20-100 ms (cacheable) |
| Signature verification |
3-8 ms |
| ECIES encryption |
5-15 ms |
| ECIES decryption |
5-15 ms |
| Revocation list check |
10-50 ms (cacheable) |
| Blockchain recording |
2-5 seconds (optional, async) |