Centic Docs
  • 📎Welcome to Centic - Center of Data Analytics!
  • 💻Our Products and Services
    • DApp Growth
    • Marketing Automation
    • Web3 Engagement
    • Entity-oriented API
      • DApps
        • Lending pool
        • Dexes
        • Gaming
      • Wallet
      • Token
      • Foundation
      • Growth Analytics
        • DApp Users
        • Token Holders
        • Social Media
        • Engagement
      • Marketing Automation
        • Campaigns
        • Actions
        • Report
        • AI Features
  • 📊Datasets
  • 🖇️Integration Process
  • 🔎FAQs
  • Other Resources
    • Website
    • Medium
    • Github
Powered by GitBook
On this page
  • Overview
  • Before you begin
  • Integration Detail
  • Using Centic Prebuilt UI
  • 1. Request services
  • 2. Redirect
  • 3. Getting the Proof
  • 4. Verify the proof
  • Using Centic SDK
  • Using Restful API

Integration Process

PreviousDatasetsNextFAQs

Last updated 10 months ago

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.

HTTP request: GET /centic-services/createUrl

Parameter detail

Param name

Type

Required

Description

web2Id

string

yes

The string identity of the user using your app

condition

number

yes

The minimum credit score required, user having credit score under this value cannot generate the proof

scoreId

string

yes

The score model ID

Response

Name

Type

Example

url

string

sessionId

string

527ae6d7-6741-4680-98e6-ee31ba8fbc9c

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.

HTTP request: GET /centic/services/getProofData

Parameter detail

Param name

Type

Required

Description

sessionId

string

yes

The string identity of the user using your app

Response

Name

Type

Description

status

string

the proof generation status, either “PROCESSING” or “FINISHED”

proof

string

the proof generated if the status is “PROCESSING” this field will not be returned

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]
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:

HTTP request: POST /bank/user/verify

Request body detail

Param name

Type

Required

Description

proof

object

yes

The proof generated

Response

Name

Type

Description

valid

boolean

The verification result

Using Centic SDK

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

Using Restful API

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

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

Parameter detail

Param name

Type

Required

Description

scoreId

string

yes

The score model ID

Response

Name

Type

Description

Example

score

number

The entity score calculated

700

other props

any

These props will vary depend on the score model

API endpoint:

API endpoint:

Implement verifying proof on your app server. 1. Install snarkJs: more detail 2. Get the verification key 3. The verify function can be written as this example:

API endpoint:

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

API endpoint:

🖇️
https://develop.centic.io/v1
https://develop.centic.io/v1
here
here
https://develop.centic.io/v1
HERE
https://develop.centic.io/v1
https://zkp.centic.io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3ZWIySWQiOiJmZGJmYzI1MmQ0IiwiZGV2RW1haWwiOiJ2bmhpZW4xOTk5QGdtYWlsLmNvbSIsInNjb3JlSWQiOiJkZDg0MjgzMi0zYTA3LTQ5ZjQtYTllNS00MDlhZGJmZTg3ZjgiLCJvcGVyYXRvciI6MCwiY29uc2l0aW9uIjoiMjUwIiwic2Vzc2lvbklkIjoiNTI3YWU2ZDctNjc0MS00NjgwLTk4ZTYtZWUzMWJhOGZiYzljIiwiaWF0IjoxNzAxNDA2MDkyLCJleHAiOjE3MDE0MDY2OTJ9.-TE4OEzh1bjsVRsMcJdLFtidE-37e5_s1fBiNUaJ1uE&thirdPartyID=vnhien19&web2ID=fdbfc252d4&condition=250&sessionId=527ae6d7-6741-4680-98e6-ee31ba8fbc9c