Deployed API Base URL: https://vrf-core-production.up.railway.app
You can test all endpoints live at this URL.
This document describes the HTTP API endpoints for the NebulaVRF randomness and proof service. All endpoints are available under the base URL.
Description: Generates a new random seed, VRF output, and optionally returns the public key and commitment. You may supply your own seed (as a 32-byte hex string) or let the server generate one for you.
Query Parameters:
seed(optional, hex string): If provided and valid (32 bytes), this seed will be used. Otherwise, a random seed is generated.proof(optional, bool): If true, includes the public key in the response.commit(optional, bool): If true, includes the commitment in the response.
Examples:
- Generate with a random seed:
curl "http://localhost:3000/get-random?proof=true&commit=true" - Generate with your own seed:
curl "http://localhost:3000/get-random?seed=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef&proof=true&commit=true"
Response:
{
"seed": "<hex-encoded 32-byte seed>",
"randomness": "<hex-encoded VRF output>",
"public_key": "<hex-encoded public key, optional>",
"commitment": "<hex-encoded commitment, optional>"
}seed: The random seed used for VRF generation (hex string).randomness: The VRF output (hex string, 48 bytes).public_key: The BLS public key used for verification (hex string, 96 bytes, present ifproof=true).commitment: The SHA256 commitment to the seed (hex string, present ifcommit=true).
Description: Generates a Soroban testnet payload bundle (seed, salt, commitment, pubkey, signature) in both hex and base64. This is intended for testnet integration and Stellar Lab input formatting.
Query Parameters:
seed_len(optional, integer): Length of the random seed in bytes (default: 8).salt_len(optional, integer): Length of the random salt in bytes (default: 8).
Example:
curl "http://localhost:3000/payloads?seed_len=8&salt_len=8"Response:
{
"hex": {
"seed": "<hex>",
"salt": "<hex>",
"commitment": "<hex>",
"pubkey": "<hex>",
"signature": "<hex>"
},
"base64": {
"seed": "<base64>",
"salt": "<base64>",
"commitment": "<base64>",
"pubkey": "<base64>",
"signature": "<base64>"
}
}Notes:
commitment = sha256(seed || salt)pubkeyis G1 (96 bytes, uncompressed)signatureis G2 (192 bytes, uncompressed)
Description: Verifies a VRF proof given a seed, output, and public key. Returns whether the proof is valid.
Request Body (JSON):
{
"seed": "<hex-encoded seed>",
"output": "<hex-encoded VRF output>",
"public_key": "<hex-encoded public key>"
}Example:
curl -X POST "http://localhost:3000/verify-random" \
-H "Content-Type: application/json" \
-d '{
"seed": "...",
"output": "...",
"public_key": "..."
}'Response:
{ "valid": true }valid: Boolean indicating if the proof is valid for the given seed and public key.
Description: Returns a SHA256 commitment for a given seed.
Request Body (JSON):
{
"seed": "<hex-encoded seed>"
}Example:
curl -X POST "http://localhost:3000/commit" \
-H "Content-Type: application/json" \
-d '{
"seed": "..."
}'Response:
{ "commitment": "<hex-encoded commitment>" }commitment: The SHA256 hash of the seed (hex string).
Description: Verifies that a given seed matches a provided commitment.
Request Body (JSON):
{
"seed": "<hex-encoded seed>",
"commitment": "<hex-encoded commitment>"
}Example:
curl -X POST "http://localhost:3000/verify-commit" \
-H "Content-Type: application/json" \
-d '{
"seed": "...",
"commitment": "..."
}'Response:
{ "valid": true }valid: Boolean indicating if the seed matches the commitment.
- Hex-encoded fields: All binary data (seed, randomness, public key, commitment) is encoded as a lowercase hexadecimal string for safe transport in JSON.
- randomness: The output of the VRF, which is cryptographically secure and can be used as a source of randomness in your application.
- public_key: The BLS public key used to verify the VRF output.
- commitment: A SHA256 hash of the seed, used for commit-reveal schemes to prevent bias.
- Always use cryptographically secure random seeds for best results.
- The
/get-randomendpoint is useful for generating new randomness and commitments. - Use
/verify-randomto check the validity of a VRF proof (e.g., in a smart contract or backend service). - Use
/commitand/verify-commitfor commit-reveal flows to ensure fairness and prevent manipulation. - Use
/payloadswhen you need Soroban-compatible testnet payloads forcommitandreveal.
- If a request is malformed or contains invalid hex, the endpoint will return
valid: falseor an appropriate error response. - Always check the
validfield in verification responses.
- Call
/get-randomto generate a seed, randomness, public key, and commitment (optionally supply your own seed). - Call
/payloadsto generate testnet-ready payloads for the Soroban contract. - Use
/verify-randomto verify the randomness and proof. - Use
/committo get a commitment for a custom seed. - Use
/verify-committo verify a seed against a commitment.
For further questions or integration help, see the main project README or contact the maintainers.