How does Fuel Work?
- Basics: A single smart contract contains all the consensus rules, deposit and withdrawal systems for the Fuel optimistic rollup Ethereum side-chain
- Depositing: Users deposit assets (i.e. any ERC-20 or Ether) which can then benefit from rock bottom transaction costs and quick confirmation times with no loss of custody or control at any time
- Withdrawals: Users can withdraw at any time using a liquidity provider swap or standard withdrawals (similar to other rollup systems)
- Transfers: When users transfer within Fuel, the data is compressed by our aggregator and dumped onto Ethereum, however you can always compress and post your own transaction yourself
- Keys: Preferably, a secondary signing key is used to sign off on transfers and withdrawals within the side chain. Funds are deposited to that singing key’s address, which then has control over those funds within Fuel. Third-party signer objects can also be used such as those that interact with MetaMask, however raw elliptic signing of hashes must be available.
- Wallet: the fuel-core wallet object will manage a user’s spendable inputs in a local key-value store database of your choosing (i.e. index db, local storage, level db etc.), output production and the signing of transactions
Is Fuel Right For You?
Yes, if you’re any project:
- doing transactions where you are cost or volume sensitive
- that needs fast confirmation speed (under 1.4 seconds)
- interested in building a Burner Wallet-like system
- that needs permissionless atomic swaps between any ERC-20 tokens
- that will eventually want to deploy your own large-scale rollup system
Getting Started in NodeJS
This tutorial will cover: (1) setting up a persistent Fuel wallet in Node, (2) fauceting some fake DAI to your wallet, and (3) making your first transfer.
Let’s start a new Node project and install Fuel, open your terminal:
mkdir fuel-example && cd fuel-examplenpm initnpm install --save fuel-corenano index.js
First let’s (1) import fuel-core, (2) set up a signing key, (3) set up local persistent storage using a wrapped version of LevelDB, and (4) a Signer object.