在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:redcpp/algorand-ipfs-js开源软件地址:https://github.com/redcpp/algorand-ipfs-js开源编程语言:JavaScript 100.0%开源软件介绍:Developers are turning to decentralized storage as a way to avoid censorship, server outages, and hacks. With decentralized systems, connections can dynamically find the most efficient pathway through the Internet and route around congestion or damage. The Algorand blockchain provides a decentralized, scalable and secure protocol making it an excelent medium to share information, however the current maximum note size for an Algorand transaction is 1KB limiting the amount of transfered data. Large files cannot be efficiently stored on blockchains. On one hand side, the blockchain becomes bloated with data that has to be propagated within the blockchain network. On the other hand, since the blockchain is replicated on many nodes, a lot of storage space is required without serving an immediate purpose. IPFS is a file sharing system that can be leveraged to more efficiently store and share large files. It relies on cryptographic hashes that can easily be stored on a blockchain. Nonetheless, IPFS does not permit users to share files with selected parties. This is necessary, if sensitive or personal data needs to be shared. File-content encryption before uploading to IPFS protects sensitive data from unauthorized access. Algorand blockchain technology is then utilized for keeping track of the filehashes and filenames, guaranteeing transparency and speed. Algorand-IPFS integrations allows us to create decentralized applications with secure digital content. !!! Demo Check out this site https://algo-ipfs.surge.sh/ that enlists plain/encrypted files for sharing. [TOC] Requirements
IntroductionThe Interplanetary File System (IPFS) is a peer-to-peer decentralized way of storing and referring to files by hashes. A client who wants to retrieve any of those files enjoys access to a nice abstraction layer where it simply needs to call the hash of the file it wants. IPFS then combs through the distributed nodes and supplies the client with the file. The mechanism is to take a file, hash it cryptographically so you end up with a very small and secure representation of the file which ensures that someone can not just come up with another file that has the same hash and use that as the address. As long as anyone has the hash of the PDF file, they can retrieve it from IPFS. So sensitive files are not well suited for IPFS in their native states. Unless we do something to these files, sharing sensitive files like health records or images is a poor fit for IPFS. Data Flow
UsageTo run the application use the command Running
Upload node App.js --upload ./assets/algorand_white_paper.pdf Download node App.js --download algorand_white_paper.pdf Example node App.js --example The example provided as part of File Structure
All code related to demo is not necessary, it corresponds to step 4 which is optional (see the data flow section above). Site https://algo-ipfs.surge.sh/ was constructed by using that code. You can checkout tutorial Real-time block visualizer with Vue to better understand how Vue.js interaction with Algorand works. File Directory Script
SetupCreate file
The values from the const ALGOD_CONFIG = {
algodToken: {
'X-API-Key': process.env.API_KEY || ''
},
algodServer: process.env.ALGO_SERVER || '',
indexerServer: process.env.INDEX_SERVER || '',
algodPort: process.env.ALGO_PORT || '',
account: {
addr: process.env.ADDRESS,
sk: new Uint8Array(process.env.SK.split(','))
}
} Final ThoughtsIn general blockchains are not the best solution for storing large volumes of data and files, so we can secure sensitive files by encryption and stored them on the IPFS which is a better network for file sharing than the blockchain. We can store the IPFS hashes on the blockchain to combine the strengths of both the Algorand blockchain and the distributed file storage. This is a powerful combination because a blockchain is resistant to modification of the data and we can now rest assured that every IPFS hash recorded in the Algorand blockchain points to the exact data we are looking for. Remember, an IPFS hash represents the content not the location, unlike common URLs which point to a location where data is variable through time. This is just the template of how you could extend Algorand-based applications into the secure file distribution domain and the example code we provided demonstrates how easy it is to integrate both the Algorand SDKs with the IPFS.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论