How it works
A NEP-141 gift, an encrypted note, a private link, and sponsored claim gas.
- The sender chooses a configured NEP-141 token, amount, and expiry.
- The browser creates a random claim secret, hashes it for the contract, and encrypts the optional note with AES-GCM.
- The sender signs
ft_transfer_callto Santa. The contract accepts only allowlisted tokens and validates the transfer message before storing the gift. - 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.
- 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.
- Santa verifies the signature and the account access key, then the relayer submits the claim and pays the testnet transaction gas.
- 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.