But it won't be cheaper elsewhere since developer still needs to pay the 30% commission.
How would that work? From my previous comment, let's say you add this message (no links): "Buy with Apple Pay, or visit our website and pay 20% less". Nobody knows how many users decided to visit the website instead.
It would work the same as many other revenue sharing agreements out there (including those for Epic’s own Unreal Engine). Yes, there’s no technical mechanism to keep you from screwing the other party (and small-scale fraud will likely go undetected), but there are contractual/legal mechanisms.
Total Installs - App Store Installs = Third Party Installs
And they know total installs from the notary service.
That doesn't work for in-app purchases, which is almost certainly the majority of revenue.