Quantum Random Numbers Generator

Quantum random number generators (QRNGs) create randomness by measuring quantum processes, which are, by nature fully non-deterministic.


Category:

Description

Description

Quantum random number generators (QRNGs) create randomness by measuring quantum processes, which are, by nature fully non-deterministic.

Brand

Brand

Quside

Additional information

Additional information

Sustainability focus

Sector

,

Usage REST API

Usage REST API

Quside’s QRNG is directly accessible through the QCentroid Platform API.

Three steps are needed to get a rondom number using this method:

  1. Authentication: Obtain an access token using your credentials
  2. Random number request: Request the random number using the access token obtained in step 1 and obtain a Job Id.
  3. Obtain the result: Check the job status and obtain the result.

Step 1: Login/authentication

Authentication to the QCentroid Platform API is done through the following endpoint:

POST   https://api.qcentroid.xyz/login

And providing the following JSON data in the request body:

{
    "username": "your-username",
    "password": "your-password"
}

The response will be in JSON format, containing the access token and will look like this:

{
    "access_token": "eyJ0eXAiOiJKV1  ...  iXWgdfolI"
}

Step 2: Quantum Random Number Request

Perform a POST request to the following endpoint:

POST   https://api.qcentroid.xyz/problem/raw_certified_random

Include Authrization type: Bearer token:

"Authorization: Bearer {access_token}"

Also, include the following request body in JSON format:

{
    "data": {
        "size": 30
    },
    "solvers": [{
        "name": "quside-solver-random"
    }]
}
Where solver.name is the name of the solver you want to use, in this case “quside-solver-random”
And data.size is the size of the Quantum Random Number you want to request. This value goes from 1 to 255 bytes.
The response to this rquest will be the Job Id of your request in JSON format:
{
    "detail": "Authorized. Processing file",
    "job": "RI5XXXXXX11F"
}
You can use this Job Id later to obtain the result.

Step 3: Obtain the result

To obtain the result, perform a GET request to the following endpoint using the Job Id obtained in step 2:

GET   https://api.qcentroid.xyz/job/{job_id}

While the solver is working, the response to this request will include the following status information:

{
    "job": {
        "RI5XXXXXX11F": {
            "status": "PENDING",
            ...
        }
    }
}

Once the Job has been fullfilled, you will obtain the following JSON response that includes the result:

{
    "job": {
        "RI5XXXXXX11F": {
            "status": "FINISHED",
            "started_at": "07/27/2022, 09:28:56",
            "end_at": "07/27/2022, 09:30:15",
            "executions": {
                "quside-solver-random": {
                    "started_at": "",
                    "end_at": "07/27/2022, 09:30:02",
                    "status": "SUCCESS",
                    "data": {
                        "size": 30
                    },
                    "arguments": null,
                    "result": "b"xf4x7fix8dPxa51x86xb8xc9dxb2C&x95xf4=x83x9cxcaxe3xf7xe7!xcfxe8xf0x0fx8exc2Mxf9x8ax87xc2Jxc7O=xd5xf8xcexf5xc1n6Ux17rxa0xdbxccx07*5x08x95xeexcd%x9cx8ax90Exf7!Ux0cx99xccxccx8cxe5xd1xefx0b;xcbx9fx1fxdfxd9xf6x88!x04Oxeax8dIx90zxfex01x1f+xa4Bxaax8axd0xe1Uxe23xa1x87xdbxc6Wxe0nxa2xe3Fxb2x84xc9xc6xeb""
                }
            }
        }
    }
}

 

Usage from Smart Contract

Usage from Smart Contract

Usage details from a Smart Contract