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
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
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
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
andrandValue
, along with other details, are used as parameters when calling thecreateAttestation
function on the Ethos Attestation smart contract.
Create Register Address Signature
Description: Creates a backend-generated signature required for submitting a transaction to register the authenticated user's smart wallet address with their profile on the blockchain.
Authentication Required: Yes (Requires Privy Session and Profile)
Parameters
None (The address to register is the smartWallet
derived from the authenticated user's Privy session).
Responses
Success Response
Code: 200 OK
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 registration details (profileId, address, randValue).
Error Responses
Code: 400 Bad Request
Code: 401 Unauthorized
Code: 403 Forbidden
Example
Request
Response
Notes
Requires authentication.
Retrieves the user's
smartWallet
address from their Privy session.Checks that the smart wallet isn't already registered to the profile.
Creates a signature that the user needs to use when calling the
registerAddress
function on the Ethos Profile smart contract.This signature proves the backend authorizes the registration of the user's smart wallet to their profile ID.
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
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
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
andrandValue
are used as parameters when calling thecreateSlash
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 validattestationDetails
.The signature combines the authenticated user's profile ID, a random value, and all slash parameters.
Last updated