Skip to content

Instantly share code, notes, and snippets.

View CryptoStaked's full-sized avatar

Staked CryptoStaked

View GitHub Profile

P2P Packets

The below are assuming properly formed packets with valid data.

01 - Handshake (Request)

A handshake is sent as the first interaction with a node, and requests them as a peer. If the node has the maximum number of connections, it instead sends another possible candidate.

Request:

- Node ID

Node Discovery

Assuming a maximum number of 2 connections per node and assuming all nodes stay alive, this is the order they'd discover each other

Node A joins the network (seed node)

Tally:

A:
@CryptoStaked
CryptoStaked / Transaction Types.md
Last active May 10, 2019 08:02
Examples of what each transaction type may look like

STANDARD:

{
  "type": "STANDARD",
  "hash": "63d3602e55d6b16399e8a5a109f833e36bc16f1d9befb28ac51e30e4e4583725",
  "publicKey": "CTMUGKWuh4N6EmkQagQi1aTXAcA78BRKDSXuT6zPT8H1",
  "signature": "qH9B9SzLPyZSScQrYcLPe9LrqmwqvZoCxMDjA9GvLvRX9La19gyuebgbv4QdtMLzWcbY63WWvKYWiVVKs5KVgBmtoJn4YqxXcpYN9qRVGVPciDvdE4m7HA3wWJJoVFiKCeQ",
  "originHash": "2cf4ea17df97a1a0ad4d750b380d94b675e8686b47e4149a12e63b73f2e72288",
  "transfers": 1,