Inspiration
Data is becoming the new digital oil. The time for reliable, permissionless, decentralized and secure data storage is now. Furthermore, it is time to retain data ownership and control within the remote storage process. With just a few solutions on the market, the BTFS (i.e. BitTorrent File System) offers a scalable and affordable solution, but the integration process is highly demanding. PuzzleX harnesses the power of BTFS and enables easy access via custom APIs & SDKs while enabling multi-asset storage settlement.
What is BTFS
According to https://docs.btfs.io/docs/btfs20-architecture, the BTFS (i.e. BitTorrent File System) is the next-generation decentralized file storage system built for Web3 Applications. BTFS provides a global decentralized storage service with high reliability. Interoperability with smart contracts based on BTTC, ETH & TRON, makes BTFS Web3 native while becoming more scalable along with low cost and high security. The BTFS network is primarily composed of BTFS nodes, including renters and hosts. Renters can upload files by paying WBTT while hosts provide storage in the network for BTT rewards.
What is PuzzleX
A suite of back-end protocols and services that enable developers to connect to PuzzleX BTFS custom nodes via dedicated service APIs & SDKs, while utilising the read-and-write methods of BTFS out-of-the-box. Besides the native BTFS compatibility with the BitTorrent Chain (i.e. BTTC), the integrated underlying swap mechanism will enable further interoperability with Tron and other EVM networks, as it will enable the storage rent payments in Tron and other EVM assets (i.e. multi-chain support will be added gradually). Furthermore, the IPFS to BTFS backup module will enable easy and accessible migration of the current IPFS data (i.e. NFTs, data files, media) to BTFS, providing a reliable and true decentralized storage alternative.
Solution key points:
- Out-of-the-box access to unparalleled security, where every file is encrypted, split into puzzle pieces and stored on a global network of BTFS nodes, making data breaches and downtime a thing of the past.
- Multi-chain APIs & SDKs ready to support any Web2 or Web3 decentralized storage needs.
- Storage payment supported with BTTC, TRON, EVM & FIAT assets.
- IPFS to BTFS backup.
How we built it
Simplicity by design was our guiding approach, which simply means that we put into consideration how we could enable easy BTFS access and usage for any Web2 or Web3 project. The full project framework consists of eight main parts;
- (1) Kubernetes single click BTFS node setup;
- (2) Node backup protocol;
- (3) APIs (new wallet registration, authorisation, upload, download);
- (4) SDK (new wallet registration, authorisation, upload, download);
- (5) Tokenization (BTFS storage payments, PuzzleX fee collection, end user subscription framework);
- (6) Back-end token swap (used as an underlying payment method - Token X to BTT);
- (7) IPFS to BTFS migration module, and;
- (8) End user UI.
PuzzleX BTFS node link:
BTFS Scan TestNet
PuzzleX BTTC Smart Contract link:
BTTC Scan TestNet
Integration Process:
- ➡️ Step 1 - Upon user registration, the API key is assigned
- ➡️ Step 2 - The user chooses between API & SDK (GitHub repository URL) integration
- ➡️ Step 3 - User authentication via API or SDK with a response in a form of a JWT (i.e. JSON web token) auth token
- ➡️ Step 4 - Calling upload & download methods
API upload file snippet
curl --request POST \
--url https://api.datavallis.com/v1/storage/btfs \
--header 'Content-Type: multipart/form-data' \
--header 'Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoxLCJlbWFpbCI6ImRlbW9AYnRmcy5pbyIsImFjY291bnRfdHlwZV9pZCI6MiwidGltZSI6MTY2NzQxMTg2MX0.Jed7_9Dv960070FN1ppGKAfjA4ZT_Y5emAeByekyEL8' \
--form file=@myOfficeDemoImage.jpg
API download file snippet
curl --request GET \
--url 'https://api.datavallis.com/v1/storage/btfs?fileHash=QmbHBcAZn9WNHMX7NhoNxUZXVBSdsEH3uNXXujGM7dx87J' \
--header 'Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoxLCJlbWFpbCI6ImRlbW9AYnRmcy5pbyIsImFjY291bnRfdHlwZV9pZCI6MiwidGltZSI6MTY2NzQxMTg2MX0.Jed7_9Dv960070FN1ppGKAfjA4ZT_Y5emAeByekyEL8' --output ./myOfficeDemoImage.jpg
💡Access full documentation: PuzzleX wiki.
Tokenization & Monetization
There are a few basic costs connected with PuzzleX de-storage service;
- (1) Base BTFS storage cost per GB;
- (2) BTTC settlement transaction cost, and;
- (3) PuzzleX fee.
After significant testing, ruining our own BTFS nodes and executing transactions on the BTTC TestNet, we have come to the conclusion that the average price for 1GB storage on BTFS is 3750.00 WBTT/Month, while the average BTTC transaction cost per one event is 50 BTT. With the estimated price of $0.0000007 (i.e. recorded on the 9th of November 2022) for one BTT, the cost of an event (i.e. data file upload or download) is negligible. Further BTFS & BTTC MainNet testing will be done to produce more accurate results. With the main goal to enable easy access to BTFS no matter the native project chain, new fees such as;
(1) cross-chain asset bridging transactions, and;
(2) asset swap transaction.
will have to be added to enable any user to use BTFS and settle the storage cost in the token of his/her choice. The PuzzleX end-user UI will enable BTFS storage usage in a user-friendly GUI, offering Freemium subscriptions including Fiat payments.
First use case
The PuzzleX is already used by the Tron & BTTC dMail & dChat developed by 4thTech (i.e. Tron Hackathon Season 2 Web3 track winner). In the case of 4thTech, the BTFS decentralized storage is used for the temporary or permanent storage of encrypted data files, media and JSON files (i.e. dMail, subject & content attachment location) that are exchanged between wallets in the dMail or dChat process. The decryption and access to the data files are possible only with a private key of the user (source https://github.com/4thtech/static-assets/raw/main/pdf/whitepaper.pdf )
Challenges we ran into
The challenge was to enable BTFS out-of-the-box as a multi-chain solution, while also enabling the storage multi-asset payment (while the native BTFS service payments are settled in BTT, the underlying swap will enable the storage payments in the token of the user’s choice).
What's next for PuzzleX
➡️ Q4 2022 PuzzleX TestNet (done)
➡️ Q1 2023 PuzzleX tokenization module
➡️ Q1 2023 Back-end token swap
➡️ Q2 2023 PuzzleX SKD & API MainNet
➡️ Q3 2023 IPFS to BTFS backup migration module
➡️ Q3 2023 PuzzleX end-user UI
How to test PuzzleX TestNet
⚡️ Step 1: Login to PuzzleX TestNet.
⚡️ Step 2: Click the login button (i.e. username and email are already prefilled).
⚡️ Step 3: Check node info, by clicking the Node Info button. Access additional on-chain data by following the BTFS scan link.
⚡️ Step 4: Upload the desired data file.
⚡️ Step 5: Check the BTFS uploaded data file by following the provided link.
⚡️ Step 6: Download the data file to your computer.
⚡️ Step 7: Test the PuzzleX APIs.


Log in or sign up for Devpost to join the conversation.