Before merchants can use your gateway, they must register and verify ownership of their OCID. This guide covers the secure onboarding process.
Overview
- Merchant provides their OCID
- You fetch their metadata from the blockchain registry
- Merchant signs a challenge to prove ownership
- You verify the signature and store the merchant
Step 1: Get Your OCID
Before onboarding merchants, you need your own OCID:
- Mint an OCID on the Router Registry smart contract
- Set your metadata URL pointing to your
/metadata.json
- Store your OCID and private key securely (e.g.,
.env file)
Step 2: Collect Merchant OCID
Create a registration form where merchants provide their OCID:
Always fetch metadata through an independent channel, never from a URL provided by the merchant directly. Use the Router Registry or Opencharge index.
Step 4: Verify Ownership
The merchant signs your challenge to prove they control the private key:
Security Considerations
If a merchant’s metadata URL is unreachable:
- Do not onboard them
- This may indicate the OCID is compromised
- Merchants can take their metadata offline as a safety measure
Signature Verification
Always verify:
- The metadata
config is signed by the publicKey in the config
- The challenge is signed by the same public key
- Optionally, that the public key owns the OCID NFT on-chain
Unique OCIDs
OCIDs are unique across the ecosystem. Store them under a unique index:
Auth Middleware
After onboarding, authenticate all requests from merchants:
Next Steps