astrobwt

package module
v0.0.0-...-2a649b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: BSD-3-Clause Imports: 10 Imported by: 5

README

DERO AstroBWT CPU Mining Proof-of-Work

AstroBWT Testnet
[AstroBWT Mainnet HardFork on block 4550555, March 7,2020. ~0200-GMT.](DERO HardFork on block 4550555, March 7,2020. ~0200-GMT.)
Table of Contents
  1. AstroBWT BUILDING
  2. Sample Output
  3. AstroBWT Pseudo CODE
  4. Explaining AstroBWT
  5. AstroBWT Hash Rates
AstroBWT BUILDING

go get -u github.com/deroproject/astrobwt/miner

SAMPLE OUTPUT
DERO AstroBWT Miner v0.01 alpha  
CPU: Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz    PhysicalThreads:1  
             Threads           Total Time     Total Iterations            Time/PoW         Hash Rate/Sec  
                   1         3.272996982s                  100          32.729969ms                 30.6  
                   2         3.572288466s                  200          17.861442ms                 56.0  
                   3         4.013980986s                  300          13.379936ms                 74.7  
                   4         4.704899609s                  400          11.762249ms                 85.0  
                   5         5.784798143s                  500          11.569596ms                 86.4  
                   6         6.629462384s                  600          11.049103ms                 90.5  
                   7         8.351780961s                  700          11.931115ms                 83.8  
                   8         10.49473002s                  800          13.118412ms                 76.2  
AstroBWT Pseudo CODE
1. Calulate SHA3-256 of input data
2. Expand data using Salsa20  cipher  69371  bytes
3. Calculate BWT of step 2
4. Calculate SHA3-256 of BWT data
5. Expand data using Salsa20  cipher  69371  + random number based on step 4
6. Calculate BWT of data from step 5
7. Calculate SHA3-256 of BWT data from step 6  

More about BWT here.

Explaining AstroBWT

AstroBWT is not a product of the current cryptosphere approach. It has roots in Information Theory and the Compression Domains.

  1. AstroBWT is based on mathematical proofs and research, unlike many other CPU mining ALGOs.
  2. All current mining algorithms are static. To explain more simply, all current cryptocurrency mining algorithms follow data dependent branches, loops or conditions. Dero also built out a RandomX implementation in Golang that has been discarded for use but open sourced to the public RandomX in Golang.
  3. AstroBWT, as the name implies, has BWT at it's core. BWT has been in research for the last 3 decades and numerous optimization attempts of GPU/FPGA have taken place. For more information on that topic, please refer to literature in the Information Theory and Compression Domains. However, all known implementations to this date, could not deliver an improvement even twice that of CPUs.
  4. All major providers (such as INTEL, NVIDIA etc) have already provided optimized implementations of BWT. Since, BWT has been used quite often in the general information theory and compression domains, it has been a subject of intensive studies. https://software.intel.com/en-us/ipp-dev-reference-burrows-wheeler-transform
  5. In the coming months or years that AstroBWT is optimized or shown to have a significant performance boost on FPGAs, ASICs, or GPUs there would be a benefit for everyone. Such an advancement could even trigger the next revolution in Bioinformatics, Signal Processing, DNA Sequencing or other numerous domains where BWT is used. So, AstroBWT will not only serve as an ASIC/FPGA and GPU resisitant algorithm but it will aslo succeed in helping scientific research if it is optimized for these things.

Read more about research of BWT FPGA implementation here and local copy of this research pdf.

AstroBWT Hash Rates

1. Submit and compare hashes with other devices(On Github).:
2. Submit and compare hashes with other devices((https://benchmark.dero.network/).

SNo. CPU Miner Hash Rates Threads OS
1 AMD Ryzen Threadripper 1950X Official 560 H/s - Linux
2 Ryzen 7 2700x DDR4 2666 "Stock settings" XMRig-5.9.0 610 H/s - Windows 10
3 Qualcomm SDM845 Snapdragon 845 (10 nm) CPU Octa-core (4x2.8 GHz Kryo 385 Gold & 4x1.7 GHz Kryo 385 Silver) XMRigCC 220 H/s - Ubuntu
4 Ryzen 7 3800X 4.4Ghz XMRig 970 H/s - Linux

Documentation

Overview

Package suffixarray implements substring search in logarithmic time using an in-memory suffix array.

Example use:

// create index for some data
index := suffixarray.New(data)

// lookup byte slice s
offsets1 := index.Lookup(s, -1) // the list of all indices where s occurs in data
offsets2 := index.Lookup(s, 3)  // the list of at most 3 indices where s occurs in data

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSuffixArray = errors.New("bwt: invalid suffix array")

ErrInvalidSuffixArray means length of sa is not equal to 1+len(s)

Functions

func BWT

func BWT(input []byte) ([]byte, int)

func BWT_0alloc

func BWT_0alloc(input []byte, sa []int32, bwt []byte) int

input byte sa should be len(input) + 1 result len len(input) + 1

func FromSuffixArray

func FromSuffixArray(s []byte, sa []int, es byte) ([]byte, error)

FromSuffixArray compute BWT from sa

func InverseTransform

func InverseTransform(t []byte, es byte) []byte

InverseTransform reverses the bwt to original byte slice. Not optimized yet.

func POW

func POW(inputdata []byte) (outputhash [32]byte)

func POW_0alloc

func POW_0alloc(inputdata []byte) (outputhash [32]byte)

func SuffixArray

func SuffixArray(s []byte) []int

SuffixArray returns the suffix array of s.

func Transform

func Transform(s []byte, es byte) ([]byte, error)

Transform returns Burrows–Wheeler transform of a byte slice. See https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform

Types

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index implements a suffix array for fast substring search.

func New

func New(data []byte) *Index

New creates a new Index for data. Index creation time is O(N) for N = len(data).

func (*Index) Bytes

func (x *Index) Bytes() []byte

Bytes returns the data over which the index was created. It must not be modified.

func (*Index) FindAllIndex

func (x *Index) FindAllIndex(r *regexp.Regexp, n int) (result [][]int)

FindAllIndex returns a sorted list of non-overlapping matches of the regular expression r, where a match is a pair of indices specifying the matched slice of x.Bytes(). If n < 0, all matches are returned in successive order. Otherwise, at most n matches are returned and they may not be successive. The result is nil if there are no matches, or if n == 0.

func (*Index) Lookup

func (x *Index) Lookup(s []byte, n int) (result []int)

Lookup returns an unsorted list of at most n indices where the byte string s occurs in the indexed data. If n < 0, all occurrences are returned. The result is nil if s is empty, s is not found, or n == 0. Lookup time is O(log(N)*len(s) + len(result)) where N is the size of the indexed data.

func (*Index) Read

func (x *Index) Read(r io.Reader) error

Read reads the index from r into x; x must not be nil.

func (*Index) Write

func (x *Index) Write(w io.Writer) error

Write writes the index x to w.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL