# JSON-RPC

[RPC](https://en.wikipedia.org/wiki/Remote_procedure_call) is a [request–response](https://en.wikipedia.org/wiki/Request%E2%80%93response) concept when a computer program causes a procedure to execute in a different [address space](https://en.wikipedia.org/wiki/Address_space) (commonly on another computer on a shared network).&#x20;

In our case, we can say that RPC is a way for an external program—for example, a browser or front-end application—to communicate with the humanode peer to explore current network state and submit extrinsics.

Humanode provides several [substrate based RPCs](https://docs.substrate.io/build/custom-rpc/) to communicate with a node including [default  list of RPCs](https://polkadot.js.org/docs/substrate/rpc/) that substrate comes with.

We would like to introduce more common and useful RPCs including custom bioauth related ones.

## Chain state RPCs

Storage related RPCs allows you to explore current chain state based on provided `module` and `method`. It's done via `api.query.<module>.<method>` call.

The full list of available storage RPCs you can find [here](https://polkadot.js.org/docs/substrate/storage).

## Extrinsics RPCs

Extrinsics for particular `module` and `method` can be submitted using `api.tx.module.method` call.

The full list of available extrinsics RPCs you can find [here](https://polkadot.js.org/docs/substrate/extrinsics).

## Bioauth RPCs

Humanode team has developed bioauth related [custom RPCs](https://docs.substrate.io/build/custom-rpc/#rpc-extension-builder) with the following functionalities:

Authentication based on provided liveness data

* **interface**: `api.rpc.bioauth.authenticate`
* **jsonrpc**: `bioauth_authenticate`

Enrollment based provided liveness data.

* **interface**: `api.rpc.bioauth.enroll`
* **jsonrpc**: `bioauth_enroll`

Getting the current bioauth status.

* **interface**: `api.rpc.bioauth.status`
* **jsonrpc**: `bioauth_status`

Getting a FaceTec Session Token.

* **interface**: `api.rpc.bioauth.getFacetecSessionToken`
* **jsonrpc**: `bioauth_getFacetecSessionToken`

Getting the configuration required for the Device SDK.

* **interface**: `api.rpc.bioauth.getFacetecDeviceSdkParams`
* **jsonrpc**: `bioauth_getFacetecDeviceSdkParams`
