<p>Generally I think you can say the point of the serialization lib is to help you manage the off-chain aspects of preparing transactions before you submit them to the network.</p>
<p>It's a standalone library that does not interface with the blockchain, but it provides a lot of data structures and functions to make it easier to build and sign transactions, manage keys, generate and attach scripts and metadata etc..</p>
<p>In contrast, a service like Blockfrost <em>(or Dandelion)</em> directly interfaces with the blockchain and can, for example, take care of submitting the transactions you prepared with the serialization lib.</p>
<p>On the other side Blockfrost can also query on-chain data <em>(eg. fetch a list of utxos belonging to an address)</em> that you can then use to compose your transactions with the serialization lib.</p>
<p>So a typical scenario could be:</p>
<pre><code>1. Blockfrost: Get current network parameters
2. Blockfrost: Get UTXOs by address
3. Serialization Lib: Create a transaction with these inputs and these outputs
4. Serialization Lib: Attach this script and some metadata
5. Serialization Lib: Sign the transaction with this key
6. Serialization Lib: Build the final transaction data structure
7. Blockfrost: Submit the transaction to the network
8. Blockfrost: Check the status / block confirmations etc.
</code></pre>
<p>I haven't used cardano-wallet-js, but its an SDK that internally makes use of the serialization lib package, and also connects to your own cardano wallet server <em>(which interfaces with your node / the network)</em> - so in a way you can probably call it a hybrid or a higher abstraction layer, that should simplify things even more, if you're running your own wallet server / node.</p>

CC BY-SA 4.0
2022-04-06T13:58:27.827Z
Thanks! This is most helpful. So I guess, ideally, I could call/use this library if I was creating a wallet and wanted to handle the transaction building part..
Skelli
CC BY-SA 4.0
2022-04-19T21:36:56.123Z
Serialization Lib is the Web3.js or Ethers of Cardano. :)
Alicia Basilio
CC BY-SA 4.0
2022-04-05T08:09:47.640Z
2022-04-05T08:09:47.640Z
sean
<p>I am going through Cardano developer docs and the different APIs used to interact with the Cardano network. In the list is Cardano Serialization Lib which has the description,</p>
<blockquote>
<p>This is a library for serialization &amp; deserialization of data structures used in Cardano’s Haskell implementation of Shelley along with useful utility functions.</p>
</blockquote>
<p>I am not sure I understand its intended use. Is it an API similar to Blockfrost, Dandelion or cardano-wallet-js? If it's different, what is the intended application?</p>

<cardano-node><cardano-serialization-lib><api>
Cardano Serialization Lib Usage
# Cardano Serialization Lib Usage

(Asked by: username_0 on 2022-04-04)

I am going through Cardano developer docs and the different APIs used to interact with the Cardano network. In the list is Cardano Serialization Lib which has the description,

> This is a library for serialization & deserialization of data structures used in Cardano’s Haskell implementation of Shelley along with useful utility functions.

I am not sure I understand its intended use. Is it an API similar to Blockfrost, Dandelion or cardano-wallet-js? If it's different, what is the intended application?

**Tags:** cardano-node, cardano-serialization-lib, api


---

## 1 answers

### Answer by username_1 on 2022-04-05. Score: 7 | Accepted answer

Generally I think you can say the point of the serialization lib is to help you manage the off-chain aspects of preparing transactions before you submit them to the network.

It's a standalone library that does not interface with the blockchain, but it provides a lot of data structures and functions to make it easier to build and sign transactions, manage keys, generate and attach scripts and metadata etc..

In contrast, a service like Blockfrost *(or Dandelion)* directly interfaces with the blockchain and can, for example, take care of submitting the transactions you prepared with the serialization lib.

On the other side Blockfrost can also query on-chain data *(eg. fetch a list of utxos belonging to an address)* that you can then use to compose your transactions with the serialization lib.

So a typical scenario could be:

```
1. Blockfrost: Get current network parameters
2. Blockfrost: Get UTXOs by address
3. Serialization Lib: Create a transaction with these inputs and these outputs
4. Serialization Lib: Attach this script and some metadata
5. Serialization Lib: Sign the transaction with this key
6. Serialization Lib: Build the final transaction data structure
7. Blockfrost: Submit the transaction to the network
8. Blockfrost: Check the status / block confirmations etc.

```

I haven't used cardano-wallet-js, but its an SDK that internally makes use of the serialization lib package, and also connects to your own cardano wallet server *(which interfaces with your node / the network)* - so in a way you can probably call it a hybrid or a higher abstraction layer, that should simplify things even more, if you're running your own wallet server / node.

> **Comments:**
> **username_0**: Thanks! This is most helpful. So I guess, ideally, I could call/use this library if I was creating a wallet and wanted to handle the transaction building part..  
> **username_2**: Serialization Lib is the Web3.js or Ethers of Cardano. :)  

---

