Integrating Human ID
What you can do with Human ID and how to start
While Holonym can be used off-chain it is by far most commonly used on-chain. We use the term Soul-Bound Token (SBT) to refer to an on-chain record linked to a user's address. To use Holonym, you simply must direct the user to get their SBT, then you can read the SBT from from our API in one line of code, or from the blockchain itself.
1. Send a user to Holonym to get an SBT
Option A: Via Link or Redirect
You may send the user to
https://id.human.tech/<credentialType> credentialType is one of:
gov-id(for government ID credentials).clean-hands(for sanctions checks).phone(for phone number credentials).biometrics(for non-personally identifying face uniqueness and liveness check).
ePassport
Users can also verify for free using an NFC-enabled government ID document. Please see Verifying ePassport for user instructions.
Note that the ePassport SBT is distinct from the gov-id SBT. A user can get both an ePassport SBT and a gov-id (KYC) SBT.
Option B: Via Human ID SDK
To directly embed Human ID into your website, you can import the Human ID SDK and call
where credentialType is either 'kyc' (for government ID credentials), 'clean-hands', 'phone' (for phone number credentials) or 'biometrics'.
This will prompt the user to complete the SBT minting flow.
2. Read a user's SBT
Option A: Holonym API
To check whether a user has a certain SBT, you can query the Holonym API. The JavaScript example shows how to call the Holonym API (which calls the SBT smart contract) to get whether the user is unique for the given action ID. (Use the default action ID of 123456789.)
Option B (DEPRECATED): On chain
You can call the SBT contract directly. The Solidity example gives anyone 1 gwei who has proven they're from the US. (See more examples in the examples repo.)
You may have noticed one person can claim the gwei many times in the Solidity example! This an example; please do not implement a US stimulus program from it.
Example: Sybil Resistance
1. Send users to Holonym to get government ID uniqueness SBTs
Send users to the following URL.
Users will complete verification and get an SBT at the address of their choosing.
2. Read users' uniqueness SBTs
The below JS example checks whether an address belongs to a unique person.
The smart contract in Solidity gives a privacy-preserving airdrop once-per-person to only unique people.
Last updated