How it works

A NEP-141 gift, an encrypted note, a private link, and sponsored claim gas.

  1. The sender chooses a configured NEP-141 token, amount, and expiry.
  2. The browser creates a random claim secret, hashes it for the contract, and encrypts the optional note with AES-GCM.
  3. The sender signs ft_transfer_call to Santa. The contract accepts only allowlisted tokens and validates the transfer message before storing the gift.
  4. The complete claim secret is carried in the URL fragment. Browsers do not include fragments in HTTP requests. Anyone with the complete link can attempt to claim it.
  5. The recipient connects a NEAR Testnet wallet and signs a NEP-413 message binding the claim to the recipient account, gift, secret commitment, nonce, and timestamp.
  6. Santa verifies the signature and the account access key, then the relayer submits the claim and pays the testnet transaction gas.
  7. After expiry, the original sender may request a refund. A private callback handles asynchronous token-transfer success or failure.

The contract stores the secret hash and note ciphertext, not the decryption secret or plaintext note. Gift state, token contract, amount, and transfers are public onchain.