Thanks for your answers so far!
it probably shouldn't just be a random string, because someone may suspect that you want them to sign your public key.
Hmm, I don't get it. Why would I want someone to sign my public key? And which public key do you mean?
The point is if you asked me to sign some random string I would tell you to pack sand. Maybe that random string is the hash of a contract you later will claim I agreed to by signing (one which obligates me to pay you 100 BTC per year for example). Or maybe the random string is you public key and you are using me signing it as proof in another scam with a third party. See I am trusted, D&T is trusted and he signed my public key.
Even if you are legit a random string could be used by third parties. It doesn't really prove anything other than the signing party signed a random string. As an example you there are two people A & B. A claims to control address 123.... but doesn't really. You ask A to sign a random string. A instead tricks Bob into signing the random string. Maybe A sells Bob some gold coins and being naive A states that the random string is the order number. A could even draw up a contract with the order # (your not so random string). Bob signs the random string provided by A not knowing that it is A's intent to turn around and gives it to you as proof A controls address 123 which is a false claim as Bob actually does.
TL/DR:
Singing a random string is about as useful as a laywer asking you to sign a contract made out of random letters. Would you physically sign a contract which is just pages and page and pages of seemingly random letters & numbers? What is the lawyer says trust me it is random I just need you to sign something? If you want the user to sign something then have the sign something meaningful.What grue was indicating is that a better solution is to have the user sign something
SPECIFIC that can't be used for any other purpose.
Which is less likely to be abused ..
Signing this?
By this digital signature, account ABCDEF for Service YOUR WEBSITE proves ownership of address 182Po2Nur2BqBvGrFCKLs853r8FgiCjUZr Nonce: 2783972827848209732987
Or signing this?
7a7753c563c8c37d05466065a52131220f6c32e7266d9091df5e459732313ca1
BTW if you did sign the later guess what it is a SHA-256 hash of ... this ...
I Herbert agree to repay DeathAndTaxes 300% of the funds he will send from address 182Po2Nur2BqBvGrFCKLs853r8FgiCjUZr to this address. Failure to do so within 30 days will result in me being declared a scammer. Note a hash of this message instead of the actual message was signed to protect the privacy of both parties until such time as this contract is needed.