← Back to team overview

mimblewimble team mailing list archive

Transacting

 

Hi all,

The new demo is ready. And it's not a youtube video. We can now support a full transaction lifecycle:
- Alice gets some coins by mining. Her wallet is credited with the reward amount.
- Alice creates a new transaction for Rebecca and sends it to her.
- Rebecca gets the partial transaction, completes it with her receiving output and pushes it to a full node.
- Alice mines a new block with Rebeccas's transaction. It is confirmed.

As each of these require a couple different moving parts, it's a multi-step process. You can start with creating a directory for each participant. Now here's how to do it (it all assumes you have grin built and in the path):

Alice mines some new coins:
- Start the wallet server with Alice's passphrase:
[alice]$ grin wallet -p "hi" receive
- In a different terminal, run the node in mining mode:
[alice]$ RUST_LOG=grin=info grin server -m run
- Stop everything (ctrl+c is alright). Now there's a wallet.dat in Alice's directory.

Alice builds a new transaction:
- Run the server in regular mode (this is so that in the next command, the wallet can check with the node that her transaction got confirmed):
[alice]$ RUST_LOG=grin=info grin server run
- Simple wallet command, using Alice's passphrase:
[alice]$ grin wallet -p "hi" send 200000 > tx-send.json
- The partial transaction is in tx-send.json and Alice's wallet.dat has been updated with a change output. Stop Alice's server.

Rebecca receives the funds, while Michele is mining:
- Alice has her wallet running in receiving mode to get the rewards:
[alice]$ grin wallet -p "hi" receive
- And a node running and mining:
[alice]$ RUST_LOG=grin=info grin server -m run
- Rebecca somehow gets the transaction over a secure channel and finalizes it, pushing it to any node (here directly Alice's but could be another local node connected to it):
[becca]$ grin wallet -p "hello" receive --input /path/to/tx-send.json
- The next block Alice mines will add Rebecca's transaction to the chain.

If you're curious on how this all works, here's your cue to get more familiar with the code (I don't mind giving a few pointers). There are still a couple loose ends (the absence of locks on wallet.dat is a big one) but we're getting close to a devnet. I'll need to find a server to host the first node and then we can all connect and play around. I'll send another update before soon.

And big thanks to Myrtle for the awesome transaction pool implementation!

- Igno