<aside> 💡 For queries contact: tech@hmt.ai https://t.me/excerebrose

</aside>

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b3489a3d-227f-45ff-901d-1ae64ed01a2d/Untitled.png

Resources

Human Escrow Solidity Contracts

Human Swagger Spec

Human Swagger Ethereum Server Implementation Human API

Technical Flow

Exchanges

Exchanges are where action on jobs takes place: ie. annotation of dataset.

Every exchange needs to do the following things to get on the human protocol:

Step 1

Register on the Human MetaAPI Dashboard to receive an API Key & Shared Secret Key

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c15ffc44-2783-4eb0-b0fc-b754f4521cdd/Screenshot_2021-03-19_at_17.50.54.png

Step 2

Implement a webhook listener of the following shape to consume new jobs:

{
		"network_id": <int>,
    "exchange_id": <int>,
		"job_address": <string>,
		"job_manifest": <string:url>
}

Note: To verify the webhook, each consumption request will have the header X-human-signature whose value is HMAC sha256 hexDigest of the JSON payload (stringified) and the Human Key

Example:

def generate_hmac_signature(key, msg):
    """
    Params:
        key: hex string type
        msg: bytestring type
    """
    hmac_obj = hmac.new(
        key=bytes.fromhex(key),
        msg=msg,
        digestmod=hashlib.sha256,
    )
    return hmac_obj.hexdigest()

generate_hmac_signature(model.api_key.hex, request.get_json()) == request.headers.get('X-human-exchange-signature'):
	continue()
else:
	error()