91 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 ...
tayvano's user avatar
  • 16k
54 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 ...
MidnightLightning's user avatar
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,...
AdrianClv's user avatar
  • 1,269
31 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's user avatar
  • 85.8k
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 ...
Sentinel's user avatar
  • 1,238
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's user avatar
  • 85.8k
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 ...
Victor Bjelkholm's user avatar
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(...
Rob Hitchens's user avatar
  • 55.2k
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: ...
Roland Kofler's user avatar
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 ...
q9f's user avatar
  • 32.9k
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 ...
Miguel Mota's user avatar
  • 5,163
15 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 ...
Nicolas Massart's user avatar
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 ...
Viktor Trón's user avatar
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 ...
julien bouteloup's user avatar
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 ...
dbryson's user avatar
  • 6,403
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 ...
Maran's user avatar
  • 1,835
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 ...
Physes's user avatar
  • 1,308
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 ...
etherfaces's user avatar
  • 1,153
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's user avatar
  • 85.8k
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 ...
Thomas Clowes's user avatar
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 ...
Greg Jeanmart's user avatar
9 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 ...
pbsh's user avatar
  • 2,441
8 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 ...
Stan James's user avatar
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) {}); ...
niksmac's user avatar
  • 9,673
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 ...
Mikko Ohtamaa's user avatar
6 votes

What is the difference between Swarm and IPFS?

I think the best summary is here: Differences tl;dr Subtle but important differences in both projects design will likely keep the two projects steady and separate on their own relative tracks. Since ...
Mowzer's user avatar
  • 211
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 ...
Vitalik Buterin's user avatar
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 ...
cobordism's user avatar
  • 539
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 ...
Jitendra Kumar. Balla's user avatar
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 ...
Greg Jeanmart's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible