Identity Verification
Deploy ONCHAINID
Unsigned deployment of an identity contract for a wallet on an ERC-3643 register
POST
/
customers
/
api
/
identity
/
onchainid
curl -X POST "https://api.trusset.org/customers/api/identity/onchainid" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"signerAddress": "0xCD92134767aEC2562be15d2a2062A082dA17dD84"
}'
const api = 'https://api.trusset.org/customers/api/identity';
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const walletAddress = '0x96C5822784130360F904372b83E130be4A1894D6';
const built = await fetch(`${api}/onchainid`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, signerAddress: await wallet.getAddress() })
}).then(r => r.json());
if (!built.data.exists) {
const tx = await wallet.sendTransaction({ data: built.data.transaction.data });
await tx.wait();
await fetch(`${api}/onchainid/confirm`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, txHash: tx.hash })
});
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"exists": false,
"action": "SIGN_TRANSACTION",
"stepType": "deployIdentity",
"managementKey": "0xCD92134767aEC2562be15d2a2062A082dA17dD84",
"implementationAuthority": "0x77B26Fa7a8a7907134c56c83a56728Fb7C839FbD",
"transaction": {
"to": null,
"data": "0x608060405234801561001057600080fd5b50...",
"create": true
},
"functionName": "IdentityProxy",
"description": "Deploy the ONCHAINID identity contract for 0x96C5822784130360F904372b83E130be4A1894D6 (management key 0xCD92134767aEC2562be15d2a2062A082dA17dD84)",
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"identity": "0x8986b6a837ccA6c6F6e257526296f07b9fe3fA9f",
"exists": true,
"registered": true,
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "REGISTER_OPERATION_UNSUPPORTED",
"message": "This instance writes to a Trusset identity register, which needs no ONCHAINID: verify the wallet directly."
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
Returns the unsigned contract creation that deploys an ONCHAINID for a customer’s wallet. An ERC-3643 register looks up an identity contract per wallet, so a wallet needs one before it can be registered. Build Pending Registration asks for the same deployment in its
The ONCHAINID is created with
DEPLOY_IDENTITY phase, and this endpoint lets you deploy ahead of time.
Only an instance bound to an ERC-3643 register can use it. A Trusset register needs no ONCHAINID, and the call answers REGISTER_OPERATION_UNSUPPORTED.
This call asks only the register whether the wallet has an ONCHAINID. It does not see one you deployed and confirmed for a wallet that is not registered yet, and plans a second deployment. Confirming that one as well replaces the recorded identity with the newer one.The deployment names no customer wallet, so Confirm ONCHAINID cannot tell which wallet it was built for. Confirm each deployment with the
walletAddress you requested it for.managementKey as its management key. That is an issuer wallet, not the customer’s. Confirm ONCHAINID refuses a management key that is not a wallet registered to your instance.
Body Parameters
string
required
The customer’s wallet.
string
The wallet to name as the management key. Omit it to use your instance’s primary registered wallet, or the most recently registered one when none is primary. Name a wallet registered to your instance, because the confirm refuses any other with
MANAGEMENT_KEY_NOT_INSTANCE. A malformed address is ignored.Broadcast the deployment
Sendtransaction.data as a contract creation, with no to. transaction.create marks it as one and is not a field to pass to your wallet library.
Any wallet can send it. The confirm checks the management key the deployment names, not the sender.
Then record it with Confirm ONCHAINID, using the same walletAddress. Until then, Build Pending Registration does not know the identity exists.
Response Fields
object
Show child attributes
Show child attributes
string
TREX.string
The customer’s wallet, checksummed.
boolean
true when the register already holds an ONCHAINID for the wallet. Nothing is built then.string
The registered ONCHAINID. When
exists is true only.boolean
Whether the wallet is on the register, which is always
true when exists is. When exists is true only.string
SIGN_TRANSACTION. This field and the ones down to description come back only when exists is false.string
deployIdentity.object
to (null), data, and create (true).string
IdentityProxy.string
The management key the ONCHAINID is created with.
string
The implementation authority the ONCHAINID proxies to, read from an identity already on the register.
string
What the step does.
object
endpoint and fields of the confirm. Present in both shapes.curl -X POST "https://api.trusset.org/customers/api/identity/onchainid" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"signerAddress": "0xCD92134767aEC2562be15d2a2062A082dA17dD84"
}'
const api = 'https://api.trusset.org/customers/api/identity';
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const walletAddress = '0x96C5822784130360F904372b83E130be4A1894D6';
const built = await fetch(`${api}/onchainid`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, signerAddress: await wallet.getAddress() })
}).then(r => r.json());
if (!built.data.exists) {
const tx = await wallet.sendTransaction({ data: built.data.transaction.data });
await tx.wait();
await fetch(`${api}/onchainid/confirm`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, txHash: tx.hash })
});
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"exists": false,
"action": "SIGN_TRANSACTION",
"stepType": "deployIdentity",
"managementKey": "0xCD92134767aEC2562be15d2a2062A082dA17dD84",
"implementationAuthority": "0x77B26Fa7a8a7907134c56c83a56728Fb7C839FbD",
"transaction": {
"to": null,
"data": "0x608060405234801561001057600080fd5b50...",
"create": true
},
"functionName": "IdentityProxy",
"description": "Deploy the ONCHAINID identity contract for 0x96C5822784130360F904372b83E130be4A1894D6 (management key 0xCD92134767aEC2562be15d2a2062A082dA17dD84)",
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"identity": "0x8986b6a837ccA6c6F6e257526296f07b9fe3fA9f",
"exists": true,
"registered": true,
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "REGISTER_OPERATION_UNSUPPORTED",
"message": "This instance writes to a Trusset identity register, which needs no ONCHAINID: verify the wallet directly."
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
INVALID_ADDRESS | 400 | walletAddress is missing or malformed |
NO_REGISTERED_WALLET | 409 | No signerAddress was sent and your instance has no registered Ethereum wallet to name as the management key |
ONCHAINID_AUTHORITY_UNKNOWN | 409 | Neither signerAddress nor any registered wallet of your instance is on the register with an ONCHAINID to read the implementation authority from |
OWN_REGISTRY_NOT_CONFIGURED | 409 | Your instance is set to its own register but holds no valid register address |
REGISTER_OPERATION_UNSUPPORTED | 409 | Your instance writes to a Trusset register. The same answer comes back when the register could not be read to tell its interface, so retry once before relying on it |
ONCHAINID_BUILD_FAILED | 400 | A chain read failed |
ONCHAINID_BUILD_FAILED | 500 | Any other failure |
⌘I
curl -X POST "https://api.trusset.org/customers/api/identity/onchainid" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"signerAddress": "0xCD92134767aEC2562be15d2a2062A082dA17dD84"
}'
const api = 'https://api.trusset.org/customers/api/identity';
const headers = { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' };
const walletAddress = '0x96C5822784130360F904372b83E130be4A1894D6';
const built = await fetch(`${api}/onchainid`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, signerAddress: await wallet.getAddress() })
}).then(r => r.json());
if (!built.data.exists) {
const tx = await wallet.sendTransaction({ data: built.data.transaction.data });
await tx.wait();
await fetch(`${api}/onchainid/confirm`, {
method: 'POST',
headers,
body: JSON.stringify({ walletAddress, txHash: tx.hash })
});
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"exists": false,
"action": "SIGN_TRANSACTION",
"stepType": "deployIdentity",
"managementKey": "0xCD92134767aEC2562be15d2a2062A082dA17dD84",
"implementationAuthority": "0x77B26Fa7a8a7907134c56c83a56728Fb7C839FbD",
"transaction": {
"to": null,
"data": "0x608060405234801561001057600080fd5b50...",
"create": true
},
"functionName": "IdentityProxy",
"description": "Deploy the ONCHAINID identity contract for 0x96C5822784130360F904372b83E130be4A1894D6 (management key 0xCD92134767aEC2562be15d2a2062A082dA17dD84)",
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": true,
"data": {
"registerKind": "TREX",
"walletAddress": "0x96C5822784130360F904372b83E130be4A1894D6",
"identity": "0x8986b6a837ccA6c6F6e257526296f07b9fe3fA9f",
"exists": true,
"registered": true,
"confirmWith": {
"endpoint": "POST /customers/api/identity/onchainid/confirm",
"fields": ["walletAddress", "txHash"]
}
},
"error": null,
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "REGISTER_OPERATION_UNSUPPORTED",
"message": "This instance writes to a Trusset identity register, which needs no ONCHAINID: verify the wallet directly."
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T10:00:00.000Z"
}
}
