I was wondering If I can sign a message offchain with privatekey, for example using tweetnacl and then send it as an argument to a smart contract. The contract would decide if the message is legit and use the data.
This is the signed message:
const signFinalPrice = async (price) => {
const message = Buffer.from(price, 'utf8');
const signature = nacl.sign.detached(message, privateKey);
return bs58.encode(signature);
};