Norsh
HomeNTPNCLAPI
HomeNTPNCLAPI
  1. Crypto
  • Norsh
    • Usage Guide
      • Cryptographic Identity
    • API
      • Crypto
        • Generates a public and private key pair
          GET
        • Generates an address from a public key.
          POST
  • NTP - Norsh Technical Paper
    • LICENSE-NCL-11
    • Published
      • NTP-1: Norsh Technical Paper Specification
      • NTP-2: Standards for Encoding, Time and Localization
      • NTP-3: Cryptography and Hash Specification
      • NTP-4: Interchangeable Data Standard
      • NTP-5: Temporal Time-Step Model
      • NTP-6: Modular Prime Fragmentation
      • NTP-7: The End of Mining - PoW
      • NTP-8: The Fallacy of Stake - PoS
      • NTP-9: The Myth of Absolute Non-Censorship
      • NTP-10: Structural Failures of Decentralization
  • NCL - Norsh Commons License
    • NCL-0: Norsh Commons License
    • NCL-1: Attribution Requirement
    • NCL-2: Restricted Commercialization
    • NCL-4: Commercialization with Agreement or Royalties
    • NCL-8: Educational Use Permission
    • NCL-16: Complementary Use and Integration Permission
    • NCL-32: Pre-Approval for Application Publication
    • NCL-64: Restricted or Authorized Derivatives
    • NCL-128: Contribution Terms
  1. Crypto

Generates a public and private key pair

GET
https://sandnet.norsh.org/v1/crypto/keys
API
Last modified:2025-06-05 20:32:30
This API generates a new elliptic curve (EC) key pair using the secp256r1 (a.k.a. P-256) curve. The result includes the public and private keys in Base64, Hexadecimal, and PEM encodings. These keys can be used for cryptographic signing, identity, and address generation within the Norsh ecosystem.
For full cryptographic specifications and compliance requirements, refer to NTP-3: Cryptography and Hash Specification.

Request Format#

Content-Type: application/json
Body Parameters: (none)
This endpoint does not require any body input.

Response Format#

Success Response (200 OK):
{
  "base64": {
    "privateKey": "MIGNAgEAMBAGByqGSM49AgEGBSuBBAAKBHYwdAIBAQQg...",
    "publicKey": "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEP+GH+0DkcMkgNv..."
  },
  "hex": {
    "privateKey": "30818d020100301006072a8648ce3d020106052b8104000a...",
    "publicKey": "3056301006072a8648ce3d020106052b8104000a03420004..."
  },
  "pem": {
    "privateKey": "-----BEGIN PRIVATE KEY-----\nMIGNAgEAMBAGByqGSM49A...",
    "publicKey": "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYF..."
  }
}
Error Response (500 Internal Server Error):
{
  "error": true,
  "message": "An unexpected error occurred while generating the key pair.",
  "timestamp": 1737059076672
}

Notes#

All keys are generated using secp256r1 (P-256), a NIST-recommended elliptic curve.
The response provides keys in three formats for compatibility with various cryptographic libraries:
base64: Ideal for compact transmission.
hex: Raw byte-level representation.
pem: Readable, OpenSSL-compatible format.
Private keys must be stored securely. Norsh does not persist or log any generated key.

How This API Works#

1.
A new elliptic curve key pair is generated using ECDSA P-256.
2.
Keys are encoded into Base64, Hex, and PEM.
3.
All formats are returned in the response.
These keys may be used to:
Derive blockchain addresses.
Sign and verify transactions.
Secure communication channels within the Norsh ecosystem.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://sandnet.norsh.org/v1/crypto/keys'
Response Response Example
{
    "base64": {
        "privateKey": "MIGNAgEAMBAGByqGSM49AgEGBSuBBAAKBHYwdAIBAQQgXtFpcJjKXNt7Vk4qJzc1M4ethO8wCb6GGi00ywapBcSgBwYFK4EEAAqhRANCAAQ/4Yf7QORwySA2/KkW9c8gAlZ0lpmAsgKxnrGpBR3JvqPIWaD2tmd6lmU/Kh15LbqvUwonyoVwnjuXb0M1p5n1",
        "publicKey": "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEP+GH+0DkcMkgNvypFvXPIAJWdJaZgLICsZ6xqQUdyb6jyFmg9rZnepZlPyodeS26r1MKJ8qFcJ47l29DNaeZ9Q=="
    },
    "hex": {
        "privateKey": "30818d020100301006072a8648ce3d020106052b8104000a0476307402010104205ed1697098ca5cdb7b564e2a2737353387ad84ef3009be861a2d34cb06a905c4a00706052b8104000aa144034200043fe187fb40e470c92036fca916f5cf20025674969980b202b19eb1a9051dc9bea3c859a0f6b6677a96653f2a1d792dbaaf530a27ca85709e3b976f4335a799f5",
        "publicKey": "3056301006072a8648ce3d020106052b8104000a034200043fe187fb40e470c92036fca916f5cf20025674969980b202b19eb1a9051dc9bea3c859a0f6b6677a96653f2a1d792dbaaf530a27ca85709e3b976f4335a799f5"
    },
    "pem": {
        "privateKey": "-----BEGIN PRIVATE KEY-----\nMIGNAgEAMBAGByqGSM49AgEGBSuBBAAKBHYwdAIBAQQgXtFpcJjKXNt7Vk4qJzc1M4ethO8wCb6GGi00ywapBcSgBwYFK4EEAAqhRANCAAQ/4Yf7QORwySA2/KkW9c8gAlZ0lpmAsgKxnrGpBR3JvqPIWaD2tmd6lmU/Kh15LbqvUwonyoVwnjuXb0M1p5n1\n-----END PRIVATE KEY-----",
        "publicKey": "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEP+GH+0DkcMkgNvypFvXPIAJWdJaZgLICsZ6xqQUdyb6jyFmg9rZnepZlPyodeS26r1MKJ8qFcJ47l29DNaeZ9Q==\n-----END PUBLIC KEY-----"
    }
}

Request

None

Responses

🟢200Success
application/json
Body
base64
object 
required
privateKey
string 
required
Private key encoded in Base64.
publicKey
string 
required
Public key encoded in Base64.
hex
object 
required
privateKey
string 
required
Private key in hexadecimal format.
publicKey
string 
required
Public key in hexadecimal format.
pem
object 
required
privateKey
string 
required
Private key in PEM format.
publicKey
string 
required
Public key in PEM format.
Modified at 2025-06-05 20:32:30
Previous
Crypto
Next
Generates an address from a public key.
Built with