Signature

Signature allow the pop session to be verified and signed for on-chain verification

Starknet PoP Full Public Key: 0400df4e679ffc35951857092a37a3d6e2f657da2f9bbf84db11f67191bbeeaef901460e839b068be16d1155f1b222ffe7200a1fea93dcf82c752fba7c06fe9f87 Starknet PoP StarkKey: 0xdf4e679ffc35951857092a37a3d6e2f657da2f9bbf84db11f67191bbeeaef9


POST/v1/personhood/sign/starknet

Sign session for Starknet

This endpoint allows you to verify and generate a signature that can be verified on Starknet Chain.

The signed challenge is constructed using the user's Starknet address and PoP session concatenated and hashed with the Pedersen hash as follows:

Create the challenge

import { ec } from "starknet";

const userWallet = "0x06ba316C740a79385829293Cf94beb75AA55763d6b8e315163c7B83B32329474"
const sessionId = "3f71697b-1516-4dce-968e-cb7ed9f553e7"

// Convert session id to hex by adding hex prefix and remove "-" character
const hexSessionId = "0x" + sessionId.replace(/-/g, "")

const challenge = ec.starkCurve.pedersen(userWallet, hexSessionId);

Request

POST
/v1/personhood/sign/starknet
curl --location --request POST 'https://api.pop.anima.io/v1/personhood/sign/starknet' \
--header 'Api-Key: {YOUR_API_KEY}' --header 'Content-Type: application/json' \
--data '{"session_id":"{USER_SESSION_ID}"}'

Response

{
    "r": "45571015979080263457258717860363233186359855702731474886261211078530949593",
    "s": "2610312306307011434308980753843188449942018873057266979347151723778403163914"
}