An implementation of the Nano cryptocurrency protocol in golang

Go Nano

An implementation of the Nano protocol written from scratch in Go (golang).

About the Project

A crypto currency has to be resilient to survive, and the network is only as resilient as the weakest link. With only one implementation of the protocol, any bugs that are found affect the entire network. The aim of this project is to create an alternative implementation that is 100% compatible with the reference implementation to create a more robust network.

Additionally, there is no reference specification for the Nano protocol, only a high level overview. I've had to learn the protocol from reading the source-code. I'm hoping a second implementation will be useful for others to learn the protocol.

Components

Eventually the project will contain the following components:

  • GoNano

    A support library containing common functions, e.g. block validation, hashing, proof of work, etc

  • Nano Vanity

    A tool to generate vanity addresses (See https://en.bitcoin.it/wiki/Vanitygen)

  • GoNano Node - Coming Soon...

    A full node implementation compatible with the official Nano wallet, but with faster initial sync times out of the box.

  • GoNano Wallet - Coming Soon...

    A GUI Wallet that can either run as a node or as a light wallet.

Milestones

  • Vanity Address Generator

    A simple project to get the basic public-key cryptography functions working and tested.

  • GoNano Node
    • A basic node that can validate and store blocks sent to it
      • Data structures
      • Database
      • Proof of work
      • Cryptographic functions
      • Basic wallet functions
      • Networking
        • Receiving keepalives and blocks
          • keepalives
          • publish
          • confirm_ack
        • Sending keepalives
    • Add broadcasting and discovery
    • Add RPC interface
    • Add voting
    • Add compatibility with existing Nano Nodes
    • Add spam defence and blacklisting of bad nodes
    • Add complete testing harness
    • Add fast syncing
  • GoNano Wallet
    • Basic UI, creating/sending/receiving transactions
    • Add seed restore, account generation, changing representatives
    • Add bundled node and light wallet/node selection option
    • UI Polish and distributables

Contributing

Any pull requests would be welcome!

I haven't been using Go for very long so any style/organisation fixes would be greatly appreciated.

Feel free to donate some Nano to nano_1frankh36p3e4cy4xrtj79d5rmcgce9wh4zke366gik19gifb5kxcnoju3y5 to help keep me motivated 🍻

Owner
Comments
  • Great job!

    Great job!

    Great work here, guys!

    I was thinking of Nano rewrite in Go, so I gave google a search - led me to here.

    I will explore a bit more project in the following days, but can you please:

    • Enable the issues on the Consenbus core repo: https://github.com/consenbus/core
    • Enable the Slack community channel missing on the Consenbus main page: http://consenbus.org/
  • Have donate 25xrb

    Have donate 25xrb

    good job, wish you can keep going.

    just donated 25xrb, txid: https://raiblocks.net/block/index.php?h=627A66C3FC79702D365146AEABACF7AA037E02DA5FA32A85D9C14A94F3DC7530

  • Add simple alarm and basic daemon command

    Add simple alarm and basic daemon command

    • [x] Adds an Alarm type, which calls a function with some parameters, repetitively after the passing of a duration (Needs further optimizations and better error handling).
    • [x] Adds cobra to help with writing the cli. Viper can be added for reading in config files, in a manner compatible with cobra.
    • [x] Adds a simple daemon command which accepts --testnet, --peer and --work-dir flags, and starts store and node.
    • [x] Adds source of udp message to the list of peers

    I named the command nanode, but only because I had to name it something, and nano is perhaps not the best name (due to the nano editor being quite commonplace). Please change it to your preference.

  • Organized imports

    Organized imports

    Hi @frankh !

    Imports are organized in groups, with blank lines between them. The standard library packages are always in the first group.

    https://github.com/golang/go/wiki/CodeReviewComments#imports

  • faster work generation

    faster work generation

    I have change the work type from []byte to simple uint64. Also I have reused the hash.Hash implementation between work iterations by calling Reset(). These changes made it 20% faster on my machine. You can run benchmarks to verify.

  • MessageHeader uses incorrect extensions size?

    MessageHeader uses incorrect extensions size?

    I was working on parsing the UDP packets being sent on the Nano network (not related to your implementation). I seem to get some malformed package headers, with respect to the extensions field, although it's hard to tell without a clear specification.

    Reading the Nano code, specifically https://github.com/nanocurrency/raiblocks/blob/8caed829b461b015141d2dcd57d9b3457ba0f7f0/rai/node/common.cpp#L53, it seems the extensions field uses 2 bytes. But in your code, https://github.com/frankh/nano/blob/078a99b8e75bd239e13565312e06258164a781d5/node/node.go#L55, I see you use 1 byte. Have you tested your code on the actual packets flying around, and did it parse them correctly?

  • Add modified crypto to this repo

    Add modified crypto to this repo

    Currently modified ed25519 is kept in https://github.com/frankh/crypto fork of go/crypto with just one patch.

    Like in consenbus repo (https://github.com/consenbus/core/tree/master/ed25519), a crypto dir with just a necessary ed25519 should be added to this repo.

A tiny Nano wallet, focused on ease of use through simplicity

atto is a tiny Nano wallet, which focuses on ease of use through simplicity. Disclaimer: I am no cryptographer and atto has not been audited. I cannot

Nov 14, 2022
A Nano ID command line (CLI) tool implemented in Go.

Nano ID CLI The Nano ID CLI is a command line tool for generating Nano IDs. With Nano ID CLI you can quickly generate one or more Nano ID strings of a

Nov 15, 2022
GDScript Syntax Highlighting in GNU Nano

nano-gdscript GDScript Syntax Highlighting in GNU Nano. Updated regularly every minor updates. Contributions are welcomed Installation This is 100% fr

Dec 20, 2022
Vanity address generator for Nano

Nano Vanity Generator A basic vanity address generator for the Nano cryptocurrency. What is a vanity address? A vanity address is an address that cont

Feb 6, 2022
Reference go implementation of globalDCE protocol

globalDCE-go This is the reference implementation of the command line interface of globalDCE coded in the go programming language. This project is sti

Nov 15, 2021
Reference implementation of globaldce protocol coded in go

globaldce This is the reference implementation of the command line interface of globaldce coded in the go programming language. This project is still

Nov 15, 2021
Golang Todo App with rpc protocol,k8s,github actions
Golang Todo App with rpc protocol,k8s,github actions

go-todo-app-rpc Golang Todo App with rpc protocol ,k8s, github actions using docker-compose locally docker-compose build docker-compose up Open http

Nov 28, 2021
🔄 A command-line utility to export Protocol Buffers (proto) files to YAML, and JSON

proto2yaml ?? A command-line utility to export Protocol Buffers (proto) files to YAML, and JSON. Currently supported exports are for: Packages Service

Nov 10, 2022
Terminal chat with multiroom support over custom protocol.

Terminal Chat Content Content Overview Download Commands Protocol Room URL Platforms Examples Overview It is a multiroom terminal chat. It allows comm

Sep 3, 2022
Rule engine implementation in Golang
Rule engine implementation in Golang

"Gopher Holds The Rules" Grule-Rule-Engine import "github.com/hyperjumptech/grule-rule-engine" Rule Engine for Go Grule is a Rule Engine library for t

Jan 3, 2023
Readline is a pure go(golang) implementation for GNU-Readline kind library
Readline is a pure go(golang) implementation for GNU-Readline kind library

A powerful readline library in Linux macOS Windows Solaris Guide Demo Shortcut Repos using readline Feedback If you have any questions, please submit

Jan 8, 2023
Simple trie based auto-completion engine implementation in golang.
Simple trie based auto-completion engine implementation in golang.

Simple auto-complete engine implementation in golang. Quick start $ git clone https://github.com/benbarron/trie-auto-completion-engine $ cd trie-auto-

Jul 12, 2022
Golang implementation of the research by @jonaslyk and the drafted PoC from @LloydLabs

Doge-SelfDelete Golang implementation of the research by @jonaslyk and the drafted PoC from @LloydLabs Golang 实现的文件自删除,来自@jonaslyk和@LloydLabs etc add

Oct 2, 2022
Golang implementation of Reflective load PE from memory

?? Frog For Automatic Scan ?? Doge For Defense Evasion & Offensive Security Doge-MemX Golang implementation of Reflective load PE from memory Only Sup

Dec 6, 2022
Golisp-wtf - A lisp interpreter (still just a parser) implementation in golang. You may yell "What the fuck!?.." when you see the shitty code.

R6RS Scheme Lisp dialect interpreter This is an implementation of a subset of R6RS Scheme Lisp dialect in golang. The work is still in progress. At th

Jan 7, 2022
Doge-AddSSP - Load ssp dll golang implementation

Doge-AddSSP Load ssp dll golang implementation Administrator/System Privilege Us

Nov 9, 2022
golang implementation of Syswhisper2/Syswhisper3

Doge-Whisper golang implementation of Syswhisper2/Syswhisper3 按系统调用地址排序获取System Service Number(SSN)即为sysid以绕过hook, Sorting by System Call Address doge

Dec 10, 2022
An implementation of sed in Go. Just because!

Sed-Go An implementation of sed in Go. Just because! Status Command-Line processing: Done. It accepts '-e', '-f', '-n' and long versions of the same.

Aug 23, 2022
A go language implementation of a CLI, based on input directory files

A go language implementation of a CLI, based on input directory files, using tree output of all file names, based on input database links, dynamic reading of database table information, based on input swagger files to automate the generation of the RESTFUL API.

Aug 23, 2022