Signatures

Overview

The Signatures API provides endpoints for generating backend signatures required for certain blockchain transactions within the Ethos network. These signatures authorize actions like creating attestations, registering addresses, or submitting slashes, ensuring that only authenticated and validated operations proceed to the smart contracts.

Endpoints

Create Attestation Signature

POST /api/v1/signatures/create-attestation

Description: Creates a backend-generated signature required for submitting an attestation transaction (e.g., linking a Twitter account) to the blockchain.

Authentication Required: Yes (Requires Privy Session and Profile)

Parameters

Request Body

{
  "service": "x.com", // Currently only "x.com" is supported
  "connectedAddress": "string" // Wallet address connected via Privy
}
Property
Type
Required
Description

service

string

Yes

The service name being attested (currently must be x.com).

connectedAddress

string

Yes

The wallet address connected via Privy, matching the session.

Responses

Success Response

Code: 200 OK

Property
Type
Description

ok

boolean

Indicates if the API call itself was successful.

data

object

Container for the response data.

data.randValue

number

A random nonce value (timestamp) included in the signed message.

data.signature

string

The signature generated by the backend signer over the attestation details.

data.account

string

The account identifier (e.g., Twitter User ID) retrieved from the user's linked Privy account.

data.evidence

string

A JSON string containing details about the attestation source (Privy OAuth2).

Error Responses

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Example

Request

Response

Notes

  • Requires authentication.

  • The user must have linked the specified service (Twitter) to their Privy account beforehand.

  • Checks if the connectedAddress matches the authenticated user's Privy session.

  • Verifies that an attestation doesn't already exist for this profile/service/account.

  • The returned signature and randValue, along with other details, are used as parameters when calling the createAttestation function on the Ethos Attestation smart contract.


Create Slash Signature

Description: Creates a backend-generated signature required for submitting a slash transaction to the blockchain. A slash is a community moderation action that can affect a user's score or financial status.

Authentication Required: Yes (Requires Privy Session and Profile)

Parameters

Request Body

Property
Type
Required
Description

subject

string

No*

Ethereum address of the subject being slashed (null if using attestation).

amount

number

Yes

Positive integer representing the severity/amount of the slash.

comment

string

Yes

Description of why the slash was created (min length 1).

metadata

string

Yes

JSON string with additional metadata about the slash.

attestationDetails

object

Yes

Details about the attestation if slashing by service/account.

attestationDetails.service

string

Yes

Service name (e.g., "x.com").

attestationDetails.account

string

Yes

Account identifier for the service.

*Either subject (for address-based slashes) or valid attestationDetails (for attestation-based slashes) must be provided.

Responses

Success Response

Code: 200 OK

Property
Type
Description

ok

boolean

Indicates if the API call itself was successful.

data

object

Container for the response data.

data.randValue

number

A random nonce value (timestamp) included in the signed message.

data.signature

string

The signature generated by the backend signer over the slash details.

Error Responses

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Example

Request

Response

Notes

  • Requires authentication.

  • The user must have permission to create slashes (authorization checked by the canSlash function).

  • The returned signature and randValue are used as parameters when calling the createSlash function on the Ethos Slash smart contract.

  • For address-based slashes, provide the subject parameter with an Ethereum address.

  • For attestation-based slashes (e.g., Twitter accounts), set subject to null and provide valid attestationDetails.

  • The signature combines the authenticated user's profile ID, a random value, and all slash parameters.


Last updated