# Understanding file exchange

**URL:** <https://discuss.ipfs.tech/t/understanding-file-exchange/5083>\
**Category:** Help\
**Tags:** go-ipfs, files\
**Created:** [March 25, 2019, 10:08am UTC](https://discuss.ipfs.tech/t/understanding-file-exchange/5083 "2019-03-25T10:08:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robinmonjo](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@robinmonjo](https://discuss.ipfs.tech/u/robinmonjo)\
**Post date:** [March 25, 2019, 10:08am UTC](https://discuss.ipfs.tech/t/understanding-file-exchange/5083/1 "2019-03-25T10:08:46Z")

</div>

Hello all.

I’m working on a “simple” IPFS implementation (from scratch) for the Elixir language. My goal for now is to be able to get a file from IPFS. I made good progress already and I’m able to get back a list of providers for a particular CID.

The last step for me is to download the file from this list of peers. But how to achieve this is not clear. My current understanding is that I need to get back all the blocks of the file (to have something similar to the `ipfs ls` command) and then use the bitswap protocol to get these blocks.

When I connect to one of the bootstrap node, I can see that it exposes some protocols through mplex:

```
/floodsub/1.0.0
/ipfs/bitswap/1.1.0
/ipfs/id/1.0.0
/ipfs/kad/1.0.0
/libp2p/circuit/relay/0.1.0

```

I used the kad protocol to discover peers that can provide a file, I think that I need bitswap to get back the blocks I want, but how do I get back the blocks of a file ? I think I understand the merkle dag thing, but I can’t find how to ask a node the merkle dag of a CID.

To get here I spent a lot of time in the go code but there is so much abstractions everywhere !! A little help would be great 😊
