Validator API exposes a single endpoint /api/v1/proof.
The endpoint takes a hex-string data to be signed, and an hCaptcha challenge token to be verified. See file example.http.
Once hCaptcha token validity is verified, data is included in a signed Proof-of-Humanity, which is returned along with a timestamp.
See details and example: OpenAPI interface
Generated Proof-of-Humanity could be further verified on-chain in a smart contract.
This API can be used as an example for other PoH validator APIs.
docker run -it \
-p 8080:8080 \
--env PORT=8080 \
--env VALIDATOR_KEY=0x89c821ae8f9abcd0737f910e3de1904699df9e390a9f184f01f941e20dac8a52 \
--env HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000 \
bakoushin/poh-validator-hcaptchagit clone https://github.com/Human-Protocol/poh-validator-hcaptcha-api.git
cd poh-validator-hcaptcha
npm install
npm startcurl -X POST http://localhost:8080/api/v1/proof \
-H 'Content-Type: application/json' \
-d '{ "data": "0xef9990adc264ccc6e55bd0cfbf8dbef5177760273ee5aa3f65aae4bbb014750f", "token": "10000000-aaaa-bbbb-cccc-000000000001" }'Set appropriate environment variables in a
.envfile before starting a server.
| Env. variable | Description | Example |
|---|---|---|
| PORT | Port to run on | 8080 |
| VALIDATOR_KEY | Private key to sign proofs | 0x89c821ae8f9abcd0737f910e3de1904699df9e390a9f184f01f941e20dac8a52 |
| HCAPTCHA_SECRET | hCaptcha account secret key | 0x0000000000000000000000000000000000000000 |
- Proof-of-HUMANity on-chain: protect your smart contracts from bots
- Proof-of-Humanity-React
- Proof-of-Humanity hCaptcha Validator React
- Proof-of-Humanity hCaptcha Validator API
- Proof-of-Humanity Solidity Contracts
- Counter dApp Example
Alex Bakoushin
MIT