# Smart contract registry

Web3 Analytics has a smart contract that tracks apps and the addresses of the users that belong to them. An app that would like to use Web3 Analytics must first call the registerApp function on the Web3 Analytics smart contract. Once done, the app can register users and allow users to record data in Ceramic.

The DID generated to securely write to Ceramic can be converted to an Ethereum keypair because they both use secp256k1. Web3 Analytics checks to see if the user is registered with this app in the smart contract. If not, it silently processes a registration transaction in the background using Gas Station Network v3 ([OpenGSN](https://opengsn.org/)).

The contracts are currently running on Goerli but will deploy to an EVM compatible Layer 2 (e.g. Polygon) for production so each user registration only costs a fraction of a cent.

* [Web3Analytics.sol](https://goerli.etherscan.io/address/0xd00CCD251869086eCD8B54f328Df1d623369b8F6#code)
* [Web3AnalyticsPaymaster.sol](https://goerli.etherscan.io/address/0x1A387Db642a76bEE516f1e16F542ed64ee81772c#code)
