25

CryptoNote is the name of the cryptocurrency technology that Monero (and Aeon, and various others) is based on. CryptoNight is the name of the hash function that is used in the CryptoNote Proof-of-Work algorithm. CryptoNight-Lite is a modification of CryptoNight that uses half as much memory and fewer hash rounds, used in Aeon.


24

The description of the CryptoNight hash algorithm and the steps it performs can be found in the code as well as in a written file by the CryptoNote team, which can be found here. Lastly, in his blog, professor David Anderson also briefly describes the CryptoNight algorithm with an accompanying graph that illustrates it. From the blog: This was a ...


15

Cryptonight (the PoW hash used by Monero and most Cryptonote coins) does not lend itself well to ASIC development, for the following reasons: Cryptonight requires 2 MB of fast memory to work. This means that parallelizing hashes is limited by how much memory can be crammed in a chip while keeping cheap enough to be worth it. 2 MB of memory takes a lot more ...


15

There are two modifications: the scratchpad is only half the size of regular Cryptonight (1 MB rather than 2 MB) and the number of AES iterations is halved (half a million rather than a million). This makes a light hash about 4 times as fast as a regular one. It's a bit hard to tell how this change influences blockchain sync since different machines will ...


14

One of the main reasons Cuckoo cycle is atractive when compared to Cryptonight is that it is very fast to verify. This is one drawback of Cryptonight: it makes all operations that need to verify Cryptonight hashes slower. Another reason to want a switch to Cuckoo cycle would be to keep the CPU/GPU/ASIC performance within a reasonable scale. Should ASICs pop ...


12

The most profitable consumer-grade hardware that I know of is the GTX 750 Ti (an nVidia GPU). This is on a Hashrate per Energy Used basis, since the marginal cost of mining is the energy spent. It gets ~250 H/s for ~35 W. Some intel CPUs can get ~200 H/s for ~45-60 W, so CPUs aren't at that much of a disadvantage. GPUs tend to be cheaper, however, and you ...


11

There's less than a couple dozen CN based currencies. See http://mapofcoins.com/bytecoin. Shadowcash tried to implement ring signatures on a Bitcoin code base. See https://shnoe.wordpress.com/2016/02/11/de-anonymizing-shadowcash-and-oz-coin/. To my knowledge, no non-CN coin uses Cryptonight. -- Oops, I misread that last question, see lethos3's answer to ...


9

That statement does not mean that CPU mining is generally more profitable than GPU mining. The emphasis should be on significantly reduces. The large memory footprint of CryptoNight is a large reason for this. CryptoNight offers only a relative advantage of CPU mining over GPU mining. Which is best for you depends on your energy costs, use of the CPU and ...


7

I think the overall answer is "it's ridiculously impractical to perform by hand". The Cryptonight hash operates over a 2 megabyte data space, using multiple rounds of AES along with a variety of other cryptographic hash algorithms. What human is going to have the patience to write out 2 million bytes of data even once, let alone multiple times? I would ...


7

This annotated whitepaper acknowledges the importance of a thorough review: Constructing a hash function is difficult; constructing a hash function satisfying these constraints seems to be more difficult. This paper seems to have no explanation of the actual hashing algorithm CryptoNight. Nic van Saberhagen describes loosely some properties of a ...


7

piHashVal = (uint64_t*)(result.bResult + 24); result.bResult is a pointer to some data structure, it's storing the memory address at which the structure begins. We're not interested in the beginning of that data blob, but want to access some 64-bits starting at offset 24. The above expression increments the address by offset 24 and casts the result to ...


6

I like the question because an answer to it will give a better understanding, from first principles, of the underlying algorithms. So question 1 has two parts: 1a) How does the CryptoNight PoW algorithm work at all? That's specified here: https://cryptonote.org/cns/cns008.txt 1b) How does it really work, on a low level, looking at elementary instructions?...


6

I think the CryptoNote website's page about the egalitarian proof of work is about the inner working of the hash function, not about how the hash of a block is computed (which is basically cn_slow_hash(block_header + tree_hash(block_transaction_hashes)) as you thought). Internally, the Scrypt function computes blocks of pseudo-random data. Something like: ...


6

Botnets do not have magical ability to affect Monero more than any other hash source. As other PoW based currencies, Monero is vulnerable to 51% attacks, and any adversary who is able to sustainably mine faster than the rest of the network will be able to slowly increase the cumulative difficulty of an attack chain, and thus override a "legitimate" chain. ...


6

The Cryptonight description by the Cryptonote team states that First, the input is hashed using Keccak [KECCAK] with parameters b = 1600 and c = 512. In the primitive family Keccak, b is the width of bit block of the permutation function. Given an input bit string N, a padding function pad, a permutation function f that operates on bit blocks of ...


5

Worded differently (on Reddit): CryptoNight is the (hashing) algorithm. CryptoNote is the protocol.


5

Generally you can simply look at the value of the current block reward as an indication of how much electricity it takes to secure the network. At 8.7 XMR per block it costs about 78k USD in electricity to secure the network each day. Based on this, lets roughly say it is 0.15 USD / Kwh, so 78k/0.15 = 514,800 Kwh each day.


5

The algorithm is described in Cryptonote Standard 008.


5

Monero is not immune to ASICs in the future, but the costs of manufacturing ASICs is offset by the block rewards such that it would not be profitable. ASIC manufacturing would need to get cheaper, or the value of XMR would need to skyrocket for people to even consider ASIC mining. As I understand it, Monero's POW requires 2mb to perform hashing, and ASIC ...


5

Mining Blob The mining blob is the block header + merkle root + number of TX-es. It's similar to block identifier as defined in CNS003: Calculation of Block Identifier The identifier of a block is the result of hashing the following data with Keccak: size of [block_header, Merkle root hash, and the number of transactions] in bytes (varint)...


5

cn_slow_hash is CryptoNight. cn_fast_hash is Keccak. As the names imply, the former is much slower than the latter. Both hash a contiguous buffer. Cryptonight is used for PoW and KDF, while Keccak is used for everything else. tree_hash is a merkle tree hasher: it works on a binary tree of hashes, and uses cn_fast_hash for the actual buffer hashing.


5

The keccak1600 function used by Monero is based on Keccak-256 (b=1600, c=512, r=1088 and output of 256 bits, not 1600 bits), but it returns the whole internal state (1600 bits) instead of the first 256 bits of the internal state. The "squeezing phase" present in Keccak.py doesn't appear in Monero's keccak.c file because in this particular case it has no ...


4

If the cryptonight algorithm was replaced with say, sha256, could it be merge mined with bitcoin, for example? That would certainly be possible. The requirements for merged mining basically boil down to (i) having the same PoW algorithm and (ii) miners of both chains agreeing to merge mine. More information about the specifics of merged mining can be ...


4

The correct answer is a combination of what you've read. The maximum number of threads you should ever try to use is the number of CPU cores. Each thread uses 2MB of RAM, so your best performance per-thread will be if you only use your cache size divided by 2MB. In your case, it appears that you get the same answer, 4 threads, either way. Yes, the monerod ...


4

GPU mining configurations often use the cheapest CPU. Thus, your CPU should be powerful enough to work with 3 Rx 480. Yes, PCIE x 1 should work for mining but you have to buy a riser (recommended to use a powered riser). RX 480 draws around 150W (from specification) - 200W. Probably give some more allowance when buying your Power Supply and don't go cheap ...


4

The Monero blockchain is full of test cases: for every block, you can assemble the hashing blob for that block, hash it with your new implementation, and check the resulting hash is below the target for that block. This will be done automatically if you replace monerod's Cryptonight implementation with your own, and try to sync the chain from scratch. ...


4

There's a test code for hash functions (https://github.com/monero-project/monero/tree/master/tests/hash) where the expected values are in the txt files.


Only top voted, non community-wiki answers of a minimum length are eligible