Quantum Random Number Generator

Overview #

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

Making a request #

Three steps are needed to get a rondom number:

  1. Login/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 #

See the article API Login for details on how to login to the API and request an access token.

Step 2: Quantum Random Number Request #

Perform a POST request to the following endpoint:

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

Include Authorization 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!xcfxe8xf0
                               x0fx8exc2Mxf9x8ax87xc2Jxc7O=xd5xf8xcexf5xc1n6Ux17rxa0xdbxccx07*5
                               x08x95xeexcd%x9cx8ax90Exf7!Ux0cx99xccxccx8cxe5xd1xefx0b;xcbx9f
                               x1fxdfxd9xf6x88!x04Oxeax8dIx90zxfex01x1f+xa4Bxaax8axd0xe1Uxe23
                               xa1x87xdbxc6Wxe0nxa2xe3Fxb2x84xc9xc6xeb\""
                }
            }
        }
    }
}

Postman examples #

Example of a request to the QRNG endpoint and the response with the Job Id:

Example of the request to get the status of a QRNG job and while it’s being processed:

Example of the response of a job that has finished and includes the random number result: