This page covers the SDK methods and contract functions used to register, link, and manage user identity data with Newton.Documentation Index
Fetch the complete documentation index at: https://docs.newton.xyz/llms.txt
Use this file to discover all available pages before exploring further.
SDK Methods
The following methods are available on the wallet client actions extension (newtonWalletClientActions).
registerUserData
Registers KYC data for a user, scoped to your application’s identity domain. Opens the Newton identity popup to securely store the data.
Signature:
| Parameter | Type | Description |
|---|---|---|
userData | KycUserData | KYC data object from your identity vendor |
appIdentityDomain | Hex | Output of keccak256("kyc") |
policyClient | Address | Policy client contract address (used for HPKE encryption AAD binding) |
linkApp
Links a user’s registered identity to your policy client contract. The user must confirm the link in the Newton identity popup, which triggers a signed transaction from their wallet.
Signature:
| Parameter | Type | Description |
|---|---|---|
appWalletAddress | Address | The user’s dapp wallet address |
appClientAddress | Address | Your deployed policy client contract address |
appIdentityDomain | Hex | Output of keccak256("kyc") |
unlinkApp
Removes a user’s identity link from your policy client contract.
Signature:
| Parameter | Type | Description |
|---|---|---|
appWalletAddress | Address | The user’s dapp wallet address |
appClientAddress | Address | Your deployed policy client contract address |
appIdentityDomain | Hex | Output of keccak256("kyc") |
Contract Functions
linkIdentityAsUser
Called on the IdentityRegistry contract to link a user’s identity to a policy client. This is invoked under the hood when the user confirms the link via linkApp. See Contract Addresses for the IdentityRegistry address.
Signature:
| Parameter | Type | Description |
|---|---|---|
_identityOwner | address | The identity owner being used to authorize access to the existing identity |
_policyClient | address | The policy client where the data is to be associated |
_identityDomains | bytes32[] | The identity domains specifying what type of data is associated |
_signature | bytes | Signature by the _identityOwner to authorize the link |
_nonce | uint256 | Nonce for the signature |
_deadline | uint256 | Deadline for the signature |
Sample Policy Client
Your policy client contract must inherit bothNewtonPolicyClient and EIP712. Below is a complete example:
After deploying, register this contract with the
PolicyClientRegistry. See Smart Contract Integration for instructions.Next Steps
Identity Policy Reference
Rego built-in functions for writing identity-aware policies
Contract Addresses
IdentityRegistry and other deployed contract addresses