Using Unchained

From BiblePay Wiki
Revision as of 14:44, 6 August 2020 by Admin (talk | contribs)
Jump to: navigation, search

BiblePay Unchained is our newest feature within the BiblePay Core wallet, which is being released in September 2020.

This release contains the features that include BiblePay IPFS, the Side Chain, Encrypted Upload and Download (EDI), IPFS File Upload and Folder Upload, IPFS Download, and the C# version of BiblePay IPFS (BiblePay IPFS c# client).


How to Upload a file with BIPFS (BiblePay IPFS):

Click the RPC Console. To see help type:

exec bipfs_file help

To upload a file:

exec bipfs_file /pdf1/d8.pdf pdf-webpath 1 60 0 1

The above command will upload a file called d8.pdf that is stored in the /pdf1 directory on your machine. The "pdf-webpath" argument is not currently used (more later), you may supply anything for field #4. The storage density is set as level 1 (this means the file will be stored in One geographical region). Region 1 is Canada. The argument 60 means you wish to lease the file on BiblePay Network for 60 days. The zero, argument #7, means you do not want the file to be encrypted (a 1 means encrypted). The last argument, 1, means you wish to do this for real. If you supply a zero, it means it will be done as a dry run (for a price quote). After you finish the command, you will receive the following output:

"Command": "bipfs_file",
  "TXID": "e8b6d8b0e2d13b6d2a5f633771f71381aea7c08e548ac717b5c50f037a830034",
  "e8b6d8b0e2d13b6d2a5f633771f71381aea7c08e548ac717b5c50f037a830034-4d5b0a7a0576b43b85ba63fc00f041df": "File: /pdf1/d8.pdf, Response: https://biblepay.s3.ca-central-1.amazonaws.com/yLbyhFoEurwToxcTrthXoX6Ln7ieMY3sM5/d8.pdf, Fee=2000.0000, Size=12815.00] [Error=]",
  "region_0": "https://biblepay.s3.ca-central-1.amazonaws.com/yLbyhFoEurwToxcTrthXoX6Ln7ieMY3sM5/d8.pdf"

This means that the submission was successful. The TXID is the biblepay transaction ID that you paid the storage fee (of 2000 bbp) into. The Response URL for region_0 is the URL we are storing your file in. Note that we use multiple storage areas in an attempt to provide seamless storage during the tribulation.


Encrypted File Transmission - Up and Down

To make this solution work for users who do not want to make their data public, we offer AES256 encryption. To use this option, pass a 1 into argument #7. Note that you must supply your own encryption password in the biblepay.conf file, in the "encryptionkey" setting. For example: encryptionkey=abc123 Would encrypt the file before the bytes leave your machine with the AES password 'abc123'. When the file is stored on our BIPFS network, it is stored in an encrypted format, therefore no one will be able to access the contents (not even the BiblePay devs), so we cannot help you if you lose your key.

To download the file, type:

exec bipfs_get filename 1

The 1 means encrypted. The file will be downloaded to your local machine, then unencrypted with the password contained in your biblepay.conf. If the password does not match, the file will be unreadable.

BIPFS Folder Upload

To upload an entire folder to BIPFS:

exec bipfs_folder /pdf1 pdf-webpath 1 60 0 1

The above command will loop through every file in the /pdf1 directory, and upload all of them, and only charge you once for the grand total due. To get a quote with a dry run, change argument #8 to 0. The above command means store this with a density of 1, for 60 days duration, non encrypted.


High Density File Storage - The Great Tribulation

To store your files with the maximum density, ensuring that they will be available even times of great civil unrest, and possibly through national internet outages where the power grid is down, you may send in a density argument of up to 4 (we accept 1 through 4).

A density of 4 means we will store the file in 4 geographic regions: Canada, US West, US East, and Europe. You may write code to access the file through backup regions by accessing the json response of the bipfs_file or bipfs_folder when the density is greater than 1. We respond with a specific URL for each world region. Note that it is recommended to write your web sites with access to region 0 (Canada, the default) and for mission critical applications, set up a load balancer or source code that drops down to regions 2-4 if an outage is detected.


Large File Support

BiblePay IPFS has been specifically designed to support very large files! This is so we can easily handle Christian Videos. For example, you may upload a 200 Megabyte video in about 5 minutes, and should not receive any errors. We even handle large file encryption without problems. This is because our dev team has spent a long time writing an algorithm that splits the long files up into small pieces first so that the server will not run out of memory, or throw network errors.

Sample Files for IPFS

Below please find some sample files you can use to play around with IPFS. This allows you to test large video and or encryption:


File 1 - The Executive Summary of Jesus Christ (199 Megabyte video):

https://san.biblepay.org/Media/ExecSumJesus.mp4

File 2 - A PNG logo image: (158K):

https://san.biblepay.org/Images/bbphoriz.png


How to know if my sidechain is synced?

You can click on Tools | Information, and look for the Sidechain Block Count. Verify that it is around the height of the best block hash height. Note that the height of the sidechain only increases when new information is stored in the sidechain, so it is normal to see a height below the current height (for the sidechain).

You can also type 'exec bipfs_list' to see the contents of IPFS transactions in blockhashes.


How to drill into an IPFS Transaction in a Block

To drill in you can type 'getblock blockhash' and see how many IPFS transactions are in the block (similar to the list of transactions in the block). An IPFS transaction is related to a biblepay transaction, by BBP TXID->IPFS_TXID->IPFS_URL.

For example, getblock blockhash containing 5 IPFS transactions should show you a list of 5 IPFS TXID's with corresponding hashes and URLs.


What is the cost of the service per file?

The cost per file as of August 2020 is as follows (this may be decreased during the rollout to be more competetive with other providers):

nFee = nSizeFee * nDurationFee * nTargetDensity

Where the Size Fee is bytes/25000, the Duration Fee (denominated in days) is 1 per day, and the TargetDensity is 1-4 (1 for 1 region, 4 for 4 regions).

The minimum charge is currently 1000 bbp per file.

This means that a 12K PDF stored for 60 days is 1000 bbp. A 200Meg video (ExecSumJesus.mp4 shown above) costs 16,323 BBP to store for 60 days at density level 1.