🖇️Integration Process

Overview

Centic provide Web Application to support Users and Businesses explore the Growth of an Ecosystem. However, for more strong Growth, we support three methods for DApps to integrate Centic’s Intelligence into their Ecosystem, including:

  • Using Centic pre-build UI

  • Using Centic SDK

  • Using Restful API

Before you begin

  1. Go to the Integration tab.

  2. Click the eye icon to show the newly created API key.

  3. Append the API key created to the x-API key field in the header of every API request

Integration Detail

The integration method to choose depends on the specific business logic of your app.

Using Centic Prebuilt UI

This method can be used to prove the wallet score of users without revealing their wallet address. This can be done by generating a ZkProof of the user score, the proof will be then verified by your app later. This way, your app can know the validity of the user's score without knowing about their wallet address.

Centic Prebuilt UI is only used to get the user's wallet score (for example Crypto credit score). The process flow can be described in the following picture:

1. Request services

To start the process your app will need to send an HTTP request to Centic server to get the temporary URL.

API endpoint: https://develop.centic.io/v1

HTTP request: GET /centic-services/createUrl

Parameter detail

Response

2. Redirect

After getting the temporary URL, redirect the user to that URL, the URL will lead to a Centic prebuilt UI to generate the score proof.

3. Getting the Proof

The sessionId returned in step 1 can be used to check the proof generation status and get the proof if the proof generation process is finished.

API endpoint: https://develop.centic.io/v1

HTTP request: GET /centic/services/getProofData

Parameter detail

Response

4. Verify the proof

  • After getting the proof, you can implement the verification process on your server or use the Centic verify service.

  • The user credit score then can be extracted from the first element of the public Signals field.

const credit_score=JSON.parse(proof).publicSignals[0]
  • Implement verifying proof on your app server. 1. Install snarkJs: more detail here 2. Get the verification key here 3. The verify function can be written as this example:

const { groth16 } = require("snarkjs")
const v_key = require("./verification_key.json")

async function verifyProof (proof) {
    let publicSignals = proof.publicSignals
    const result = await groth16.verify(v_key, publicSignals, proof.proof);
    return result
}
  • Verify proof on Centic Server.

You can send and verify proof on Centic server using Api Call:

API endpoint: https://develop.centic.io/v1

HTTP request: POST /bank/user/verify

Request body detail

Response

Using Centic SDK

This method allows you to calculate an entity score right on your app based on the score calculation model.

You can see the detailed instructions including full code to integrate through Centic SDK HERE

Using Restful API

This method is used to get any entity score (for example: Token health score, AAVE ecosystem wallet reputation).

API endpoint: https://develop.centic.io/v1

HTTP request: GET /centic-services/calculateCustomScore/{entity address}

Parameter detail

Response

Last updated