Human Network
  • ☀️Welcome to Human Network
  • Overview
    • What is Human Network? What are Human Keys?
    • Methods and their use cases
      • Deriving keys from low-entropy data
      • Deriving keys from web accounts
      • Provably encrypting to Human Network, and setting custom decryption conditions.
    • FAQ
  • Decentralization
    • Architecture
      • Preventing Collusion
      • Scalability
      • Credit System
    • Mainnets and Testnets
  • For Operators
    • Register and Run a Human Node
      • Use Keystore for private key encryption
      • Keyshare backup
    • Diagnostics using the Network UI
  • For developers
    • Human Network Credits
    • Making Requests to Human Network
      • Signer on behalf of users
      • Directly query the network
    • Types of requests
      • OPRF To Derive Keys From Low-Entropy Data
      • Decryption of Provably Encrypted Data
Powered by GitBook
On this page
  • Build the signer
  • Obtain Credits
  • Make Requests to the Signer
  1. For developers
  2. Making Requests to Human Network

Signer on behalf of users

If you have a dapp, we suggest that you sponsor requests on behalf of your users using the Signer.

To use the Signer you will want to

  1. Build the signer

  2. Obtain credits for the signer.

  3. Optionally, set up custom rate limiting so that users cannot exhaust your credits too quickly.

  4. Send user requests to the signer to be sponsored

Build the signer

Using docker (easy, but no rate limit)

If you do not want to add a custom rate limit, you can fetch the signer as a Docker image mishtinetwork/signer

Please, provide the team your docker hub email address or username so we can give you access to the docker image.

To run the Signer enter the following commands:

sudo docker run -d --name signer -p {SIGNER_PORT_FROM_ENV}:{SIGNER_PORT_FROM_ENV} --env-file .env mishtinetwork/signer

with the following .env file

SIGNER_ENV=prod
MISHTI_RPC_URL=<MISHTI_RELAY_NODE_MAINNET_ALPHA_URL>
MISHTI_SIGNER_PRIVATE_KEY=<YOUR_WHITELISTED_PRIVATE_KEY ex: 0x4a54...>
SIGNER_PORT=<DESIRED_PORT_DEFAULT_IS_3030>
ALLOWED_METHODS=<ADD_HERE_THE_ALLOWED_METHODS>
# If you want to enable rate limiting, default is true
RATE_LIMIT_ENABLED=true
# This is the maximum number of requests allowed in the time interval, default is 100
RATE_LIMIT_NUM_REQUESTS=100
# in seconds, default is 1 day
RATE_LIMIT_TIME_INTERVAL=86400
  • MISHTI_RELAY_NODE_MAINNET_ALPHA_URL: http://44.217.242.218:8081

  • MISHTI_SIGNER_PRIVATE_KEY: Use this private key to obtain credits or get whitelisted.

The ALLOWED_METHODS environment variable specifies which request methods the signer service allows. Set it as a comma-separated list of method names.

Permitted Methods:

  • OPRFSecp256k1

  • OPRFBabyJubJub

  • JWTPRFSecp256k1 (Not for external integrators)

Eg:

ALLOWED_METHODS=OPRFSecp256k1,OPRFBabyJubJub

Only the methods listed in ALLOWED_METHODS will be processed. Others will be rejected. Update this variable to manage which operations the signer will accept.

To prevent unauthorized usage and credit exhaustion, run the signer on a private network and secure it with an authentication server.

From source (slightly more work, but allows custom rate limiting)

Coming soon...

Obtain Credits

To obtain credits, please review:

Make Requests to the Signer

Then from our mishtiwasm, you'll be able to form the correct requests to send to your Signer.

mishtiwasm can be fetched by running:

npm i @holonym-foundation/mishtiwasm

Here is an example of a frontend code for generating keys from input data using mishtiwasm and the signer.

import initMishtiwasm, { request_from_signer } from '@holonym-foundation/mishtiwasm';

async function runRequest() {
  await initMishtiwasm();

  request_from_signer("usr:123", "OPRFBabyJubJub", "http://127.0.0.1:3000")
     .then(result => {
        console.log(`Request succeeded:`, result);
     })
     .catch(err => {
        console.error(`Request failed:`, err);
     })
     .finally(() => {
        console.log("Request completed");
     });
}

runRequest();

Please refer to this GitHub repository to run an example program:

PreviousMaking Requests to Human NetworkNextDirectly query the network

Last updated 9 days ago

Human Network Credits
GitHub - AnmolBansalDEV/mishtiwasm-playGitHub
Logo