If it's not too much work, would you be able to outline how one would go about pulling the public key hash out of a segwit address?
You simply convert the data part (after the 1) from Bech32 back in to hex, and then drop the version byte at the start and the checksum at the end. What you will be left with is the witness program, which for standard segwit addresses will simply be the pubkeyhash. There are multiple implementations you can use to do this available here:
https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#reference-implementations. Alternatively, you can use this site:
https://bitcoin.sipa.be/bech32/demo/demo.html. Just paste in your segwit address and it will spit out your program (which as I mentioned, for standard addresses will be your pubkeyhash).
Since message signing is done via the private key and not an address, and message verification is done via recovering (usually) two public keys from the message and signature, you can use this pubkeyhash to verify any message if you know what you are doing. If you turn that pubkeyhash in to a legacy address via adding a network byte to the start, a checksum to the end, and converting to Base58, you can then verify a message signed with a segwit address against the equivalent legacy address.
For example:
-----BEGIN BITCOIN SIGNED MESSAGE-----
BitcoinCanSaveUsAll test
-----BEGIN SIGNATURE-----
bc1qa87h0k4dey7d5q8u302pd3mqh3p8chg2j2mgaf
Hx0d8zJdUM5WMoLkCNl4FDZAW+UNRP6hcz9v+d5cRXexaAo3r6SkArHG24qVSYnfiKWFoxOB5E5XOecBcjjgT+4=
-----END BITCOIN SIGNED MESSAGE-----
If you paste the above in to this site (
https://brainwalletx.github.io/#verify), the message will fail to verify.
Now, take the segwit address in that signature, and use the method described above to extract the pubkeyhash - e9fd77daadc93cda00fc8bd416c760bc427c5d0a.
Now, take that pubkeyhash and turn it in to a legacy address - 1NLE5yWwTjRyMe8Jd6JdUzSE9RLikH79cn.
Now, replace the segwit address in the signature above with this legacy address.
You'll find the message now verifies correctly.