You can sign a Cell with ton-crypto
or ton-core, and later verify it using check_signature
or check_data_signature
from stdlib.fc
in FunC.
Here's an approximate code snippet that you should review:
sign(yourCell.hash(), keypair.secretKey);
## And in the FunC contract, check like this:
check_signature(cell_hash(your_cell), signature, public_key)
For more details, you can refer to the TON documentation on signature checks.
On the other hand, in Tact language, we also has the same feature in the Smart Contract side like this:
external(msg: ExtMessage) {
let hash: Int = beginCell().storeUint(msg.seqno, 32).storeUint(msg.valid_until, 32).storeRef(msg.message_parameters.toCell()).endCell().hash();
require(checkSignature(hash, msg.signature, self.publicKey), "Invalid Signature"); // 😃😃😃 We checek the hash here
require(msg.seqno == self.seqno, "Invalid Seqno");
require(now() <= msg.valid_until, "Invalid Time");
acceptMessage();
self.seqno = self.seqno + 1;
send(msg.message_parameters);
}
meeting with a Psychic medium and I have to say, it's really worth it. It had been 6months since my husband left me without saying anything.All thanks to Dr Adoda I was able to connect with my husband again with his powerful reunion love spell and now he loves me more than he used to. Eternally grateful with The Great Dr Adoda! I highly recommend, His contact details adodalovespelltemple440@gmail.com