As of block height 31,056,500 (March 26, 2025, 3:00 AM UTC), Celo is no longer a standalone Layer 1 blockchaināit is now an Ethereum Layer 2!
Some documentation may be outdated as updates are in progress. If you encounter issues, please file a bug report.For the most up-to-date information, refer to our Celo L2 documentation.
What is ODIS?
One of Celoās key features is the ability to associate a phone number to a Celo address. This provides a convenient payment experience for Celo users. To map a phone number to an address, the on-chain identifier for a given phone number must first be retrieved. With this identifier, the address can be looked up on-chain.ODIS requests are rate-limited based on transaction history and balance. Ensure the account that is performing the queries has a balance and has performed transactions on the network. If an out of quota error is hit, this indicates that more transactions need to be sent from the querying account.
getPhoneNumberIdentifier
- Query and compute the identifier for a phone numbergetContactMatches
- Find mutual connections between users
See this overview document for more details on ODIS.
Authentication
Both methods require authentication to the ODIS server, which can be performed by either the main wallet key or the data-encryption key (DEK) associated with the wallet key. This is managed byAuthSigner
, which can be either a WalletKeySigner
for a wallet key or an EncryptionKeySigner
for the DEK. The DEK method is preferred, since it doesnāt require the user to access the same key that manages their funds. You can learn more about DEK here.
You may use the EncryptionKeySigner
for your AuthSigner
by passing in the raw private key:
WalletKeySigner
by passing in a contractkit instance with the account unlocked:
Service Context
TheServiceContext
object provides the ODIS endpoint URL and the ODIS public key (same as above).
Environment | Key |
---|---|
Alfajores Staging | 7FsWGsFnmVvRfMDpzz95Np76wf/1sPaK0Og9yiB+P8QbjiC8FV67NBans9hzZEkBaQMhiapzgMR6CkZIZPvgwQboAxl65JWRZecGe5V3XO4sdKeNemdAZ2TzQuWkuZoA |
Alfajores | kPoRxWdEdZ/Nd3uQnp3FJFs54zuiS+ksqvOm9x8vY6KHPG8jrfqysvIRU0wtqYsBKA7SoAsICMBv8C/Fb2ZpDOqhSqvr/sZbZoHmQfvbqrzbtDIPvUIrHgRS0ydJCMsA |
Mainnet | FvreHfLmhBjwxHxsxeyrcOLtSonC9j7K3WrS4QapYsQH6LdaDTaNGmnlQMfFY04Bp/K4wAvqQwO9/bqPVCKf8Ze8OZo8Frmog4JY4xAiwrsqOXxug11+htjEe1pj4uMA |
Query phone number identifier
This call consumes quota. When the user runs out of quota, itās recommended to prompt the user to āpurchaseā more quota by sending a transaction to themselves. This method returns the pepper retrieved from the service as well as the computed on-chain identifier that is generated using this pepper and the phone number.BLS Blinding Client
Itās important for user privacy that the ODIS servers donāt have the ability to view the raw phone number. Before making the request, the library first blinds the phone number using a BLS library. This prevents the ODIS from being able to see the phone number but still makes the resulting signature recoverable to the original phone number. The blinding client is written in Rust and compiled to Web Assembly, which is not compatible with React native. If you choose not to pass in aBLSBlindingClient
it will default to the Web Assembly version. You may create a ReactBlindingClient
by calling the constructor with the ODIS public key:
WasmBlsBlindingClient
if your runtime environment supports Web Assembly:
OdisUtils.PhoneNumberIdentifier.getPhoneNumberIdentifier
documentation can be found here.
The response will be an object with the original phone number, the on-chain identifier (phoneHash), and the phone numberās pepper.
You can view an example of this call in our mobile project here.
Matchmaking
Instead of querying for all the userās contactās peppers and consuming the userās quota, itās recommended to only query the pepper before itās actually used (ex. just before sending funds). However, sometimes itās helpful to let your users know that they have contacts already using the Celo network. To do this, you can make use of the matchmaking interface. Given two phone numbers, it will let you know whether the other party has also registered on the Celo network with this identifier.OdisUtils.Matchmaking.getContactMatches
documentation can be found here.
The response will be a subset of the input e164NumberContacts
that are matched by the matchmaking service.
You can view an example of this call in our mobile project here.