Bitcoin Forum
May 26, 2024, 10:32:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: do any coins rival Grin's simplicity?  (Read 93 times)
tromp (OP)
Legendary
*
Offline Offline

Activity: 981
Merit: 1088


View Profile
January 16, 2021, 02:50:20 PM
 #1

Simplest possible consensus model: Proof of Work. Grin uses Nakamoto consensus just like Bitcoin.

Simplest possible emission: 1 grin per second forever. Grin uses Tail Emission from launch, the complete opposite of Bitcoin's Capped Supply. The latter is known to suffer from insecurity and mining instability once the block subsidy becomes insignificant, unless a constant backlog of high fee paying transactions can be created (which Bitcoin seems to manage with its constrained block size). Emission properties are further explored in [1a] and [1b].

Simplest possible blockchain protocol: Pure Mimblewimble. In Mimblewimble, outputs are Pedersen commitments r*G+v*H which combine value and blinding factor into a single curve point. The blinding factor serves both to hide the value and to control ownership. Correspondingly, a single (multi-)signature serves both to prove value balance (non-inflation) and to authorize transfer of ownership. The magic doesn't stop there, as transaction cut-through results in the collapse of the entire transaction history into a single transaction with no inputs and the current UTXO set as outputs [2].

Simplest possible blockchain sync: verify UTXO set. Grin still verifies transaction history by means of a ~100 byte kernel that remains for every transaction, but doesn't need to know anything about spent outputs.

Simplest possible (memory hard) Proof of Work Algorithm: Cuckatoo Cycle. Its mathematical specification is only 13 lines [3a] based on the very simple siphash-2-4 hash function. Which translates to just 42 lines of C code [3b]. Like Bitcoin, solutions can be instantly verified, but unlike Bitcoin, a single solution attempt (searching a graph) takes on the order of a second.

Simplest possible Difficulty Adjustment Algorithm: wtema. Just one line of code [4] that outperforms many other DAAs [5].

Simplest possible scripting functionality: scriptless scripts. Grin does away with Bitcoin's script and all its complexity, but retains a lot of its functionality, including multi-signatures, and both absolute and relative timelocks. It easily supports atomic swaps, discreet log contracts, and bidirectional payment channels. It lacks hash locks, but finds a superior alternative in adaptor signatures

The simplicity is reflected in the relatively small Rust codebase of the reference implementation [6] and the alternative C++ implementation [7].

[1a] https://john-tromp.medium.com/a-case-for-using-soft-total-supply-1169a188d153

[1b] https://medium.com/@CryptoProfG/grin-money-explained-4-exploring-grins-monetary-model-e48b1761653

[2] https://phyro.github.io/what-is-grin/mimblewimble.html

[3a] https://github.com/tromp/cuckoo/blob/master/doc/mathspec

[3b] https://github.com/tromp/cuckoo/blob/master/doc/spec

[4] https://github.com/mimblewimble/grin/blob/master/core/src/consensus.rs#L371-L372

[5] https://read.cash/@jtoomim/bch-upgrade-proposal-use-asert-as-the-new-daa-1d875696

[6] https://github.com/mimblewimble/grin

[7] https://github.com/GrinPlusPlus/GrinPlusPlus
Frasz
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
August 21, 2022, 05:38:19 PM
 #2

Dear Tromp,

I hope you are doing great. Sorry for reopening the old topic and I am also a bit off-topic.

This is a direct question to you sir. I tried to send you a private message but was unable to do so as a newbie.

Like many I was able to create a altcoin out of the bitcoin source code version 17.02 and was able to mine the coins at home with a virtual machine. I got more interested and started to search for a Asic resistant Algorithm.

I found your Grin YouTube interview and got even more interested on the Cuckatoo cycle you have developed.

My question is: there a way to implement the cuckatoo cycle in the SHA256 coin to make it more asic resistant ? If so there is a lot of C++ code I found on your GitHub but not a guide on how to maybe implement it ? Do you have one ? Can you maybe help me ? I am also from the Netherlands and don’t mind paying you for your time and effort.

Thank you 🙏
tromp (OP)
Legendary
*
Offline Offline

Activity: 981
Merit: 1088


View Profile
August 22, 2022, 02:43:55 PM
 #3

My question is: there a way to implement the cuckatoo cycle in the SHA256 coin to make it more asic resistant ?

Cuckatoo32 is designed to be ASIC friendly, and there are in fact ASICs for it.
But where SHA256 can be seen as proof-of-logic-circuit, C32 is proof-of-SRAM.
You need 512MB of SRAM to find solutions most efficiently.

It's true that the performance gap with GPUs is much smaller than for SHA256,
and current ASICs don't have enough SRAM to achieve full efficiency, but for
future ASICs there will be at least an order of magnitude gap.

Quote
If so there is a lot of C++ code I found on your GitHub but not a guide on how to maybe implement it ? Do you have one ? Can you maybe help me ? I am also from the Netherlands and don’t mind paying you for your time and effort.

The actual Cuckatoo32 verifiying logic should be easy to integrate into Bitcoin Core. The majority of effort needed will instead be for enlarging the header with a new field for the 42 cycle indices of size 42*32 bits = 168 bytes. I'd advise you to first get your blockchain working with this larger header, where you just ignore the contents of the new field. Let me know when you have that working.

Frasz
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
August 22, 2022, 07:31:58 PM
 #4

Thank you for your effort to help me guide to achieve the method.

One more question 🙋‍♂️ upon trying this I went to the GitHub I am no c++ specialist by any means I know a little bit of Linux and made my altcoin with Linux .. but I couldn’t find the cuckoo32 in any of the folders under cuckoo 😜

Is there something I am missing ?

When you mention the header file to be adjusted for the 42 cycle indices of size 42*32 bits = 168 bytes

You mean to add it in the bitcoin chainparams.cpp ? Is this the only place I add this line ?

Do I also add a #inlcude in the chainparams.cpp of any kind ?

Sorry my knowledge is not the same level as yours I respect your hard work as I am trying to understand it and achieve your method by following along and your guidance is very much appreciated.

I understand so far:

Download the GitHub folder Cuckatoo32 (which I can not find) and put it inside the source of bitcoin core or maybe in the crypto folder of bitcoin core ? Once added open chainparams.cpp of bitcoin core and add a new field for the 42 cycle indices of size 42*32 bits = 168 bytes? Is there a special place I can add this and do I find the code inside the cuckoo as help for me to add this line ? Sorry I am really not a specialist it took me 6 months with different online pieces to create the altcoin as it is today .. please feel free to share any little you can It would make a lot of sense for me as I am reading your message 10 times now and I am trying me hardest to understand but maybe this is just out of my league as much as I want to make it work.

Thank you for your reply and I hope to hear from you.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!