Our developer environment is amazing, but it downloads a few gigabytes of data to get set up
# pull docker image
docker pull fedimint/fedimint-cli:master
# alias fedimint-cli to docker version
alias fedimint-cli="docker run -v $PWD/demo:/var/fedimint fedimint/fedimint-cli:master fedimint-cli --workdir /var/fedimint"
# join federation at https://testfed.xyz
fedimint-cli join-federation '{"members":[[0,"ws://188.166.55.8:17241/"]]}'
# look at `demo/client.json`
# see wallet balances
fedimint-cli info
# create invoice (decode, pay in faucet)
fedimint-cli ln-invoice <amount> <description>
# pay the invoice on https://testfed.xyz
# sweep funds
fedimint-cli wait-invoice <invoice>
fedimint-cli fetch
# see updated balances
fedimint-cli info
# produce ecash
fedimint-cli spend <amount>
# see updated balances
fedimint-cli info
# sweep ecash back to wallet
fedimint-cli reissue <ecash>
fedimint-cli fetch
# see updated balances
fedimint-cli info
# play with spending different amounts to understand coin selection
# get invoice from testfed.xyz and pay it
fedimint-cli ln-pay <invoice>
What is a note?
How does lightning integration work?
What's backing all this?
consensus_proposal
sends something to have hbbft get consensus onbegin_consensus_epoch
gets the "consensus items" -- the things hbbft achieved consensus on -- and can process them before transaction processing begins- Wallet module commits block height and fee rate to db https://github.com/fedimint/fedimint/blob/b91d528291db6a41f94eb13e137482296a5bd738/modules/fedimint-wallet/src/lib.rs#L281-#L288
- save peg out signatures from peers
- At the end of every epoch, we save a "pending transaction" https://github.com/fedimint/fedimint/blob/b91d528291db6a41f94eb13e137482296a5bd738/modules/fedimint-wallet/src/lib.rs#L480-#L492
- A background task will pick this signed transaction up and broadcast it https://github.com/fedimint/fedimint/blob/b91d528291db6a41f94eb13e137482296a5bd738/modules/fedimint-wallet/src/lib.rs#L1197-#L1203
build_verification_cache
is premature optimizationvalidate_input
- checks that we know the block, input is valid, and deposit hasn't already been claimed
apply_input
- saves a spendable utxo (including secret tweak) to the db
validate_output
- checks network, acceptable fee, can create tx
apply_output
- create tx, sign tx, delete used utxos,
end_consensus_epic
- finalize psbts, poller will find them ...
output_status
- Incoming contract preimage decryption has state transitions https://github.com/fedimint/fedimint/blob/b91d528291db6a41f94eb13e137482296a5bd738/modules/fedimint-ln/src/lib.rs#L605-#L609
- frost https://github.com/fedimint/fedimint/compare/master...nickfarrow:minimint:frost
- pay-to-simp-hash https://github.com/justinmoon/fedimint/pull/5/files
OutputOutcome
here is just a simplicity program id https://github.com/justinmoon/fedimint/pull/5/files#diff-b65a2edd3dce92b73bdac2590ebde2ff1b66ef359b11eaa50200a6366fad6e67R67 ... actually this doesn't really make sense
- betting game https://github.com/elsirion/fedimint/blob/2022-10-tabconf-workshop/modules/fedimint-tabconf/src/lib.rs#L448
- DLC execution
- Federated statechain
Run 2 servers
docker run -v $PWD/demo:/var/fedimint fedimint/fedimintd:master fedimintd /var/fedimint/mint-1.json /var/fedimint/mint-1.db 10000
docker run -v $PWD/demo:/var/fedimint fedimint/fedimintd:master fedimintd /var/fedimint/mint-2.json /var/fedimint/mint-2.db 10001
Use this for btc rpc bitcoin:[email protected]:18443
After setup, take a look at /demo
Note: this is a hack. we've merged distributed key generation. on saturday we'll probably try to hack these together.
- signet deployment https://github.com/elsirion/fedimint-signet