The 30-second answer
ads.txt (Authorized Digital Sellers) is a flat text file at the root of your domain — for example example.com/ads.txt — that lists the ad-tech companies authorised to sell your inventory. The standard was published by the IAB Tech Lab in 2017 to stop domain spoofing, where bad actors resell traffic claiming to be from your site.
The line format
google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0Four comma-separated fields: SSP/exchange domain, your publisher ID, relationship type (DIRECT or RESELLER), and an optional certification authority ID. One line per partner.
app-ads.txt — the mobile version
For mobile apps, the equivalent is app-ads.txt, hosted at the developer-website URL declared in the app's store listing. Same format, different host. AdMob, Unity Ads, AppLovin MAX, and IronSource all crawl it before serving on your inventory.