HowTo

HowTo

Images shown here can be slightly different from the reality.

Choose a passphrase

To store files with TRH you have two options:

  • a passphrase
  • predefined Bitcoin key and password

The passphrase is used by TRH to generate a Bitcoin private key and a password. The private key is generated with a sequence of hashing defined by the number that the passphrase must contains. The password is defined as the first 32 bytes of the passphrase. If the passphrase is shorter the remaining password bytes will be 0. More on how to choose the correct phrase later.

Ex. “This is the passphrase used in the TRH help, the 24th of July, 2021.”

If you prefer to use your own key + password you can, you just need to specify them in the command line with “-key” and “-password”.

Load the address

If you want to use a passphrase you need to run the “describe” command to see the Bitcoin key and address that will be used. The address must be loaded with enough fund before to be used (see Estimate fee).

$> trh describe + This is the passphrase used in the TRH help, the 24th of July, 2021. 

INFO: command is: describe
Current configuration:

Secret:
WARNING: Save the passphrase in a safe place.
passphrase: -->This is the passphrase used in the TRH help, the 24th of July, 2021.<--
pasword: -->This is the passphrase used in t<--

Bitcoin:
key (WIF): -->L1XkuhuE2vGfs2XSnVwr9nb4nzLcV9B2HehxUN2GiHsyAMNCpZRG<--
address: -->15et9jt51tLMA8W9eu54v1CMxV4uYDUUk7<--

Example image

TRH will show address and private key with QRCodes (only on mac and linux) connected to the passphrase. The necessary amount of bitcoin to pay the mining fees of the transaction has to be transferred on the address. At the end of the load, the amount that has not been used can be swiped using the private key (for ex. with SimplyCash https://simply.cash/).

WARNING
Given the fact that what is left on the wallet can be taken at the end of the upload, is always better to have more money than the minimum required. If an upload failed because there’s not enough money to pay all the requires fees, the upload should be redone completely, and the incpmplete transactions will be lost.

After having loaded the address, the describe command will show a transaction in the history:

Example image

Estimate fee

Fees are now 500 satoshi per 1000 bytes but to avoid bad surprises it is better to have an estimation of the fee required to store the file.

$> trh estimate -file mypicture.png -key L13JNuUBaSGBc3sS85fVqqmxzM87EPPrQLcfpro
INFO: command is: estimate
INFO: estimated fee to store the file: 1912 satoshi

Store a file

To store a file on the blockchain, the key that will be used must contain enough fund to cover the mining fee. If fees are not enough the store will fail and the spent amount will be lost. Before to upload a file please get an estimation of the amount required with the command ‘estimate’ (see Estimate fee).

Things to remember:

  1. there are good chances these bytes will remain stored on a copy of the Bitcoin (BSV) blockchain for many years, even forever.
  2. the blockchain history is public, there are good chances illegal material shared publicly could be tracked down to the source.
$> trh store -file mountains.jpg  + This is the passphrase used in the TRH help, the 24th of July, 2021. 

Or using a Bitcoin key

$> trh store -file mountains.jpg  -key L1XkuhuE2vGfs2XSnVwr9nb4nzLcV9B2HehxUN2GiHsyAMNCpZRG -password "this pwd is different"

Example image

To check how much has been spent to store this file take a look at blockchair.com/bitcoin-sv/address/15et9jt51tLMA8W9eu54v1CMxV4uYDUUk7: 13 transaction of 33500 satoshi each for a total of 435500 satoshi.

Retrieve files

To retrieve a file you need to know the passphrase or the address plus the password. Please remember that anyone who has or can guess the passphrase can download the file.

$> mkdir trhout
$> trh retrieveall -outdir trhout + This is the passphrase used in the TRH help, the 24th of July, 2021.

Or using the Bitcoin public address and the password.
Only files that has been stored with the given password will be downloaded.

$> trh retrieveall -address 15et9jt51tLMA8W9eu54v1CMxV4uYDUUk7 -password "This is the passphrase used in t" 
INFO: command is: retrieveall
INFO: cache folder is: /Users/diego/Library/Caches/trh.
INFO: 1 files has been retrived from '15et9jt51tLMA8W9eu54v1CMxV4uYDUUk7' to ''

Example image

Share a file

To share a file with someone else you just need to use a different password to store the file you want to share.

$> trh store -file mountains.jpg  -key L1XkuhuE2vGfs2XSnVwr9nb4nzLcV9B2HehxUN2GiHsyAMNCpZRG -password "a shareable password"

And then share the public address plus the password. This is the command someone else should execute to get the shared file:

$> trh retrieveall -address 15et9jt51tLMA8W9eu54v1CMxV4uYDUUk7 -password "a shareable password" 

Empty the address

Now that the file is stored on the blockchain, if there are no plan to store other files on the same address or if the file is going to be share with other people, it’s better to empty the address. A quick way to do it is to scan with simply.cash (or some other wallet that can import a private key) and transfer the fund to some other address.

Download

WARNING
This is beta software, start using it downloading the file in the example, it has not been testes with mega-sized files. There’s still a lot of work to do, so please be careful.

Download TRH

For issues or questions please DM on Twitter @ejfhp or send me a mail: ejfhp5 on Gmail.