ThisCoin™ — Testable-Heuristic-Interactive-Security Coin™

>>> This is a work in progress. Comments are welcome. <<<

ThisCoin is a testable heuristic interactive security coin.
ThisCoin uses a dispersed and distributed ledger.
ThisCoin has no proof-of-work nonsense. No fees. No coin-count limit.
Just witness users. And coins.

  Testable: The integrity of the distributed ledger can be validated.
  Heuristic: involving or serving as an aid to learning, discovery, or problem-solving 
  by experimental and especially trial-and-error methods. • Heuristic techniques
  • a heuristic assumption; also : of or relating to exploratory problem-solving 
  techniques that utilize self-educating techniques (such as the evaluation of feedback) 
  to improve performance. • A heuristic computer program.
  Interactive: All ThisCoin users contribute services to maintain the ledger. 
  Security: As in dependable; Not necessarily anonymous. • Something given, 
  deposited, or pledged to make certain the fulfillment of an obligation. • An instrument 
  of investment providing evidence of its ownership. 

  Wallet - a record of the wallet's ThisCoin balance and the most-recent transaction, etc. 
  Witness - a server based wallet which provides ledger services. 
  User - human access by web page to the use of ThisCoin. 
  Confirm - a process where a witness analyzes a wallet copy to validate and confirm the wallet. 
  Hold - storage of wallet record copies maintained by a witness. 

ThisCoin user software is available as a web page. 
ThisCoin witness software is available as a PHP program. 
Additional software may become available, e.g. user web page as a witness. 

ThisCoin uses a distributed ledger - that is, no one needs to store the entire ledger. Ledger 
entries are confirmed, stored and retrieved by Witnesses. There is no need for Witnesses to 
know the entire ledger. Witnesses are paid 0.01 coin (ThisCent) monthly for each wallet copy 
held and delivered. 

The number of ThisCoins in circulation increases to infinity, less by ThisCoins in lost wallets. 
Yes, total ThisCoin is always increasing - coins are added to the total coins in circulation as 
usage increases. However, ThisCoin is not necessarily inflationary because the increase in coins 
is useful with the increasing need for coins. Thus, ThisCoin value may be stable, but the 
currency ($,€,£,¥,etc.) value of ThisCoin varies with currency value. Of course, ThisCoin prices 
in trading markets can vary, so ThisCoin can be divided into tiny pieces. Nevertheless, 
the reward for witness duty will always be in ThisCoin, moderating price increases. There are 
no fees paid by traders to have their trades confirmed. Whereas bitcoin and others require 
proof-of-work burning energy; not ThisCoin, which is as efficient as practical. 

There is no number to identify a ThisCoin, just a balance entry in each wallet. 
A balance entry or transfer amount can be expressed as decimal values with unlimited magnitude. 
(For example, 1234567 and 23 and 22.75 and 0.010000000000001 are valid values.)

Transactions are initiated by payer by sending a transaction record to a witness, and that witness 
  confirms and builds two wallet-records and sends each wallet-record to another witness. 
This is repeated until ten witnesses have been recorded, then the completed wallet-records are sent 
  to all the then witnesses who will store the records in their hold. 
There is no "official" compendium of all wallet-records; several records are held by each witness. 
A witness will add a wallet-record to its hold only if confirmed by at least ten confirmations. 
Any witness may confirm additional wallet-records not originally confirmed by them, 
  thus increasing their hold. 

The ThisCoin ledger is dispersed and distributed among many witnesses and constantly being accessed. 
However, not many wallets will hold a complete copy of the ledger. 
Those that do are treated the same as all other wallets. 
Any one wallet may not be used to confirm the validity of any wallet, 
  certainly not any wallet with complete copy of the ledger. 
Several uses for complete copies are:
  To enable a full audit of the ledger as it exists in a moment of time.
  To enable point-in-time counts of wallets and coins in circulation.
However, since the ledger is in constant flux, it is impossible to image the complete ledger. 

A witness program may reside on a server or within a web page (with P2P limitations). 
Every witness has a wallet. But, not every wallet is a witness. 
A user can request wallet copies for purposes to initiate a transaction.

Every wallet can perform witness duty, in addition to trading ThisCoins.
A wallet cannot witness its own record and can effectively be banned from witness activity 
  due to poor trust grades. 
A wallet gets poor grades for wrongful confirmations, judged by preponderance of agreeing 
  confirmations and evidence of transaction calculations. 

Instead of paying a fee to have a transaction confirmed, 
ThisCoin pays witnesses for holding and delivering copies of wallets.

ThisCoin user software has these functions:
 . initiate a transaction as ThisCoin payer
 . request wallet copy from a witness

ThisCoin witness software has these functions:
 . trade coins
 . maintains it's own database of wallet IDs. 
 . show balance
 . perform confirmation duties
 . the user can set a memory limit for storing blocks

Record type-codes:
  A - broadcast of new wallet copy or a new wallet
  C - broadcast of a consolidated wallet
  D - broadcast request to delete a lost wallet 
  H - broadcast of a questioned witness, wallet is on hold
  M - email a message to a human
  P - request for witness payment
  Q - broadcast request for a wallet copy
  R - request for a wallet copy
  T - a transaction record
  U - broadcast by email of updated software availability 
  V - broadcast request by email for a vote 
  W - a wallet record

A wallet record contains: 
  wallet-id number 
  public encryption key 
  the following is encrypted with the wallet's private encryption key:
  coin balance 
  wallet-id of transaction partner
  amount transferred expressed as a negative number for the payer and positive for the payee 
  time-stamp in UT 
  trust grade 
  Internet address 
  Email address
  list of the first ten witness wallet ids 
Internet address can be an URL or other Internet access IDs of the server-witness of the wallet.
Email address of the wallet is used for broadcast message to a human.
Additional witness wallet ids follow the encrypted set.

Trust grade is a way to determine trust worthiness of a witness (0 if never witnessed [-9 to 9]). 

A transaction record contains: 
  wallet-ids of payer and payee 
  amount transferred 
A transaction record is encrypted with the private encryption key 
  when sent to a witness. 

A witness-payment record contains:
  wallet-id of witness
  amount requested
  hash of hold
A witness-payment record is encrypted with the private encryption key 
  when sent to a witness. 

user-server messaging:
. server returns a web-page with server's public-key and a form for user to indicate function desired
. server is basically a message-routing manager
. server does all the witnessing
. all communication is double-encrypted with sender's private-key and receiver's public-key
. user includes user's public-key and message encrypted with server's public-key, 
  inside with user's private key
. server maintains the hold of wallets and delivers to witnesses upon request
. server accepts requests only if browser used HTTPS
. if wallet copies don't match, the services of the non-matching copy must be analyzed.
  and all witnesses must be scrutinized
  and if the non-matching copy server is confirmed wrong, their distrust counter is incremented.
  the wallet of the transaction partner must also be analyzed  
. holds must contain all versions of each wallet copy to allow backtracking analysis, 
  until consolidated

Broadcast mode:
. sends message to own wallet-id number plus one, if no response, plus two, etc. 
. if receiver can handle the request it replies with the answer, 
else replies that it's forwarding the message 
  nevertheless, if the message is intended for broadcast to all wallets, 
  in which case it forwards the message
. if receiver does not respond, sender repeats the message to next wallet until a response is received
  if message is sent by email, sender does not wait for a response but continues with next wallet
. every wallet remembers, among other parameters, the highest number wallet 
. a broadcast message is used to:
  request copy of a wallet when sender does not already have a copy
    but, request should first be sent to wallets it already knows, 
    and, if not found then go with broadcast mode
  announce a new wallet and thus the highest wallet number 
  announce that a wallet copy is in question and that an audit is being performed, 
    i.e. wallet is on hold
  announce that a wallet copy is being considered for consolidation
  announce a new version of a wallet copy, typically a result of a transaction, etc. 

Every witness remembers these parameters:
  the highest numbered wallet 
  copy of the wallet record used in previous broadcast messages, to be ready for another broadcast 

To conserve space, the storage of each wallet copy is composed of: 
  the oldest copy, followed by: 
  annotations of changes in newer copies 
  . byte-position of start of changed text
  . length of text to be replaced
  . length of text replacement 
  . replacement text 
  the newest copy 

every transaction and broadcast is time-stamped using UT; 
all activity is performed in time-stamp sequence
every broadcast message is encrypted with sender's private key, receiver's public key, 
and originator's private key

. return wallets for specified wallet-ids - 
server gathers wallet-copies from several witnesses and compares for equality
. send proposed wallets (buyer and seller) to server  - 
server sends proposed wallets to witnesses in the wallets

Encryption is only needed to identify the authentic owner of the wallet.
OpenPGP.js OpenPGP JavaScript Implementation (RFC 4880).
OpenPGP.php This is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).


A hash is used as shorthand of stored wallet copies for paying for holding wallet copies. 
The hash is used by witnesses to confirm that wallet actually holds copies it says it holds 
rather than confirming the entire record. 

function simpleHash(string,hash){// hash is count of previous strings, 0 for first string
  for(i=0;i<string.length;i++)hash+=string.charCodeAt(i);// sum of characters in string
  return hash;// prefix with letter S to signify this hash as simple version 

// can pass the previous hash-count to make hash of several strings, else specify 0 in the call
// after last string hashed, prefix with letter S to signify this hash as stupid-simple version 
// just a sum, limited to 64 digits nearest to decimal point 
//  if(hash.length>64)hash=hash.substr(-64);
//  hashString=""+hash; // make it a string 
//  if(hashString.length>64)hashString=hashString.substr(-64);
//  return hashString+0; // make it a number

Copyleft Copyright © 2018 John G. Derrickson
ThisCoin & Testable-Heuristic-Interactive-Security Coin are trademarks of John G. Derrickson