Directly query the network

Create your point from your input

With mishtiwasm

Install:

npm i @holonym-foundation/mishtiwasm

Here is an example for a Human Key creation with oprf secp256k1

Import:

import init, { oprf_client_step1_secp256k1, unmask_secp256k1 } from "@holonym-foundation/mishtiwasm"
// important to call init -- wasm is initialized asynchronously.
// without it, the other functions won't work
await init();

To create a masked point from your input, use:

// Salt and secret input are arrays of uint8s
const { encoded_masked_point, secret_mask } = oprf_client_step1_secp256k1(salt, secret);

encoded_masked_point can be the value for point in the RequestToNetwork

Unmasking the point

After querying the network and receiving the point response_from_network, unmask the response via

This is the output of the OPRF!

Form a query to Human Network

Querying the epoch and their request number via the POST /user-state/ endpoint to find the user

Requests to the network are of the following format

Use the point obtained above as pub point: Vec<u8>

Method is an enum with the following format

Here is an example request:

How to find the epoch, request_per_user, and signature fields

To make a request to the network you need to know a few things

  • epoch

  • request_per_user signifying how many requests the signer who signed off on the request has made

  • signature by the user who signed the request who you need to have credits at the address who signed the request.

Query the network

Run the following command:

Last updated