Retro PGF Public API Spec

The Retro PGF API, hosted on https://vote.optimism.io/, facilitates a blockchain-based voting mechanism for the Optimism community. Leveraging the "Sign In With Ethereum" protocol, users can authenticate themselves and engage in ballot activities such as viewing, saving, and submitting their votes. Additionally, users can express their preferences by "liking" specific lists. For administrative purposes, there's a dedicated set of functions, protected by a unique API key, enabling the OP Foundation to download and manage all the submitted ballots in a structured CSV format.

Base URL

Dev: https://optimism-agora-dev.agora-dev.workers.dev/

https://vote.optimism.io/

1. Authentication

Authentication API is following SIWE (Sign In With Ethereum) standard: https://docs.login.xyz/

Client implementation is recommended via ConnectKit

1.1 Get Nonce

This endpoint generates a unique nonce for address. The server will set an HTTP-only cookie containing the nonce. This cookie will be used for subsequent requests to the server. The cookie expiry will be set to 5 minutes.

Endpoint**:** /api/auth/nonce

Method**:** POST

Response:

{
	nonce: "string"
}

1.2 Verify

This endpoint verifies SIWE signature against nonce and returns JWT token. This access-token will has to be provided as Bearer token in the requests to the protected endpoints.