outdoteth / rustcoin

Utxo based cryptocurrency written from scratch using sha256 hashing algorithm and ecdsa signing on secp256k1 elliptic curve

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Structures

TODO:

  • utxo changed to only include utxo offset instead of whole hash
  • Transaction needs only one signature instead of signing each utxo input
  • networking
  • change pow algo from sha256 to something more asic resistant. (Maybe Nerva's algo?)
  • can improve on security and memory O(n) -> O(1) by switching to Schnorr (so we can batch signatures in each tx since sum(sig) verifies on sum(keys))

Utxo based cryptocurrency using sha256 hashing algorithm and ecdsa signing on secp256k1 elliptic curve

Serialized output/utxo

  • version -- 2 bytes
  • value -- 4 bytes
  • Owner -- 32 bytes

Serialized input

  • utxo hash -- 32 bytes <-- this is created from Sha256([utxo, blockheader, index in utxos of block])
  • sig size -- 1 byte
  • signaturesig size -- 67-70 bytes

Serialized transaction

  • version -- 2 bytes
  • input countn -- 1 byte
  • serialized inputsn -- 99-102 bytes
  • output countz -- 1 byte
  • serialized outputsz -- 42 bytes

Serialized block

  • version -- 2 bytes
  • prev block hash -- 32 bytes
  • hash of all tx -- 32 bytes
  • nonce -- 4 bytes
  • serialized transactionsy

About

Utxo based cryptocurrency written from scratch using sha256 hashing algorithm and ecdsa signing on secp256k1 elliptic curve


Languages

Language:Rust 100.0%