This tutorial will walk you through how to create a time locked wallet that can hold funds to be released in the future.
DISCLAIMER 1: You are advised to use this feature with small amounts of BAY until you completely understand the process and the implications. There is always a possibility of losing your funds if the process is not followed correctly.
DISCLAIMER 2: The regular client in the downloads section of the site can handle most of the details that follow. Nevertheless, this tutorial is perfect for understanding how transactions, wallets, public and private keys work.
For the purpose of this tutorial we will use the following terms:
Time Release Address: This is the address that will be holding the funds for a set amount of time until they are released. This is also known as HODL.
Benefactor: This is the person sending/locking the funds.
Beneficiary: This is the person that will benefit/redeem the funds. They must send their Public Key to the Benefactor in order to redeem the funds.
For the purpose of this tutorial both persons’ actions can be carried out by one person. We will be using the web wallet
TIME LOCKED WALLET CREATION
The beneficiary can create a regular wallet (if they don’t have one already). This is the wallet that will REDEEM the funds. The wallet can be created from the client, or it can be an individual multisig wallet (2 of 2).
Under the “Receive” tab, the beneficiary will copy the Public Key of the wallet created above, then logout and send the public key to the benefactor.
The benefactor selects Time Locked Address from the menu and pastes in the previously copied public key. Then select a date/time for funds release and then click Submit. Alternatively, one can set the blockheight of release by checking the current block height using the explorer and estimating 1 block per minute.
For the purpose of this tutorial, the date/time is only a few minutes into the future.
Here is what was used in this example, for verification:
After clicking Submit, you will get the following (example info below so you can verify)
Wallet to send the FUNDS to:
The benefactor can now send FUNDS to the wallet above so that the beneficiary has something to REDEEM.
For the purpose of this tutorial we will send 1 BAY
The benefactor only needs to send the Shareable URL to the beneficiary, who should STORE the shareable url or redeem script code somewhere safe (print or write it down or bookmark it). Its VERY IMPORTANT that the beneficiary understands the importance of saving the shareable url or redeem script, otherwise the funds would stay in the TimeLock address without anyone being able to release them.
The beneficiary can paste into their browser and they will be able to verify the details of this action (wallets involved and date/time of release).
Once the future release date passes, the beneficiary can redeem the funds using the following procedure:
Beneficiary will create a transaction, (menu > transaction) inputing the Redeem script and clicking Load. This will load all the details of the transaction. The Beneficiary then will need to input the wallet address that will receive the redeemed funds, and the amount which will have to be a little less (0.99) than the total. This compensates for the network fee (which is calculated automatically - the difference between outputs and inputs is always the fee). Click Enter when done.
The transaction has been created and you can see the generated code to be used for the next step:
Under menu > sign, the Beneficiary will then sign the transaction with their own wallet private key. The
private key can be found under the Receive tab on web wallet.
After signing the transaction the following information is created:
Note: One can also verify the signed transaction by going to menu > verify
Lastly, under menu > broadcast, the Beneficiary will broadcast the signed transaction. If successful, this will produce a transaction ID. If not successful, simply wait a few moments and try again.
After it has been succesfully broadcast the funds will be released and the receiving address used in step 1 should see them shortly.
It is extremely important for the Beneficiary to store the shareable url or redeem script in a secure place.
There is no possible way to release the funds without them.
The above procedure is a very elegant way to solve many use cases, all with a few steps and sending a URL to the other party.
- Make a WILL, with the beneficiary only needing the shareable url and their own wallet’s private key to unlock it when the time comes.
- Lend someone FIAT or other currency/goods and get the shareable URL (verifiable promise) to get BAY on a future date.