You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
This leaves us free to randomise the order of the captcha when we are passing them to users. When you're sending the captcha to the user from the API you can do something like:
send ( random_order( captcha.items ) )
The user sends back their solution array
[hash5, hash2, hash0]
Then you sort it alphabetically and compare to the stored solution array of hashes.
Spec
Importing datasets that include indexed solutions:
Importing dataset
items to include hash for each item
exclude solution from captchas collection in database
include solved flag (true for captcha that included the solution when dataset was imported)
Dataset ID hash (merkle tree root) to include hashed solution
When checking a solution sent by the frontend, re-compute + compare merkle tree root to check whether they answered correctly. The following is a rough idea of how this should work.
In dappUserSolution get the merkle tree for the dataset currently being used by the provider
Calculate the captchaIds including solutions passed by the dapp user
Generate a proof for each captchaId to ensure that it is part of the merkle tree and check that the datasetId is correct in each case
The text was updated successfully, but these errors were encountered:
Current Functionality and Idea
Datasets currently have the following format in which solutions are provided as indexes of the
items
array.When we process datasets we are already hashing images / text:
https://github.com/prosopo-io/contract/blob/31a52da278164296a064adfe19a0fc36033a351b/src/captcha/captcha.ts#L125-L136
It makes sense for us to use the item hashes as the solution. In the above example, the solution
[2,3,8]
would become:This leaves us free to randomise the order of the captcha when we are passing them to users. When you're sending the captcha to the user from the API you can do something like:
send ( random_order( captcha.items ) )
The user sends back their solution array
[hash5, hash2, hash0]
Then you sort it alphabetically and compare to the stored solution array of hashes.
Spec
Importing datasets that include indexed solutions:
Importing dataset
solution
fromcaptchas
collection in databasesolved
flag (true for captcha that included the solution when dataset was imported)Dataset ID hash (merkle tree root) to include hashed solution
sort([h1,h2,h3])
Solution validation
When checking a solution sent by the frontend, re-compute + compare merkle tree root to check whether they answered correctly. The following is a rough idea of how this should work.
dappUserSolution
get the merkle tree for the dataset currently being used by the providerThe text was updated successfully, but these errors were encountered: