Today we’re pleased to throw open the gates of the DBC Playground. Lucky Alice has 18,446,744,073,709,551,615 freshly minted tokens (she’s counted them all) and she’s generously agreed to give 100,000 to Bob. So Bob gives Alice his public key, and Alice generates a DBC just for him. Just to make sure the transaction’s gone through, Bob checks his wallet.
You can recreate this scenario and possibly some more exciting variations in @danda’s DBC Playground.
@heather_burns and @jimcollinson are working on the governance white paper and Heather has reached out to another decentralised project to scope out a possible advocacy response to the UK Online Safety Bill.
There’s been some good progress on membership integration with all tests passing now, reports @davidrusu. The pieces are all in place. Hold onto your hats folks…
@danda has finished removing the mint nodes from
sn_dbc, as discussed last week, so some building blocks for exchanging owned and bearer DBCs are in place If you’re up for building the software (just copy and paste the commands so long as you have Rust etc installed) you can be among the first to experiment hands-on with Safe Network DBC technology.
@oetyng has implemented the message control flow / backpressure work, and that’s all been merged, which has further reduced node mem usage. He continues to look at improving node workload prioritisation, so there will be more to come there soon.
The sn_dbc_examples crate contains an example wallet and spentbook node(s) intended to demonstrate usage of the sn_dbc crate. These communicate using qp2p and a simple example DBC messaging protocol. To be clear, these are not integrated with the rest of Safe Network. That work is in progress now. We have nick-named this the DBC Playground.
We invite interested and technically inclined community members to give the DBC playground a spin and let us know how you find it. It should work on Linux, Mac and Windows. Let us know if you need a hand with the build.
ultraman or install
ultraman is a program that makes it easy to start/stop multiple spentbook nodes. Windows users will need to install the Ruby program
foreman instead, for which you will first need to install Ruby - see instructions below.
$ git clone https://github.com/dan-da/ultraman.git $ cd ultraman $ cargo build $ cargo install --path . # <- don't forget the ' .'
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('<https://chocolatey.org/install.ps1>'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin cinst ruby gem install foreman # in a new shell
$ git clone https://github.com/maidsafe/sn_dbc_examples.git $ cd sn_dbc_examples $ cargo build
Open three terminal windows in the
In terminal window 1 start a distributed spentbook with 3 nodes:
$ RUST_LOG=info ultraman start
In terminal window 2 (Bob) create a wallet:
$ cargo run --bin wallet -- --wallet-file .wallet2.dat
Now create a public key/address to receive funds:
Receive PublicKey: a1234567……
In terminal window 3 (Alice) create a wallet and check the balance
$ cargo run --bin wallet
Available balance: 0
Now issue the genesis key to create Alice’s funds
Check the balance again
Available balance: 18446744073709551615 :
Now Alice can reissue the genesis DBC into a smaller DBC to pay Bob 100000. The remainder automatically goes back to her wallet.
Available balance: 18446744073709551615
Amount to spend:
[b]earer or [o]wned:
Recipient’s public key:
-- Begin DBC -- 01000000a5c4a0e24ff643b9a7056af9efe3ed447472cd8b ... -- End Dbc--
Alice copies the DBC (note: just the characters between the begin and end tags and no white space) and sends it to Bob.
In terminal window 2 (Bob)
Bob types the
deposit command in his wallet and pastes in the DBC, adding a note if he wants:
Now when Bob checks his balance it’s now 100,000 tokens.
Available balance: 100000
And he can see the DBC(s) and some info about it using the
*-- Unspent Dbcs – *
a56e45ddf45f880b588b75f243fa88328d190c928596c5237c2d3bffe993a66c, rcvd: 2022-03-24T04:24:14.208444897+00:00, amount: 100000 (mine)
Full instructions are available in the sn_dbc_examples crate.
Let us know how you get on!
Feel free to reply below with links to translations of this dev update and moderators will add them here:
As an open source project, we’re always looking for feedback, comments and community contributions - so don’t be shy, join in and let’s create the Safe Network together!