Say Alice wants to send Bob 100 XLM for his birthday, but she is often traveling and may not remember to carry out the Tx on the day of Bob's birthday...

Time lock just specifies when a Tx can be signed and submitted to the network.

Is there a way to sign/submit a Tx that will 'execute' itself at a specific time&date in the future?

Any ideas on how to do this with Stellar?

up vote 6 down vote accepted

This capability is not on-network. Third party solution(s) exist. For example: https://galactictalk.org/d/1466-smart-stellar-timed-payments

Another solution is to have Alice create and fund a new account C and sign a timebound transaction to merge C into Bob account. Then she can share the transaction with Bob before his birthday, he has the transaction but he has to wait his birthday to submit it to the network and redeem his gift.

Alice can set the thresholds and signatures weighs of C so that Bob knows she can't move the funds out of the account before his birthday.

First Alice needs to build the merge account transaction (here n is the Contract account sequence):

Transaction #2

  • Source: C
  • Sequence: n+2
  • Time Bounds: (min=bob birthday, max=0)
  • Operations:
    1. Operation
      • Type: AccountMerge
      • Destination: B

Alice would write down the transaction hash h(#2) and XDR. To setup the Contract C, Alice would send the following transaction to the network:

Transaction #1

  • Source: C
  • Sequence: n+1
  • Operations:
    1. Operation
      • Type: SetOptions
      • MasterWeight: 0
      • LowThreshold: 2
      • MediumThreshold: 2
      • HighThreshold: 2
      • Signer: (type=ed25519, key=B, weight=1)
    2. Operation
      • Type: SetOptions
      • Signer: (type=pre-auth-tx, hash=h(#2), weight=1)

On the day of its birthday, Bob would sign and submit transaction #2 to receive Alice gift. Before that date, neither Bob nor Alice are able to withdraw the funds.

  • Is there actually a way to set things so that the merge account goes through but the account can’t send payments from it? – Paul Aug 31 at 14:01
  • Yes, let me edit the answer to expand on it – Francesco Aug 31 at 14:30

I'm the author of https://test.artspirit.com/ and doing timed-payments is the main service of my site. It's working already on the testnet.

Let me know if this one is what you are looking for. Any feedback on the current version is welcome.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.