Currency simulator on tilde.town and other tildeboxes on tildeverse.org
- Clone the repo.
- Create a service user specifically for tcoin.
- Make sure you have
bash
,realpath
,echo
,touch
,mkdir
,g++
,head
,true
,base64
, andcat
are available. - Run
./ntcoin a b c d
as the service user, wherea
,b
,c
andd
are defined as follows:a
: the absolute path to the directory (without the trailing slash) where thetcoin
folder containing all the users' data will be stored (i.e., the script will create the directorya/tcoin/
)b
: the absolute path to the directory (without the trailing slash) where thetcoin
andpcoin
executables will be located, i.e., all users will have to haver-x
permissions onb
so that they can access the executablesb/tcoin
andb/pcoin
. Please note thatb/tcoin
andb/pcoin
will have the suid bit set. This means that when they runb/tcoin
andb/pcoin
, it will be with the uid of the service user (not their own uid). This is how they are able to send and receive coins only through the executables but not modify thea/tcoin/
themselves.c
: an integer number of tildecoins that every user starts with. This is stored ina/tcoin/base/base.txt
, and for universal-basic-income-style inflation, one can modifya/tcoin/base/base.txt
using a cronjob. This will increase everybody's coins in real time.d
: a host name (in quotation marks, e.g., d = "tilde.town") that will appear intcoin --help
.
- Run
b/npcoin a
as the service user in the parent directory of thetcoin
folder, i.e., if thetcoin
folder is in directory with absolute pathx
, then runcd x; b/npcoin a
. Here,a
is the name of the program account you want to create, andb
is the absolute path to thetcoin
repository that contains thenpcoin
script. Program accounts should start with a capital letter (e.g.,My_program_account
orMy-program-account
). - Add a line (ending with one newline character) to
tcoin/secrets/pcoin_keys
in the following format (assuming the name of the program isMy_program_account
):My_program_account <a 64-character random alphanumeric (either all lowercase, or mixed-case will also work) string>
- The string will be the key that the program uses to access and operate its account, and must be given to the requester of the program account securely (and currently, manually). I usually use random.org to generate these 64-character strings because I don't trust pseudorandom number generators (even if they are cryptographically-secure pseudorandom number generators). Anybody who can guess a key can use that program's account.
- Program-account creation is currently not automated because of concerns about name-squatting and similarly-named program names.