TETHASHv1 vs ETHASH Brief Overview


  • administrators

    **추신 : TEThashV1 과 Ethash 의 차이점은 ,

    추가 : FNV 구체설명 및 EIP-1485 PR추가.

    Ethash Mix 및 DAG 생성단의 FNV Hash 를,

    FNV1A 로 업데이트 하였습니다. (기존은 현재는 depricated 된 FNV0 입니다.)

    ETHASH 블록도는 이더리움 연구회의 https://steemit.com/kr/@dongsamb/ethereum-pow-ethash 참조.

    또한, 일부 기존 ETHASH 에서 Offset 을 초기값으로 사용하는 FNV1A 의 경우 Offset 을 사용하지 않고, FNV1A 라고 주장하는데,

    이는 잘못된 주장입니다.

    FNV1A 의 Offset 은 이미 검증된 PrimeNumber (소수, 암호학에서 가장중요하게 여기는 숫자그룹) 입니다.

    이전단의 Keccak 을 거치고 나오는 값이 Random 넘버라서, Offset 이 필요없다는 주장은,

    일견 맞을듯하지만, 상당한 암호학적 오류가 있습니다.

    이유는, 랜덤넘버가 소수일 확률은 지극히 낮기 때문입니다.

    따라서, 정해진 소수를 정확히 사용하는게 해시 관점에서 보안적으로 더 강하다고 보시면 됩니다.

    이때, TETHASHV1 에서는 원 FNV1A 를 최대한 적용하여, 곱하기 연산이 두번 들어가기 때문에,

    TEthashV1 이 기존 Ethash 보다, 3~10% 정도 해시가 낮게 나오는 현상을 볼수있습니다.

    하지만, ASIC 이나, FPGA 로 갈경우는 위의 곱하기 연산은 CPU 의 기본 계산유닛으로서, 같은 조건에서는 클럭이 높은 CPU 에서 더 효율이 좋다고 보시면 됩니다.

    참고로, CPU 채굴가능한 모네로의 경우 AES (암호화 알고리즘) 이 표준 하드웨어 블록이라서, i 시리즈 CPU 안에 기본 내장되어있어서,

    이를 마이닝프로그램이 활용하면, CPU 로도 상당한 해시가 나오는것을 확인할수있습니다.

    FNV 설명.

    EIP-1485 PR 논의링크 :

    https://ethereum-magicians.org/t/anti-eth-asic-mining-eip-1485-pr/1807

    EIP-1485 PR :

    https://github.com/ethereum/EIPs/blob/7336cceac6c997252299a463ffe896a3414c479b/EIPS/eip-1485.md

    FNV-0 : (depricated)

    hash = 0
     for each byte_of_data to be hashed
     	hash = hash × FNV_prime
     	hash = hash XOR octet_of_data
     return hash
    

    이를 표준 FNV(x,y) 로 C 함수로 구현하면.

    fnv(x,y)   ((x * fnvprime) ^ y)
    

    FNV1A 는

       hash = FNV_offset_basis
       for each byte_of_data to be hashed
       	hash = hash XOR byte_of_data
       	hash = hash × FNV_prime
       return hash
    

    이를 fnv1a(x,y) 일경우, 입력은 4바이트 align 으로 정한다.

    C 로 풀어쓰면,

    fnv1a(x,y)     ( ((offset ^ x ) * fnvprime) ^ y) * fnvprime )
    

    그외, FNV 변형 테스트 및 분석 코드 링크

    https://github.com/tao-foundation/FNV-Analysis



  • ETH ASIC 채굴기 비중은 10~20% 라고 본다면, TEO TethashV1 은 약 2~30%의 hash premium 이 있다고 보면 될것 같습니다.
    (If we assume ETH-ASIC miners’ or hidden accelerated mining is around 10~20% , TEO TethashV1 is 2~30% premium compared than ethash algorithm hashrates.)


  • administrators

    To English ::

    Amendment : FNV detail explanation and EIP-1485 PR info

    TethashV1 has upgraded FNV Hash to FNV1a Hash in MIX Parts of Ethash , It is also used generate DAG.
    Current ethash base algorithm is FNV0 hash, it is depricated.

    You can refer ETHASH blockdiagram here :: https://steemit.com/kr/@dongsamb/ethereum-pow-ethash , <Korea Ethereum Research Community>

    And , Some other Anti Asic EIP proposal saying that they use FNV1A , exactly they not using official Offset Value in FNV1A spec.
    that’s wrong.

    In Cryptography theory, FNV1V Offset Value is longer term verified prime number they use.
    Primenumber is very important number set , which most important in cryptoanalysis and cryptography.

    In ethash,
    first Keccak hash and output value is random number, so, they claim that it is same as offset,
    It has very critical error on their claim, in crypto graphy.
    Because All random number is not all primenumber, and possibilities very low.

    Thus, given PrimeNumber using is best way of enhancing hash algorithm security.

    In case of TethashV1, adapt original FNV1A hash algorithm, apply to TethashV1 , implemented nested double multiplication,
    It cause 3~5% lower hash value compared than ethash.

    But, It more fair hash computation efficiency CPU, GPU, ASIC(FPGA).
    Multiplication HW Logic is very conventional and very longer term optimized from the beginning of microprocessor.
    If same hw design condition, it is depend of hw core clock.
    It means, most of CPU has over 3Ghz clock , GPU core has around 1.5Ghz , ASIC (FPGA) is around 0.7Ghz ~ 0.3Ghz .
    Efficiency of Multiplication Logic is CPU >> GPU >> ASIC Miner(FPGA)

    “>>” means 10x greater than .

    But, In case of Keccak algorithm, conventional cryptography algorithm (eg, SHA256, Blake, groestl,…) is
    1core performance : 500Mhz ASIC(FPGA) > 1.5Ghz GPU >> 3.2 Ghz CPU

    In case of CPU Minable MONERO (CryptoNote - Variants) hash uses basic cryptohash algorithm is AES , it is Global Standard algorithm and
    It is applied most of Processor has included HW block.
    If it used in Monero mining, CPU based machine also get more higher hash , compared than non standard hash algorithm.

    FNV Details.

    EIP-1485 PR url :

    https://ethereum-magicians.org/t/anti-eth-asic-mining-eip-1485-pr/1807

    EIP-1485 PR :

    https://github.com/ethereum/EIPs/blob/7336cceac6c997252299a463ffe896a3414c479b/EIPS/eip-1485.md


    FNV-0 : (depricated)

    hash = 0
    for each byte_of_data to be hashed
    hash = hash × FNV_prime
    hash = hash XOR octet_of_data
    return hash

    It is implemented in “C” programming language

    fnv(x,y) ((x * fnvprime) ^ y)


    FNV1A pseudo code is

    hash = FNV_offset_basis
    for each byte_of_data to be hashed
    hash = hash XOR byte_of_data
    hash = hash × FNV_prime
    return hash

    implemented in “C” fnv1a(x,y) , data alignment condition with 4Bytes.

    fnv1a(x,y) ( ((offset ^ x ) * fnvprime) ^ y) * fnvprime )

    And, more crypto analysis of Avalanche effect comparison is linked here ::
    https://github.com/tao-foundation/FNV-Analysis


  • administrators

    – ProgPOW is why not suitable for Fair efficiency mining algorithm.

    Distinct modification compared than ethash

    Reference link : https://www.ddengle.com/index.php?mid=develop&search_target=nick_name&search_keyword=쌩광부&document_srl=10473918

    • 암호학적 간단한 FNV 해시 4바이트 해시 알고리즘도 통신분야에서 수십년검증된 것입니다.
    • ProgPOW 의 암호학적 알고리즘 검증은 아직 갈길이 멀다 봅니다.
    • 채굴 해시 알고리즘에서 중요한것은 여러 알고리즘을 혼합해서 만드는게 중요한게 아니라, 그에 대한 검증입니다.

    ProgPow 주요 기술적 요약 (summary of feature than ethash):

    https://eips.ethereum.org/EIPS/eip-1057

    A. DAG 의 mix 상태를 늘리기. (Increase DAG’s MIX states)

    B. 50블록 마다 무작위 수학 함수를 변경 , (Change simple operation randomly change by every 50th blockheights)
    X11, X17 등의 알고리즘 자체를 변경하는게 아닌, 단순 4칙 연산 형태의 계산 방식만 변경.

    C. Memory hard 를 위해서, ethash 기존 128Bytes 를 256Bytes로 변경.
    (For memory hard , 128bytes DAG fetch to doubled 256 Bytes)

    D. GPU 특화된 그래픽 파이프 라인기능 일부 사용.
    (Some of Other GPU specialized feature use)

    => 의견 .(Analysis opinion)

    A -> CPU/GPU/ASIC 모두 큰 차이없음.
    (less efficiency differences in CPU/GPU/ASIC - similar)

    B -> 곱하기 / 나누기 연산 이외에 다른 연산은 모두 ASIC 이 유리.
    ( except multiplication/divide operation, ASIC is superior efficiency)

    C -> HBM (High Band Width) 를 구현하기 위해서, 더욱더 많은 GDDR 메모리 또는 고가의 SRAM Memory 를 캐시로 설계한다면,
    GPU 및 전용 ASIC 장비의 가격만 올라감.
    ( If Vendor design their GPU and HW for HBM , Use SRAM for cache , device costs will be double,
    So, miner get profits, but they spend all of money get expensive device.
    Vendor gets final profit,
    and Accelerates GPU Vendor get monopoly.)

    D -> GPU 회사의 독점.
    (GPU Vendor monopoly is big issues in near future.)

    결론 : (Conclusion)

    1. 오랜 동안 검증된 ethash 기반의 알고리즘을 사용하여 단기적 대응을 하고,
    2. 모네로 처럼 주기적 알고리즘 업데이트가 현실적임.
    3. 또한, CPU/GPU/ASIC(FPGA) 간의 효율성을 좀 더 Fair 하게 만드는 알고리즘을 개발하여야 함.

    ( 1. Use modification of Longterm verified ethash based algorithm, and shorterm obsolete ETH Asic.

    1. Benchmark Monero’s algorithm updates for real world
    2. Research and Develop More Fair efficient algorithm btw cpu/gpu/asic
      )


  • FNV (Fowler–Noll–Vo hash function) Hash Wiki

    https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function


  • administrators

    https://www.ddengle.com/index.php?mid=develop&search_target=nick_name&search_keyword=쌩광부&document_srl=10473918

    우선, ProgPOW 의 암호학적 알고리즘 검증은 아직 갈길이 멀다 봅니다.
    하다못해, ETHASH 에서 사용되는 4바이트 간단한 해시 알고리즘인 FNV 도 수십년간 통신분야에서 검증된것입니다.

    알고리즘을 믹스해서 만드는게 중요한게 아니라, 그에 대한 검증입니다.

    위의 요약에 맞게 CPU / GPU / ASIC 에 어떤것이 유리한지 비교표를 잠깐 써보면,

    A mix state [C/G/A 동일] ETH DAG 생성처럼 , 한번 만들고 나면 실사용은 B,C 에 연동됨.

    B random math [ C << G << A ] ,
    이건 기존 multiplication을 중복으로 할경우, CPU 유리. 하지만, 나머지 알고리즘은 월등하게 ASIC 유리.
    참고 : https://www.ddengle.com/mining/10223834

    C Memory Read 128 -> 256B [ C <<< G < A ] multi bank로 256Bits ~ 512Bits 이상 HBM (High Bandwidth Memory) DDR 구성시, 이 또한 ASIC 이 월등히 유리.
    참고로 AntMiner E3 가 싸게 만들기 위해서 SDRAM 을 멀티 뱅크로 구성한 예 입니다.

    결론, 검증에 시간을 최소화하고, 주기적 알고리즘 업데이트가 답이라 봅니다.
    참조 : https://www.ddengle.com/mining/9843156