# Building Bridges

By [mfw78.eth](https://paragraph.com/@mfw78) · 2022-12-05

---

tl;dr
=====

Use [OpenBZZ](https://openbzz.eth.limo), a permissionless, censorship resistant dapp Hosted on [Swarm](https://ethswarm.org/) to:

*   Buy / sell BZZ on Ethereum Mainnet using **DAI,** **USDC,** or USDT\*.\*
    
*   One-click funding of your node (buy BZZ and bridge to Gnosis Chain, receiving 0.01 XDAI in gas for your node automatically)!
    
*   Top up your postage stamp, or use a link to ask fans of your content to top it up for you!
    

☝️Save precious gas by doing any of the above in **one transaction** when utilising DAI or USDC (or two transactions if you insist on using USDT).

To see how, read on…👀

Overview
========

The Swarm Developers have been very busy implementing Phases 2 and 3 of the [storage incentives](https://medium.com/ethereum-swarm/towards-the-world-computer-the-swarm-network-upgrade-has-started-cfba1ed68330) roadmap. Broadly speaking, storage incentives seek to reward node operators for providing storage space to the swarm, and will establish a decentralised rent price oracle responsible for setting the price of that storage. With the current pace of development by the Swarm Developers, and release `1.10.0` nearing ever closer, _now is the time to prepare your node_, but first a quick overview on the token utility so we can understand how to fund our nodes.

🔧 Token utility
================

Broadly speaking the Swarm token, BZZ, is used by the `bee` node for the following use cases:

*   🧑‍💻 **Swap protocol** - for high bandwidth usage when uploading / downloading from the swarm. Minimum required: 1 BZZ for `bee` version `1.9.0`, however reverting to 0 BZZ from the forthcoming version `1.10.0`.
    
*   📫 **Postage stamps** - rent paid by content publishers for storage on the network. Minimum required: depends on your storage needs.
    
*   🫰**Storage incentives** (_new_) - a stake for nodes that wish to receive rewards for providing storage to the swarm. Minimum required: 10 BZZ.
    

**NOTE: The stake for storage incentives, and payments made for postage batches are non-refundable.**

Initially when working with the above token utility, it is reasonable to start with ~12 BZZ. This would allow your node to participate in the storage incentives, download / upload at high speed (swap protocol), and have some spare BZZ left over to purchase postage stamps to publish your own data. So, with this being said, how do you fund your node?

💵 Fund your node
=================

In order to run your node, you will require xDAI to pay for gas (network transaction fees), and BZZ to stake / publish data. But wait, what is xDAI?! **Swarm mainnet** uses [Gnosis Chain](https://gnosis.io/), a blockchain that closely _follows_ the technological roadmap of Ethereum Mainnet, as the settlement layer for incentives / postage stamps. The native unit of account on Gnosis Chain is xDAI, which is pegged 1:1 to DAI. To get xDAI, you can use the [native bridge](https://bridge.gnosischain.com/) (or one of the [3rd-party bridges](https://docs.gnosischain.com/bridges/third-party)) to send DAI from Ethereum Mainnet to Gnosis Chain. For **non-native** (ie. _not DAI/xDAI)_ tokens, such as BZZ, you can use [_OmniBridge_](https://omni.gnosischain.com/) (or one of the 3rd-party bridges that support non-native tokens).

Sound simple? No! 🤯 This is why we created [OpenBZZ](https://openbzz.eth.limo/), a simple dapp to help you get started! 👷🐝

🐝 Using OpenBZZ
================

![Buying BZZ from Ethereum Mainnet with stablecoins](https://storage.googleapis.com/papyrus_images/9552bfbcf0d5dc91b0d79e443a4df87dd4ee19ad5ff93b2065ceff13e6afad5d.png)

Buying BZZ from Ethereum Mainnet with stablecoins

OpenBZZ allows you to purchase BZZ with stablecoins DAI, USDC, or USDT. In a **single, simple** transaction, you can:

*   Buy BZZ to hold on Ethereum mainnet (speculation).
    
*   Buy BZZ with stablecoins to fund your node.
    
*   Buy BZZ with stablecoins and top up a stamp.
    
*   Sell BZZ for stablecoins on Ethereum mainnet.
    

Buying BZZ to hold on Ethereum Mainnet
--------------------------------------

If you purchase BZZ using DAI or USDC (ie. **NOT** USDT), you can do the swap _without_ having to do a separate `approve` transaction, saving you some precious gas. To save you gas in the future as well, you can choose an ‘Infinite Approval’, but you should be aware of the [security risks in doing so](https://kalis.me/unlimited-erc20-allowances/).

![Confirm permission for OpenBZZ to use your stablecoins.](https://storage.googleapis.com/papyrus_images/3094da16293c99bb1977efdd0cded9017c055b78a906f591297603afcafa3342.png)

Confirm permission for OpenBZZ to use your stablecoins.

![Sign the Permit. Note that this is a signature, NOT a transaction.](https://storage.googleapis.com/papyrus_images/7715342fbea78016023d8ecdfcb9b3c08d113f240365209610ffe1c1958a6041.png)

Sign the Permit. Note that this is a signature, NOT a transaction.

After you have signed the `Permit` for OpenBZZ to use your DAI or USDC, you will be able to execute your swap.

![Swap overview](https://storage.googleapis.com/papyrus_images/cfece3213af7559fd2889b81383ea325c9a126788389d02665fd3295ad715e71.png)

Swap overview

At this stage, you will be asked to confirm that you wish to execute the transaction, with an overview provided of the transaction, prior to then being confirmed with Metamask.

![Execute transaction confirmation](https://storage.googleapis.com/papyrus_images/c3fceab7c4bf92886230fd0b779f36facdcc578329b2e3aad0604ee8887f8097.png)

Execute transaction confirmation

![Metamask execute transaction confirmation](https://storage.googleapis.com/papyrus_images/2702193ef5ca60cebea8283239bc34f142277c3270dedf081e91c7cdfc2c3a16.png)

Metamask execute transaction confirmation

Buying BZZ to fund your node
----------------------------

Well, let’s actually get to the point of _funding your node_! When you start your node, if you check the [logs](https://docs.ethswarm.org/docs/working-with-bee/logs-and-files), you should see something along the lines of:

    "time"="2022-09-19 12:23:38.789900" "level"="info" "logger"="node" "msg"="using ethereum address" "address"="d14fb4f6d526115991dd490d7abcc864845518f6"
    

A common misunderstanding for novices starting out - this is an _ethereum address_ but more specifically **it’s the node’s address on _Gnosis Chain_**. With this new knowledge, we can now use OpenBZZ to directly fund our node:

1.  Click ‘Advanced Options’.
    
2.  Select ‘Bridge to Gnosis’.
    
3.  Enter your node’s address in the ‘overlay or address field’.
    

![Buying BZZ and directly sending tokens to bee node](https://storage.googleapis.com/papyrus_images/3f150c74e11913252e1f8f7d3df01387ffeab5925a2dc4c6a0d89d1d0cac2bce.png)

Buying BZZ and directly sending tokens to bee node

Address and/or overlay input is verified against [Swarm Scan](https://swarmscan.resenje.org/). In the above screenshot, a green dot indicates that the address has been verified as a valid `bee` node via the Swarm Scan API. The UI will still allow you to send to a node’s address that is _not verified_ but will **NOT** allow you to send tokens to an _overlay_ that cannot be translated to an address (which shall show as a red dot for unverified input).

![Buy the new BZZ and send straight to your bee node!](https://storage.googleapis.com/papyrus_images/50dd002d108ec08d11c7b14672b187b455cd18a8caab383eb3ae59edb7e87b48.png)

Buy the new BZZ and send straight to your bee node!

![Monitor the transaction on the bridge explorer](https://storage.googleapis.com/papyrus_images/5a564046a35a06621be7d20bf3fa957d7ffce503107cac2dc90c46d78dd1dddd.png)

Monitor the transaction on the bridge explorer

Once the transaction has been confirmed, you can monitor the progress of your node’s funding by checking the bridge explorer link provided in the notification, or by visiting the [Bridge Explorer](https://alm-xdai.herokuapp.com/) and inputting the transaction hash of your swap. For example:

![Input the transaction hash to check the status](https://storage.googleapis.com/papyrus_images/41e05c297913d855af5210d36dd7f581991ced33356ef36ab683f59cec55de61.png)

Input the transaction hash to check the status

![The transaction has been confirmed by the bridge operators, and executed.](https://storage.googleapis.com/papyrus_images/7458072177cd0b1b24f5c12e6e4d930bd9b7f9ef9786cd54c44801b61b6b6d49.png)

The transaction has been confirmed by the bridge operators, and executed.

Once the bridge transaction shows ‘Executed by’, your node is now funded. As a bonus, **OpenBZZ will tip your node 0.01 XDAI, so it will also have enough gas to start automatically**.

Buying BZZ to top up your postage stamp
---------------------------------------

When uploading data to swarm, you must attach a postage stamp as a means of telling the network “this is real data, and I’m prepared to put money to it, in order to have you store it”. Gradually over time, rent is extracted from the postage stamp and redistributed to node operators through the storage incentives mechanism.

Therefore, if you want your data to stay in the swarm, you may have to _top up your stamp_:

1.  Click ‘Advanced Options’.
    
2.  Select ‘Top up Batch’.
    
3.  In the ‘Top up Batch’ box, type in your `batch id`.
    
4.  Vary the amount of BZZ you buy to adjust the stamp’s new ‘Time To Live’ (TTL).
    

![Topping up the postage stamp that hosts the awesome OpenStreetMap on Swarm!](https://storage.googleapis.com/papyrus_images/924cc75641b4c2b13cf444fe471eac9a331fabe44b5f9674ec81929676ad2cbf.png)

Topping up the postage stamp that hosts the awesome OpenStreetMap on Swarm!

The above shows how to top up the OpenStreetMap on swarm stamp (after requesting the batch ID from the data creator), adding an additional 4.4 years worth of storage time at the current rent of _4 PLUR_ (as seen in the top bar).

![Confirming the stamp top up](https://storage.googleapis.com/papyrus_images/552feadc76b680883eadb5267115036e024b6c98ba302f99430017a8312ed707.png)

Confirming the stamp top up

🔧Developer integrations
------------------------

OpenBZZ supports query parameters to enable developers / content creators to create short-cut links that make interacting with OpenBZZ even easier for end users.

1.  For node packaging software, you can create a short-cut to fund the `bee` node. Using the previous example, we can create a shortcut to add 12 BZZ to `0xd14fb4f6d526115991dd490d7abcc864845518f6`:
    
        https://openbzz.eth.limo/?amount=120000000000000000&bridgeAddress=0xd14fb4f6d526115991dd490d7abcc864845518f6
        
    
2.  For content creators who want to create a “Top Up My Stamp”, you can similarly create a short-cut. Using the previous example to top up the OpenStreetMap postage stamp:
    
        https://openbzz.eth.limo/?amount=120000000000000000&batchId=0x0e8366a6fdac185b6f0327dc89af99e67d9d3b3f2af22432542dc5971065c1df
        
    
    **CAUTION:** When creating short-cut links, recall that BZZ uses 16 decimals.
    

🚀Unstoppable access
====================

OpenBZZ is _open_ in the sense that it itself is **Hosted on Swarm**, so it accessible to **everyone** with access to swarm, making it censorship resistant!

You may access it through the following means:

*   [https://openbzz.eth.limo](https://openbzz.eth.limo)
    
*   [https://openbzz.bzz.link](https://openbzz.bzz.link)
    
*   [https://api.gateway.ethswarm.org/bzz/openbzz.eth/](https://api.gateway.ethswarm.org/bzz/openbzz.eth/)
    
*   [http://bee.swarm.public.dappnode:1633/bzz/openbzz.eth/](http://bee.swarm.public.dappnode:1633/bzz/openbzz.eth/)
    

Disclaimers
===========

A transaction fee of 1% is collected on the DAI equivalent rate of the transaction value. Minimum / maximum spends are shown including fees / slippage. The smart contracts that run OpenBZZ are **NOT** audited. Source code is published and verified, and may be reviewed at:

*   Exchange: [View on Etherscan](https://etherscan.io/address/0x69Defd0bdcDCA696042Ed75B00c10276c6D32A33)
    
*   BzzRouter: [View on Blockscout](https://blockscout.com/xdai/mainnet/address/0xEd469d6aa0658b71B9dE75c2fe401924FCf0534d)
    
*   [Github](https://github.com/rndlabs/openbzz-exchange-contracts)
    

**NOTE: Transaction fees are configurable by smart contract, however are enforced to never exceed 1%.**

---

*Originally published on [mfw78.eth](https://paragraph.com/@mfw78/building-bridges)*
