safe-global / safe-modules

A collection of modules that can be used with the Safe contract
GNU Lesser General Public License v3.0
149 stars 74 forks source link

WebAuthn Signer Creation Should Emit an Event #397

Closed nlordell closed 6 months ago

nlordell commented 6 months ago

We should emit an event whenever a WebAuthn credential is created in order to be able to perform analytics for Passkey usage.

The event should look like:

event Created(address signer, uint256 x, uint256 y, P256.Verifiers verifiers);

Note that we should evaluate whether or not we want the signer address to be indexed or not. My intuition is "no".

safeintern commented 6 months ago

@nlordell thanks for this. What are the implications of getting a signer parameter indexed?

(Peter from the data team)

akshay-ap commented 6 months ago

What are the implications of getting a signer parameter indexed?

Using indexed keyword allows searching for events by filter (useful when searching events using libraries like web3.py, web3.js, etc.), Also, having indexed param would mean that etherum.logs table in Dune would have signer address available in topic1 column. If not marked as indexed, then singer address need to be decoded from data column.

https://docs.soliditylang.org/en/latest/contracts.html#events

Indexing is accompanied by additional gas cost. So, indexed is recommended only if necessary. As we use dune and parsing data column of etherum.logs would give signer address, I don't think indexing is needed.

safeintern commented 6 months ago

Thanks for this! Yeah let's not do indexing.