Twitter exports and imports lists that consist in Twitter UIDs (long numeric strings), as .csv files (although there's only one column); Blocktogether supports the same. A little frustrating, since it requires an API call to turn a UID into a URL or screenname.
Mastodon does support blocking entire instances, but those blocks aren't subsequently visible in the UI and aren't included in the blocklist export:
https://github.com/tootsuite/mastodon/issues/5855
Mastodon is also importing/exporting single-column .csv files (no metadata included, so the same format is used for blocklists and followlists), with each line as:
username@example.instance