Implementing blockchain using Golang ✔️

Implementing blockchain using Golang ✔️

Keys

The Blockchain uses ECDSA (224 bits) keys. When a user first joins the blockchain a random key will be generated.

Keys are encoded using base58.

Given x, y as the components of the public key, the key is generated as following:

	base58(BigInt(append(x as bytes, y as bytes)))

Proof of work

In order to sign a transaction and send it to the network, proof of work is required.

Proof of work is also required for block generation.

Protocol

The blockchain runs on port 9191 and uses TCP to handle connections among peers.

Message
  • Message type (1 byte)
     const (
     	MESSAGE_GET_NODES = iota + 20
     	MESSAGE_SEND_NODES
    
     	MESSAGE_GET_TRANSACTION
     	MESSAGE_SEND_TRANSACTION
    
     	MESSAGE_GET_BLOCK
     	MESSAGE_SEND_BLOCK
     )
    
  • Options (4 bytes): Data specific
  • Data (n bytes): Data specific
Transaction
  • Header:

    • From (80 bytes): Origin public key
    • To (80 bytes): Destination public key
    • Timestamp (4 bytes): int32 UNIX timestamp
    • Payload Hash (32 bytes): sha256(payloadData)
    • Payload Length (4 bytes): len(payloadData)
    • Nonce (4 bytes): Proof of work
  • Signature (80 bytes): signed(sha256(header))

  • Payload data (Payload Length bytes): raw data

Block
  • Header:

    • Origin (80 bytes): Origin public key
    • Timestamp (4 bytes): int32 UNIX timestamp
    • Previous block (32 bytes): sha256(previous block header)
    • Merkel Root (32 Bytes): sha256(transaction hashes)
    • Nonce (4 bytes): int32 UNIX timestamp
  • Signature (80 bytes): signed(sha256(header))

  • Block transactions

Owner
BLACKCERTIFIED seeks to serve as a blockchain platform providing an easy UX and development environment in order to convey the value of blockchain technology.
null
Similar Resources

chia-blockchain some function implement in golang

gochia chia-blockchain some function implement in golang Package bls-signatures implement blspy Usage? Now we can use it to generate plot memo and id,

May 27, 2022

Use golang to reproduce the basic blockchain

Blockchain_with_Go Use golang to reproduce the basic blockchain Update Panel V0.1 No transactions but noly blocks are allowed. V0.5 Transactions are n

Dec 30, 2022

Stackledger: a new blockchain written in golang

StackLedger Stackledger is a new blockchain. It is written in golang and uses a novel networking stack built from two primitives: channels and extensi

Feb 21, 2022

goBlockChain is a version of the classic blockChain with POW algorithms written in golang.

goBlockChain is a version of the classic blockChain with POW algorithms written in golang. May come in handy when learning about this technology.

Oct 31, 2021

The Cosmos-SDK is a framework for building blockchain applications in Golang.

The Cosmos-SDK is a framework for building blockchain applications in Golang.

The Cosmos-SDK is a framework for building blockchain applications in Golang. It is being used to build Gaia, the first implementation of the Cosmos Hub.

Nov 26, 2021

Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple.

Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple.

blockchain-dummy-test Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple. Fuente: https://medium.com/geekculture/bloc

Oct 3, 2022

Creating a blockchain in golang

blockchain-in-go Creating a blockchain in go Disclaimer : This code base is sour

Dec 26, 2021

Mini Blockchain Implementation In Golang Inspired by Go-Ethereum🚀

JP Blockchain 🚀 🚀 Mini Blockchain Implementation In Golang Inspired by Go Ethereum & BlockChain Bar by Lukas (Web3Coach) Features Working Core Compo

Aug 8, 2022

DERO Homomorphic Encryption Blockchain Protocol

DERO Homomorphic Encryption Blockchain Protocol

Homomorphic encryption is a form of encryption allowing one to perform calculations on encrypted data without decrypting it first. The result of the computation is in an encrypted form, when decrypted the output is the same as if the operations had been performed on the unencrypted data.

Dec 27, 2022
Implementation of blockchain using golang

go-blockchain Basic implementation of blockchain using golang. Initialize Blockc

Feb 18, 2022
Frontier Chain is a blockchain application built using Cosmos SDK and Tendermint.

Frontier Chain Frontier Chain is a blockchain application built using Cosmos SDK and Tendermint. Setup Initialize the blockchain with one validator no

Jul 12, 2022
OmniFlix Hub is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

OmniFlix Hub is the root chain of the OmniFlix Network. Sovereign chains and DAOs connect to the OmniFlix Hub to manage their web2 & web3 media operations (mint, manage, distribute & monetize) as well as community interactions.

Nov 10, 2022
demochain is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

demochain demochain is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve command i

Jun 21, 2022
loan is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

loan loan is a blockchain built using Cosmos SDK and Tendermint and created with Starport. As a borrower you post a request for a loan and specify the

Dec 21, 2022
Arbiter DAO: a blockchain built using Cosmos SDK and Tendermint

Arbiter DAO Arbiter DAO is a blockchain built using Cosmos SDK and Tendermint. Arbiter DAO is a Olympus DAO and Klima DAO fork brought to the cosmos e

Aug 22, 2022
Berachain - A blockchain built using Cosmos SDK and Tendermint and created with Starport

berachain berachain is a blockchain built using Cosmos SDK and Tendermint and cr

Jan 26, 2022
Kava - Reference implementation of Kava, a blockchain for cross-chain DeFi. Built using the cosmos-sdk

DeFi for Crypto. Telegram | Medium | Discord Reference implementation of Kava, a

Apr 4, 2022
Monorepo implementing the Optimistic Ethereum protocol
Monorepo implementing the Optimistic Ethereum protocol

The Optimism Monorepo TL;DR This is the primary place where Optimism works on stuff related to Optimistic Ethereum. Documentation Extensive documentat

Sep 18, 2022
A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

Dec 31, 2022