A description of the SPRIG protocol can be found here: https://export.arxiv.org/abs/2102.03044v1 A test version of the website is available at: https://sprigproofs.org
This repository contains a semi-centralised version of the SPRIG protocol whose purpose is to experiment with the protocol and to serve as future reference for a decentralised version. The decisions are taken by some central server, but all the claims, challenges and decisions are logged on the Algorand blockchain, and the exchanges of money are done on the blockchain.
There are six parts in this repository:
- The SPRIG Library, written in Python and without any dependency ->
sprig.py
- A collection of languages descriptions that provide the backend of the protocol ->
languages/
- The contracts for the blockchain, written in Reach, and a frontend written in Javascript ->
frontend/reach
- An web API, written in Python with FastAPI ->
api.py
- A web interface, written in Vue 3 ->
frontend/
Status: Completed Dependencies: Python 3.8
The library contains the logic of the protocol agnostic of the underlying proof language. It can handle claim and challenges, stakes and bounties and updates SPRIG Trees over time. It can also use call the methods in the Reach frontend to interact with the contracts on the blockchain and log its decisions.
Status: Completed Dependencies: Python 3.8
Languages specify the format of claims and the low level verification mechanisms. Support for Lean 4 works but subtle edge cases could be exploited. We implemented a toy language to represent Tic Tac Toe games, which is complete.
Status: Completed Dependencies: Python 3.8, FastAPI
The API / Server is the interface from the library code to the web, so that modifications of SPRIG trees can be made by HTTP requests. The API is generated by FastAPI which provides documentation (with the OpenAPI format) and communicates via the standard JSON format.
Status: Completed Dependencies: Reach 0.1
The contracts are the codes in Reach for the logs of the claims and challenges that will be sent on the Algorand blockchain. The frontend in Javascript is the interface to generate the contracts and interact with them.
Status: Mostly done Dependencies: Vue 3, Vite, npm
The Web interface is the user facing part of the project. It is currently capable of every interaction that is needed with the SPRIG protocol and displays everything there is to know. However, we are still working on making the interface more user-friendly, consistent and efficient.
All dependencies for the web can be installed with
cd frontend
npm install
This will install:
- Vite: the build tool
- Vue 3: the frontend framework that provides components
- lodash: a collection of utility functions
- dayjs: utilities to manipulate dates and times
- Tailwindcss: a CSS framework
- Element+: a collection of ready-made components
- Oh Vue Icons: a collection of icons
- Vue Router: gestion of url and navigation between pages
This code is meant to be run with a recent version of Python (>= 3.8),
and the web api need FastAPI
(pip install fastapi
) to run.
It can be run with uvicorn
as
uvicorn api:api
Alternatively, if you have make
, poetry
and npm
installed,
you can run make install
to get the dependencies and
then make dev
to start the server in development mode.