Overview for the Lava Network


#1

The Lava Network’s purpose is to allow everyday users of 0xBitcoin (or other ERC20s) to spend and transfer 0xBitcoin without having to carry any ETH or even worry about the Ethereum Mainnet at all. This is done by using offchain ‘checks’ called ‘Lava Packets’.

These Lava Packets are composed of eight integers, which all fit into a Solidity method as input parameters. When this Solidity method is called, it is like someone is depositing a signed check in the bank: A monetary transfer of 0xBTC is done between account A (always the signer/spender) and account B. The relayer (Account C) who turned in the ‘check’ to the Ethereum Mainnet had to pay some Gwei to do this, and so also in the check is a small reward of 0xBTC tokens for the relayer. This is what incentivises the relayers to submit the signed Lava Packets to the smart contract.

Here is a professional rendering:

lavanetwork

You can play with this system at http://lavawallet.io but you have to set your Metamask to Ropsten Network.

Here is the code for the contract:
https://github.com/0xbitcoin/lava-wallet/blob/master/contracts/LavaWallet.sol

The most important method is the one which accepts the check (signed data), approveTokensWithSignature().

function approveTokensWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool)

Hopefully someone will make a ropsten 0xBTC faucet :slight_smile: Before that, you can open the 0xBTC miner and run the command ‘test mine’ to mine for some test 0xBTCs automatically.

Github: http://github.com/lavawallet

Test 0xBTC Contract:
https://ropsten.etherscan.io/address/0x9D2Cc383E677292ed87f63586086CfF62a009010

Lava Wallet Contract:
https://ropsten.etherscan.io/address/0xdc2D3B72eC62e3c7f3C4225857069044df40Bc54

Mining Delegate Contract:
https://ropsten.etherscan.io/address/0x00b228558f9dd336f0c0701068c45daf9adfe3e2


#2