Readme + secret2dunikey.py + install script

This commit is contained in:
Boris Paing 2020-03-14 22:49:44 +01:00
parent abad918d16
commit e156bdc84d
4 changed files with 103 additions and 36 deletions

BIN
doc/ssb-g1like-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -17,13 +17,6 @@ fn_exists() {
[ `type -t $1`"" == 'file' ]
}
# INSTALL build-essential
if ! dpkg -s build-essential; then
sudo apt install build-essential -y
fi
# INSTALL silkaj
if ! fn_exists silkaj; then
echo "INSTALL silkaj"
@ -32,6 +25,13 @@ sudo apt install python3-pip python3-setuptools python3-wheel -y && pip3 install
echo 'PATH=$PATH:.local/bin' >> ~/.bashrc && source ~/.bashrc
fi
# INSTALL build-essential
if ! dpkg -s build-essential; then
sudo apt install build-essential -y
fi
# INSTALL sbotc
if ! fn_exists sbotc; then
sudo apt install libsodium-dev jq -y
@ -46,6 +46,39 @@ fi
####################### G1 SSB ACCOUNT MANAGER ############################################
###########################################################################################
# If user already has an SSB account, we generate Duniter secret key from SSB secret key
if [[ -f ~/.ssb/secret ]]; then
ssbpub=$(cat ~/.ssb/secret | grep public\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
ssbpriv=$(cat ~/.ssb/secret | grep private\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
g1pub=$(echo $ssbpub | base64 -d | base58)
g1priv=$(echo $ssbpriv | base64 -d | base58)
cat > ~/.ssb/secret.dunikey <<EOF
Type: PubSec
Version: 1
pub: $g1pub
sec: $g1priv
EOF
# If user doesn't have an SSB account, we create one
else
mkdir -p ~/.ssb
echo "WELCOME CREATING YOUR G1 SSB ACCOUNT !!!"
echo "CHOOSE YOU LOGIN or LEAVE BLANK & HIT ENTER FOR AUTO GENERATION"
read salt
[[ $salt != "" ]] && echo "PASSWORD?" && read pepper && [[ $pepper == "" ]] && exit
# Install DUP-Mnemonic
if ! fn_exists dup-mnemonic; then
@ -56,15 +89,6 @@ if ! fn_exists dup-mnemonic; then
sudo cp target/release/dup-mnemonic /usr/local/bin
fi
# CHECK SSB ~/.ssb/secret
if [[ ! -f ~/.ssb/secret ]]; then
mkdir -p ~/.ssb
echo "WELCOME CREATING YOUR G1 SSB ACCOUNT !!!"
echo "CHOOSE YOU LOGIN or LEAVE BLANK & HIT ENTER FOR AUTO GENERATION"
read salt
[[ $salt != "" ]] && echo "PASSWORD?" && read pepper && [[ $pepper == "" ]] && exit
# GENERATE MNEMONIC KEY: 9 MOTS
if [[ $salt == "" ]]; then
declare -a makeyarray
@ -81,7 +105,7 @@ echo "CREDENTIAL: $salt / $pepper"
python3 ./key_create_dunikey.py "$salt" "$pepper"
mv ./.secret.dunikey ~/.ssb/secret.dunikey
# CREATE
# CREATE SSB secret
pub=$(cat ~/.ssb/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
priv=$(cat ~/.ssb/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
ssbpub=$(echo $pub | base58 -d | base64)
@ -106,20 +130,4 @@ cat > ~/.ssb/secret <<EOF
EOF
else
# CREATE ~/.ssb/secret.dunikey
ssbpub=$(cat ~/.ssb/secret | grep public\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
ssbpriv=$(cat ~/.ssb/secret | grep private\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
g1pub=$(echo $ssbpub | base64 -d | base58)
g1priv=$(echo $ssbpriv | base64 -d | base58)
cat > ~/.ssb/secret.dunikey <<EOF
Type: PubSec
Version: 1
pub: $g1pub
sec: $g1priv
EOF
fi

View File

@ -1,3 +1,47 @@
SSB G1 like is a micro donation system, just like Flattr, except:
- It runs on SSB instead of centralized web
- It uses a libre currency instead of private currency
SSB/Ğ1 like
===
**SSB/Ğ1 like** is a micro donation system, just like Flattr, except:
- It runs on SSB instead of the centralized web
- It uses a libre currency (Ğ1) instead of a private one
![SSB/Ğ1 like logo](doc/ssb-g1like.png)
## Authors
- @cel from the SSB community (@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519)
- @Fred from the Ğ1 community (@9BbJwPDjcyIqrOUPNn0nJZBduWdIrpMk3Cjz5MP361s=.ed25519)
- @Boris from the Ğ1 community (@l5nYExWYIgDLV6BYHOJPoI97jIUyTdSm8CTLpQ0XeOg=.ed25519)
## What is a libre currency?
A [libre currency](https://libre-currency.org/) is a concept that originated from the [Relative Theory of Money](https://en.trm.creationmonetaire.info/).
It is a way to design a currency so that every human, whatever the generation they are part of, produces the same relative amount of money.
The Relative Theory of Money was written by a French mathematician in 2010, and the first libre currency (Ğ1) was born in 2017. Up to this day, Ğ1 is the only libre currency we know of.
### Ğ1, the first libre currency
Ğ1 the first libre currency we know of.
It runs on [the Duniter blockchain engine](https://duniter.org/).
The main clients for Duniter are [Cesium](https://cesium.app/) and [Silkaj](https://mystifying-nobel-66ae54.netlify.com/)
## How to spend your Ğ1
The Ğ1 currency originated in called [ğchange.fr](https://www.gchange.fr/#/app/home).
The economy is still in its infancy, but you can already [book a reservation in a B&B](https://www.gchange.fr/#/app/market/lg?last&category=cat67&type=offer).
An other way to spend your Ğ1 is use it with this micro-donation system.
Run the install script and
## An SSB user sent you Ğ1? Here is how to claim it:

15
secret2dunikey.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# This script creates ~/.ssb/secret.dunikey from your scuttlebutt secret
# You can use it https://cesium.app / https://silkaj.duniter.org/
# Python API https://pypi.org/project/duniterpy/
rm -f ~/.ssb/secret.dunikey
ssbpub=$(cat ~/.ssb/secret | grep public\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
ssbpriv=$(cat ~/.ssb/secret | grep private\" | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/\"//g)
g1pub=$(echo $ssbpub | base64 -d | base58)
g1priv=$(echo $ssbpriv | base64 -d | base58)
cat > ~/.ssb/secret.dunikey <<EOF
Type: PubSec
Version: 1
pub: $g1pub
sec: $g1priv
EOF