π§΅ Create and Register a Valid Investor Account
Welcome to the complete guide for the "Create and Register a Valid Investor Account" workflow for the Token City Blockchain API.
This workflow enables you to create a custodian account for an investor, generate and register an on-chain identity, and add the necessary verifications, ensuring their proper integration into the investment platform.
π Objective: Secure and automated onboarding of investors into the Token City ecosystem.
π OpenAPI Documentationβ
β¨ Workflow Summaryβ
This workflow automates the process of creating a valid investor on Token City and blockchain:
- πΉ Create a custodian account in Venly / Onyze.
- πΉ Create an on-chain identity.
- πΉ Register that identity.
- πΉ Add individual verifications (claims).
π Workflow Steps Tableβ
| Step | API Operation | Method | Parameters | Outputs | Description |
|---|---|---|---|---|---|
| Add Custodian Account | POST /accounts | - | accountDetails | accountId | Creates the investor's account in Venly custodian |
| Create On-Chain Identity | POST /on-chain-identity | - | accountId | onChainId | Creates an on-chain identity linked to the account |
| Register On-Chain Identity | POST /on-chain-identity/{identityAddress}/register | - | identityAddress, accountAddress | - | Registers the newly created on-chain identity |
| Add Individual Claims | POST /on-chain-identity/{identityAddress}/claims | - | identityAddress, claimData | - | Adds verified claims to the identity profile |
π¨ Workflow Visualizationsβ
π Mermaid Sequence Diagramβ
π Step-by-Step Implementationβ
Step 1: Create Custodian Accountβ
Create a custodian account for the investor in the Venly/Onyze wallet system.
Endpoint: POST /accounts
Response:
{
"id": "0x1234567890abcdef1234567890abcdef12345678",
"passcode": "001234",
"emergencyCode": "0sFDf422dhF"
}
The response includes the accountId, passcode and emergencyCode. The accountId parameter it's the blockchain address. The passcodeand emergencyCodeparameters are usedtosign transactions.
Step 2: Create On-Chain Identityβ
Create an on-chain identity contract for the investor.
Endpoint: POST /on-chain-identity
Request Body:
{
"accountId": "0x1234567890abcdef1234567890abcdef12345678"
}
Response:
{
"result": {
"identityContractAddress": "0xC593e77451cE7009209Ea4e7F62d64F2355D71ff",
"identityContractId": "6585b5fb-8de8-452d-aa96-8e5de0f1ca09",
"walletLinked": "0x123456A9571241e97cDb61E3FfD1937D885454dd"
}
}
Wait for the transaction to be mined before proceeding to the next step.
Step 3: Register On-Chain Identityβ
Register the newly created identity in the identity registry.
Endpoint: POST /on-chain-identity/{identityAddress}/register
Path Parameters:
identityAddress: The identity contract address from Step 2
Request Body:
{
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"countryCode": "724"
}
Request Parameters:
walletAddress: The wallet address from Step 1country: ISO 3166-1 country code
Response:
{
"id": "123e4567-e89b-12d3-a456-426614174000"
}
Step 4: Add Individual Claimsβ
Add verified claims (KYC/AML verifications) to the identity.
Endpoint: POST /on-chain-identity/{identityAddress}/claims
Path Parameters:
identityAddress: The identity contract address from Step 2
Request Body:
{
"claimType": "KYC",
"claimData": {
"status": "ACCEPTED",
"date": "07-03-2024"
}
}
Common Claim Types:
1: KYC/AML verification2: KYB verification
Response:
{
"transactionId": "6585b5fb-8de8-452d-aa96-8e5de0f1ca09",
"success": true,
"claimId": "0x15564486549685416dfg6fd84gvd6f8g46df54AAA52DF",
"message": "Transaction sent, check webhook for confirmation"
}
π‘ Key Conceptsβ
What is an On-Chain Identity?β
An on-chain identity is a smart contract that:
- Represents a user's identity on the blockchain
- Stores verified claims (credentials) issued by trusted authorities
- Enables compliant token transfers by proving investor eligibility
- Is compatible with the ERC-3643 standard for tokenized securities
Identity Verification Flowβ
- Account Creation: Custodian wallet is created for secure key management
- Identity Deployment: Smart contract identity is deployed and linked to the wallet
- Registration: Identity is registered in the token's identity registry
- Claims Addition: KYC/AML verifications are added as on-chain claims
Claim Types Explainedβ
Claims are verifiable on-chain credentials issued by trusted claim issuers:
- KYC Claims: Verify the investor's identity
- AML Claims: Confirm anti-money laundering checks passed
β οΈ Important Notesβ
- PIN Code Security: Store the PIN code securely; it's required for account recovery
- Sequential Steps: Each step must complete before proceeding to the next
- Transaction Confirmation: Wait for transactions to be mined before continuing
- Claim Issuers: Only authorized claim issuers can add valid claims
- Identity Registry: The identity must be registered before token transfers are allowed
- Country Codes: Use ISO 3166-1 country code (e.g., "721","724")
- Gas Costs: Each on-chain operation requires gas fees
π Related Endpointsβ
π Troubleshootingβ
Identity Registration Failedβ
If identity registration fails, check:
- β Identity contract was successfully deployed in Step 2
- β Account address matches the one from Step 1
- β Valid country code is provided (ISO 3166-1)
- β Identity is not already registered
Claim Addition Failedβ
If adding claims fails:
- β Identity is registered in Step 3
- β Claim data is properly formatted
- β Claim type is supported by the token
Token Transfer are Failingβ
If transfers are failing after setup:
- β All steps completed successfully
- β Required claims are added (minimum: KYC + Country)
- β Claims are not expired
- β Investor meets token's eligibility criteria
- β Receiving address also has valid identity (for compliant tokens)
π Additional Resourcesβ
πΌ Use Case Exampleβ
Individual Retail Investor Onboardingβ
An individual investor from Spain wants to purchase tokenized securities:
Step 1 - Account Creation:
Step 2 - Identity Creation:
Identity contract deployed at: 0xabc...def
Step 3 - Registration:
{
"walletAddress": "0x123...456",
"countryCode": "724"
}
Step 4 - Add KYC Claim:
{
"claimType": KYC,
"claimData": {
"status": "ACCEPTED",
"date": "07-03-2025"
}
}
Result: Investor can now receive and trade compliant security tokens that accept Spanish retail investors.