Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How do I sign and verify a message on my local machine?

How do I sign a random hash value with the private key of a ton address?

If someone claims that a signature was generated by using the private key of a public key to sign a message, how do I verify the signature?

  
  

I would suggest looking into how signatures in wallets work within tonweb:
https://github.com/toncenter/tonweb/blob/master/src/contract/wallet/README.md

Potentially tweetnacl-js has the crypto methods you're looking for.

Jeremy   one year ago Report
Votes Newest

Answers


Any string which was sign by secret key can be verify with public key. Some examples below

For sign a payload (nacl used from ton-crypto)

const signatureData = beginCell()
      .storeUint(123, 32)
      .storeCoins(toNano(123))
      .endCell()
nacl.sign(signatureData.hash(), YOUR_SECRET_KEY)

For check signature on another side (js) it can be like this:

  return nacl.sign.detached.verify(message, signature, pubkey)

OR if you want to check it in contract

			(int public_key) = load_data()
      slice ref = in_msg~load_ref().begin_parse();
      var signature = ref~load_bits(512);
      int is_valid = check_signature(slice_hash(in_msg), signature, public_key)

Some references

  • wallet v4R2 with verify signature in external msg github
  • TON Connect V2 and ton-proof verification on typescript and go github ts and github go
1
1
Posted one year ago
  
  

awesome

Howard   8 months ago Report