A cryptographic point system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Raccoondude 14d488ded4 17 4 months ago
Blocks 17 4 months ago
Keys blocks and such 4 months ago
Notes Init 4 months ago
Old Stuff 4 months ago
Puppylib Stuff 4 months ago
Scripts 17 4 months ago
LICENSE Initial commit 4 months ago
README.md Docs 4 months ago

README.md

Puppy Points

The weirdest Blockchain based point system

Puppy Points is a “point” system, where users can give others “points”. The word “points” shows this project was made as an experiment, a way to play with a crypto based coin, outside of a “real” coins testnet. It was created to give people who wish to learn how to use crypto as chance. The idea is a crypto with readable text for beginners

Blocks

The blockchain is comprised of files, starting with the “Adam” block 0, and ends at the hight of the current blockchain. Each file is named after its block height, this is used to sort each block. Inside each block is a json string. The json file of 0 for example is:

{
"block": {
"height":0,
"parent":"null",
"reward": "1234453871038273263102711317134110360238200583851874720225969914209638456760661417594130880478963647",
"nonce": 0,
"message": "First ever block uwu",
"coinbase": {
  "transaction": "0 0 1234453871038273263102711317134110360238200583851874720225969914209638456760661417594130880478963647 10"
},
"trans1": "null",
"trans2": "null",
"trans3": "null"
}
}

First, the json text defines the “block” object. Blocks are comprised of mutable values: Height, parent, reward, nonce, message, coinbase, trans1, trans2, and trans3

Firstly, height will be the block height

“Parent” will be the sha256 hash of the past hash (adam will be null, and ONLY adam, if any other block defines their hash as “null” should be considered invalid)

Reward: This should be the numerical public key of the account winning the block

Nonce: the nonce that makes the sha256sum hash equal to 0000000*

Coinbase: Should be a transaction string of the reward (more on that later)

Trans1: a transaction and a signature, for example:

"trans1": 
{
 "trans": "{THIS IS WHERE THE TRANSACTION STRING WOULD BE}",
 "signature": "{THIS IS WHERE THE SIGNATURE WOULD BE}"
},

Trans2: the 2nd transaction, see trans1

Trans3: the 3rd transaction, see trans1

Each block can hold only 3 transactions, this may seem like a small amount but I call this the “playground” of crypto, not used as a currency but as a place to play with points. Once a block is made, it must be mined, after it should be saved in the directory all other blocks are in named the height it is.

Mining

As long as the SHA-256 sum outputs 7 0s, its a valid block. The nonce should be incremented by 1 each time, rehashed, and checked for this condition.

Keyrings:

In order to send and recive points, a keyring is needed. Inputs can only be spent if a transaction has been signed by the “owner” (destination) of an input. Public/Private keys should be generated by two prime numbers, and be converted to RSA format with E = 65537.

Example

Here are two prime numbers: 4696047871345789425466717767331951822435339289497 and 95891139617436168930741794467220434435232567005523

$$ P = 4696047871345789425466717767331951822435339289497 $$

$$ Q = 95891139617436168930741794467220434435232567005523 $$

Your Public key (the number you send too) will be: $$ N (public)=P*Q $$ In our example thats: 4285954966778829774890940200465257829338660087071366294994030561283700112421875262097045827694891931

Private key will equal to $$ ModInverse(65537,LCM(P-1,Q-1)) $$ In python this is:

mod(E,-1,K)

Transactions

Transactions are strings that are separated by white spaces. There are two types of transactions, “Sending” and “grouping” transactions. Transactions unspent are inputs, and transactions that are spent become outputs

A Sending transaction takes an input, divides the amount of points you wish to send, and creates two inputs from one output.

Sending transactions have 6 different parts:

  1. The timestamp/ID
  2. The spending transaction ID
  3. The detestation address/public key
  4. The amount spending
  5. The change transaction ID

Example:

1621212451 1621132847 5580180966649637635732310405732096393110364061226210926062919341485394826561783310516931576249229761 5 1621212490

The “1621212451” is a timestamp of the transactions, each transaction has one, and is their ID. There cannot be two transactions with the same timestamp, otherwise the block is invalid.

The “1621132847” is the timestamps output, all points under this transaction will be spent

The “5580180966649637635732310405732096393110364061226210926062919341485394826561783310516931576249229761” is the transactions destination for the spending input, the Points being spent will be sent to this public key

The “5” represents the amount of Points being spent

The “1621212490” is the “change”, its credited back to original sender

Numbers for 1 and 5 should be randomly generated if not, the timestamp.

A grouping transaction has 8 different parts:

  1. The timestamp/ID
  2. The spending transaction (can be any)
  3. The detestation address (should ALWAYS be 0)
  4. The amount spending (should ALWAYS be 0)
  5. The change transaction ID (will just replace the spending transaction)
  6. The amount of transaction to group
  7. The transactions to group
  8. The new transaction ID

So a transaction would look like:

[ID] [Spending output] 0 0 [Change ID] [Amount of transactions] [Transactions to group] [New Transaction]

Example:

1624303884 1624242433 0 0 1624303917 2 1624242310 1624242413 1624304012, is a combination transaction string

“1624303884”: Is the transaction ID, will not be used but needs to be random and unquie (protcol demands it)

“1624242433”: is the spending transaction, this will be used as an output

“0”: the protcol treats all transactions pointed to 0 as grouping transcations

“0”: Please only send 0 Points to this address, otherwise the address 0 will take all your coins

“1624303917”: change address, will be the new input

“2”: Amount of transactions to group

“1624242310 1624242413”: The two transactions to group

“1624304012”: The new input of the grouped two transactions

Signatures

How do you make a signature?

First, get the SHA-256 hash of the transaction string and convert it to base 10, after, do $$ Hash^{public} =mod\ public=signature $$ How would you verify a signature?

First, get the SHA-256 hash of the transaction string and convert it to base 10, then take the signature $$ Hash^{65537} mod \ public = SHA256 \ Hash $$