Getting Started
Step 1: Pre-login and login
Pre-login
post
This API is to be called before logging in.
It will return a 'message' that has to be signed and sent to '/login' API.
This will also create a cookie;
hence the '/login' API must be called in a session.
Authorizations
CookiestringRequired
Path parameters
proof_typestringRequired
Body
publicKeystringRequired
The key used for login
NOTE: when using 'ethereum' the 'publicKey = Address'
keyTypestring · enumRequired
Possible values:
The key-type of publicKey.
As of now these are supported keyTypes:
1. solana
2. ethereum
rolestring · enumRequired
Possible values:
The role the user intends to play after login:
1. prover
User who wants to prove what it offers to the network.
Example: 'bandwidth', 'latency', 'disk', 'cpu' etc.
2. challenger
User who wants to challenge a 'prover'
and earn rewards.
3. payer
An abstract entity/user who pays
and requests for a challenge.
A payer could be:
the 'prover' itself, other users, or the blockchain.
projectNamestringOptional
If the user is also part of another blockchain project/app,
then the project-name/app-name can be provided here.
e.g. "filecoin", "filecoin-station", "oort", etc.
projectPublicKeystringOptional
publicKey of the user associated with the
'projectName' blockchain project/app.
Responses
200
200 response
application/json
400
400 response
application/json
post
/proof/v1/{proof_type}/pre-loginLogin
post
This API logs in the user.
The user should send the 'message' that was received during the '/pre-login';
and must sign the 'message' using privateKey.
And send it in the 'signature' field.
Authorizations
CookiestringRequired
Path parameters
proof_typestringRequired
Header parameters
CookiestringRequired
The cookies that were received after calling '/pre-login' API.
Body
signaturestringRequired
The signature afer signing the 'message' with the 'privateKey'.
The signature can be created using MetaMask/Phantom wallet.
These signatures are generated through certain wallets/APIs.
e.g.
1. Wallets in browser (Metamask / Phantom)
2. Dart
(https://pub.dev/packages/eth_sig_util)
3. Python
(https://pypi.org/project/eth-account/)
in Python it can be created as:
from eth_account.messages import encode_defunct
from eth_account import Account
msg="<Message received from the pre-login response>"
signature = sign(msg)
def sign(msg):
#
# Hexadecimal key (private key)
key = "<Your-Private-Key>"
# Create the message hash
msghash = encode_defunct(text=msg)
# Sign the message
signature = Account.sign_message(msghash, key)
return "0x" + signature.signature.hex()
#
Responses
200
200 response
application/json
400
400 response
application/json
401
401 response
application/json
402
402 response
application/json
post
/proof/v1/{proof_type}/loginStep 2: Submit an on-chain Challenge Request
Parameters
Values
Step 3: Trigger a Challenge with the Witness Chain Broker
post
Request to create a new challenge using DCL contracts.
Before calling this api 'submitRequest()' smart contract must be called.
And the 'challenge_id' after calling the 'submitRequest' must be provided.
Authorizations
CookiestringRequired
Path parameters
proof_typestringRequired
Header parameters
CookiestringRequired
The cookies that were received after calling '/login' API.
Body
challenge_idstringRequired
The challenge_id that was generated after calling the
DCL 'submitRequest' smart contract.
Responses
200
200 response
application/json
400
400 response
application/json
401
401 response
application/json
post
/proof/v1/{proof_type}/challenge-request-dclStep 4: Monitor the status of the Challenge to obtain the results
post
Get the status of a given DCL challenge.
Authorizations
CookiestringRequired
Path parameters
proof_typestringRequired
Header parameters
CookiestringRequired
The cookies that were received after calling '/login' API.
Body
challenge_idstringRequired
The challenge_id that was generated after calling the
DCL 'submitRequest' smart contract.
Responses
200
200 response
application/json
400
400 response
application/json
401
401 response
application/json
post
/proof/v1/{proof_type}/challenge-status-dclLast updated