90
votes
What is the difference between Swarm and IPFS?
Both
Peer to peer
Data sharing network in which files are addressed by the hash of their content (Content-addressable)
Decentralized file transfer systems
Can be used to store the HTML, CSS and ...
53
votes
Accepted
How to store IPFS hash using bytes32?
Your example shows storing an IPFS identity using it's alphanumeric encoding (Qm...), which is the same Base58 encoding that Bitcoin uses. However, what it's representing at its core is a number (the ...
37
votes
Accepted
How can we integrate IPFS with ethereum in DApps?
Basically, you store any file into IPFS and then you store the IPFS hash in the Ethereum contract. Any user with an IPFS node is going to be able to access the file using that hash.
You can store data,...
30
votes
What is the difference between Swarm and IPFS?
Adding to tayvano's answer, the main author of Swarm has written a detailed perspective. Here are some parts of his answers (edited for clarity):
Similarities
Swarm and IPFS both offer ...
eth♦
- 85k
22
votes
Accepted
What is the distinction between libp2p, devp2p and RLPx?
LIBP2P is a protocol implementation toolset or library that allows you to build software for different P2P networks and scenarios.
DEVP2P and RLPx are presented in the Ethereum documentation as ...
21
votes
Accepted
Question on the terms 'distributed' and 'decentralised'
Here's one illustration of distributed and decentralized systems:
Distributed computing has a long history in computer science ("became its own branch of computer science in the late 1970s and ...
eth♦
- 85k
21
votes
What is the distinction between libp2p, devp2p and RLPx?
I can only answer for libp2p coming from the IPFS project (and not devp2p coming from Ethereum).
libp2p is a modular P2P networking stack used to connect to other peers, finding and transferring ...
19
votes
Accepted
Nested structs in solidity?
You can store a struct in a struct.
pragma solidity ^0.4.11;
contract Nest {
struct IpfsHash {
bytes32 hash;
uint hashSize;
}
struct Member {
IpfsHash ipfsHash;
}
mapping(...
17
votes
How to add a file to IPFS using the API?
Read the documentation:
Every command usable from the cli is also available through the HTTP
API. For example:
ipfs swarm peers
curl http://127.0.0.1:5001/api/v0/swarm/peers
So for the command:
...
16
votes
Question on the terms 'distributed' and 'decentralised'
While I mainly agree with eth's answer, I would like to spin up some confusion and since you are writing a paper, it's worth to mention that older literature is not consent on that determination of ...
16
votes
IPFS hash algorithm
IPFS uses multihash where the format is the following:
base58(<varint hash function code><varint digest size in bytes><hash function output>)
The list of hash function codes can ...
15
votes
Accepted
What would be needed to store the blockchain as a IPFS object?
Note that putting the blockchain (and state etc) on swarm is already planned and thought out.
Integration with IPFS is also in the plan but may have some difficulties.
If and when solved this answers ...
14
votes
Accepted
How can I store big files on the blockchain?
No, you will have to store your data somewhere else and store the hash of this data and its location in the blockchain. You should have enough space to store it but remember the shorter your data is ...
14
votes
What are Storj and Sia and how different are they from Swarm and IPFS
I don't agree at all. Plus, @Meije is from Storj Team.
IPFS and Swarm are not just an idea but the most advanced technologies/protocols in decentralised blockchain based storage.
IPFS and Swarm are ...
13
votes
Accepted
Can smart contracts compute on encrypted data?
If I understand your question correctly, what you are referring to is called secure multi-party computation which is not a current capability of smart contracts. In fact, it's a challenging problem ...
10
votes
Can smart contracts compute on encrypted data?
The short answer is no. There's a term for computing on encrypted data: homomorphic encryption. This is currently not usable for regular applications. If it were possible it would have huge positive ...
10
votes
How can we integrate IPFS with ethereum in DApps?
Ethereum is too heavy/expensive to store large blobs like images, video, etc.. Hence some external storage is necessary to store such objects. This is where IPFS comes in. The Ethereum DAPP could hold ...
10
votes
What are some proposed ways of storing data in Ethereum?
It's basically the other way around. The Ethereum blockchain will store a hash that points to a file in either Swarm, IPFS or something similar.
From a DApp point of view the following could happen ...
9
votes
Accepted
What datatype should I use for an IPFS address hash?
bytes because they are more than 32 bytes. An IPFS hash:
itself specifies the hash function and length of the hash in the first
two bytes of the multihash. In the examples above the first two bytes
...
eth♦
- 85k
9
votes
How to store and load an IPFS hash as bytes32 in contract written in Solidity
Whilst I have not worked with IPFS hashes, the solidity types documentation states that you can store fixed size byte arrays up to 32 bytes.
As such if you want to store the whole hash in one data ...
9
votes
Accepted
How much does it cost to store each IPFS hash in Ethereum blockchain
When storing data on the Ethereum blockchain, each computation task has a cost (in gas unit) and you usually want to reduce as much as possible the cost of the transaction for your application.
You ...
7
votes
Accepted
IPFS Integration with dapp developed using Embark Framework
As per the documentation
Set the provider:
EmbarkJS.Messages.setProvider('orbit', {server: 'localhost', port: 5001})
Saving Text
EmbarkJS.Storage.saveText("hello world").then(function(hash) {});
...
7
votes
How to store IPFS hash using bytes32?
Here are some js functions for stripping and re-adding the first two bytes containing the hash function and size, suitable for web3.
import bs58 from 'bs58'
// Return bytes32 hex string from base58 ...
7
votes
Accepted
Is there any way to upload to IPFS or Swarm from inside a smart contract?
It would be very useful for a number of use cases if a function in a contract could directly upload to IPFS, Swarm, or similar and retrieve the hash.
It would be useful, but what you are asking is ...
7
votes
Accepted
Encrypting/Decrypting data on IPFS using Ethereum Public/Private key?
You'll need to the encrypt the data before storing on IPFS. But its not efficient to use ECIES encryption (which uses Ethrereum keys) on large data as its slow and Metamask will often hang. A good ...
6
votes
Accepted
Modeling real world contract with Ethereum with use of Ether transaction
Sure, you can definitely prove that both parties made the agreement; the simplest approach would be to create a contract that contains a signAgreement(bytes32 hash) function which allows each party to ...
6
votes
How to access files hosted on swarm?
Just to point out, you don't need the public gateway.
When you have a swarm node running, you have your own gateway at http://localhost:8500/bzz:/.
(I'd post this as a comment but stackexchange won't ...
6
votes
Accepted
Merkle Tree in IPFS
Every Merkle is a directed acyclic graph (DAG) because each node is accessed by its name. Each branch of Merkle is the hash of its local data, because its fast to access instead of accessing by its ...
6
votes
Accepted
IPFS versioning - How to get all files from the IPFS key?
I don't think you can use IPNS to store more than one CID (hash) but however you can use IPLD (IPFS Linked Data) to generate a JSON bundle that will reference each version and only the CID of the ...
6
votes
Is there any way to upload to IPFS or Swarm from inside a smart contract?
The Ethereum blockchain is an entirely separate system from IPFS, it does not understand what IPFS is or what it does. In most DApps, what usually happens is that the file is uploaded to IPFS via the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ipfs × 326solidity × 56
nft × 56
dapps × 35
blockchain × 28
storage × 25
swarm × 25
go-ethereum × 23
javascript × 23
erc-721 × 18
web3js × 17
contract-development × 17
meta-data × 17
react × 16
dapp-development × 13
infura × 13
pinata × 13
database × 10
contract-design × 8
nodejs × 8
encryption × 8
decentralization × 8
truffle × 7
ethereum-wallet-dapp × 7
embark × 6