ps[before I losse the links again]: There was a lot of discussion about the msg canonicalization but I think this github issue has the most content. There also is andyleaps msg sign and verify code for past reference but IIRC it somehow choked on unicode characters in messages..