I couldn’t find much info about it, Does the nodes do all the steps that the miner did to verify the solution? I doubt it since it’s very slow on a CPU. What stop me on creating random solutions without doing the equihash algorithm?
Generally speaking, a hash algorithm, also called a message digest, is a function that takes an input of any length and gives a fixed-length output string, usually expressed in hexadecimal.
The hash function is a one-way function, meaning it’s not possible to get the original input from its hash.
Miners attempt to create a specific hash format by adjusting values like a nonce or even by rearranging the transactions inside a block.
To verify a hash, all we have to do is put the inputs into a hash function, and then the output (digest) should be compared with the hash provided by the miner.
Finding a hash is computationally expensive, while verifying it is not
(I’m not an expert, but I think is more or less correct)
With due respect Please don’t give me an answer from ChatGPT, This is not even close to what I asked.
I have tried asking it from ChatGPT before.
First of all, I’m not using ChatGPT at all.
Just because you used it before, it doesn’t mean I’m doing the same.
Second, if you actually read my answer, it answers exactly what you answered:
The answer is not clear, By hash function what do you exactly mean? If it’s equihash then we do all the steps the miner did? or something else is the input solutions to another hash function? Your answer doesn’t seem to apply to zcash.
Your statement is not possible because equihash 200,9 speed is ~2Sol on normal cpu. And if we just take the soultions hash for verification then what’s the point of using the equihash(We can just generate solutions randomly)?
Now realized someone else also asked the same question:
Is it so hard and complicated that the question is not well received?
Sounds like an exercise in futility but i’m not sure, here’s a write up from a while back about equihash, there are also more forum posts to dig through.
You should know that using the full node to verify blocks is not the equivalent of mining blocks, that’s why the option to mine on zcashd must be set otherwise it’s going to just be a node.
And to an effect you’re really just describing what mining is; it’s just a race to generate solutions for a given block template in hopes that it satisifies. The faster you can make them the more likely it is that you’re going to find it before somebody else.
I read this before nut it doesn’t mention node verification.
The verification part coincides with taking the solution that the miner submitted and then verifying the validity with a lightweight hash function against the Zcash oracle i.e. public parameters generated in the powers of tau or in the plonk untrusted setup or transparently with public key hash, it doesn’t take much computation power at all (this should not be confused with trial decryption which has to do with wallet functionality and private keys, adds more overhead and is off the table here).
Looks like there is a lot more to learn.
Do you recommend any resources for better understanding?
I’ll look around for some:+1:
Here is a current (recent) block and the blockdeltas so you can see better
.
.
john@john-HP-Z400-Workstation:~/zcash/src$ ./zcash-cli -conf=/home/john/zcash.conf getblock 2052850
{
“hash”: “0000000000cf959bdc2cafc39f72afffb9919fd2aec3a7e713d81fbc098834d2”,
“confirmations”: 1,
“size”: 951478,
“height”: 2052850,
“version”: 4,
“merkleroot”: “dcb4f0cc1e61019de9c4acb25d917748ac74224fbadde6c6c2097abc557b2bf9”,
“blockcommitments”: “bbf2fa0c4d76625bee53b9bb8bcb58699f663da9e264298ff469a3598162afaa”,
“authdataroot”: “f4ab5089003db863dafc354cd2de2e098d5819572b8b8eda6f1ebe03f7554642”,
“finalsaplingroot”: “27c9ba8487cb34445a43bb71272df9a04689d1ba2188f43a4268fc662b649302”,
“finalorchardroot”: “2e1abbf8dc342a66131ffb5aff0ef2589968ce4c9bd2a650c80dc62b63aeb036”,
“chainhistoryroot”: “7c3ed4c64b051bec238b1c039c6f332f62646b3f529e43ae6f49eb9ce8b4ca26”,
“tx”: [
“9a331db8336a884318a03e9352dc071fa79072678177f7440416f0ca6b7ea920”,
“ff057974080015e46b433dcbefe5ee1d5e21bc302538153378a58568cadf8b8e”,
“f8ee1e9b902bd32b000d2b6d815caa17ea20c452452f1c28e6bcaf53a7af6d02”,
“71702567d49b1463e03702efa18f4415cef32cef0bfc4e3e514c9c5f39ce0ed0”,
“f0ae7f5c08a677273188fafe124180542e83590872200fef777000381c8be83e”,
“67057333a0f26d9540798a9740f6363cfb4b2a604cc2d13804fb06daaef5f515”,
“d8555d9cd503bbd5b7b130b062582f712f01ce4918fefa288249a7c09caf1106”,
“5d067a851479330dde62ff9f46497f9e0f14c5147f692419ad4082c3ab856ff4”
],
“time”: 1681586768,
“nonce”: “f59b110000000000000000000037000000000000000000000000000030f66d72”,
“solution”: “004e657a230f597bbc94763f917ecb5a5e3fbf297b0be4275a6d5d004975d072f6ab5db93d9a66f1a721018fd1ed9e2fd793e157b29a40a227ffa52c9ee28f23ca5be203cffc2cbfd0f7ca11cf0c565c293d79540413305ec989be6c9d1e111eca3a8fd8ae6430cc1b27d0f315c3648bbd75cbc4fe66bc08917f5718436e0582cba728602ae3c65ed7bc6dddd1ca8cc934b54d1e4592730d1e336725a7b2ec3de17ff95aa6cbf830013ea7857122cfe16bc5a040d9a4c799884870fd6501a3821daf04ca367121d0f905fad372552e75c40926700f89a5b31631f20e7392e87f8171bd70b9a7a253d92597ff1bba4b9fa6868f837784da4037fb36bd0d84c69d08934d5d600ea2b906cec139e4ea39445d2cdb01f37b1d7dd506d40965ffe2d1aeed6c7dbe89120812f692be116ffe31a7a93a783e42e9b67d57a7286865da18233e83d1a2e466cf240595f3e1b0afeb084df572c55be1951bb0b09a1e8bb6bb6a83fea5d13085ef7293ce0299ba1bc57860c1733a693c3ba52a162e751541276c174549d216244358e1dc7472a9d61757d18ad859e8db52e6a3b51be1a598f054f733461ae031234fb7dfafc1a401f626e7dd38db45184bf31c8042c6829157dd442d63f0bcdbf6c9c11776ddd9412c361920d3aa871ed9f8d60c7467a75aeadc6e224ee0179e57a6d19fd962352d5af7994a6f53dbc3920dcd8ee04daafa7dfb8042d6dc38879ac9035934a318abb6d79470f033aebc9451c2b931c142653c7ac9221d34c2f31d466b862c023a2a202601d023f97d0830627c733756421768fe079c7ecc58dac4987848031a111285ba920f8d23e852a69cabff716b4d51c3fe24eb3735860c7713cc7a47fe60fbc7924e8ad28e5620517c8d84928905790af36ed34e3fd9edfc8fc277225d4e026c62e9392a29ed6e597e49ff8a8d5c7e8200b2df9aac415c4d297b555c2a5aa9fa37bc780aba140df56a71dad0590a4bf57ecfacee516deb9cc118107d4413ff65f3c3be7351105e3fa185bd56d8c96620099955fd0bbb4d3cf0664a2b367ff2ab7dfeed4d0d1370bd4665196bfc64922179aaf624e419bffccc42e5be4935123b2320c5e6bed0bbde8a32dddc961c11a6ecf62ea505d7d392b1e0e821bb248f587e77c627b2e401f112d7673d81840d5a39a3cd4d644fe4b20159ad2094a1d3dfcfbf40bcc0125c1573c5d23eab0833d1a8650eba17dcd8620857d5b2a97c11ce8ee21ae8bf79908ba1f50e4722663f58d8114633d603271c30df288d9c3d6500b8c55a18b718996ceb78fbba10dc217282a02b51aba21473d6dc08ed4b7ced93eb1572e43d311726ed018123315b1c7380fb3cc86ae011c80b04438fb7a14249f25eac5e960d111398c844274b5532abd07ccd2496752b972bea12600ad305990296b0cd25b9370fe62d038753c06ee4f1ba0db6b70954992dda63b0ed674c5aa93bfd644b78a29f3788036d5151b59f9201963b30ed89f0a5f049beff82fe0ca55791c9351b2fb8c562f97e72d251a84dd6589c044aaedba2710d8fa0350a4d3eda23730583dfebd517a8eef2afdd56955688458b33d406830a7899cb9c05c6c83e621a31a76e05f242201ea1312b625c541021d47cc6e295ec9d4f7a127c0daa8d89a7661b0f5505e26a11c10a27a176771087bd9de0b13d4432670f0ceb861a3345f99f8bfda22f7947b37623e618faa40f6f8b784b065f8b359230fa3edb78d6956d7c1b46255e96c1c24c83e6fcf2d6592bf6669391a19eb633197f324c3c48e7431f54530debfa4514e62c3af96e5386bc56945f0ee3b61c26f89f662e6639e77b56283517c2db479b0e5754b4e4b47ad37319bf3656bb263d7a4d78a8595eeb2ffb6651d26c7771d92fd163fa”,
“bits”: “1c0188b5”,
“difficulty”: 87494417.2062109,
“chainwork”: “0000000000000000000000000000000000000000000000000d0a824eabb63cbb”,
“anchor”: “6240b94d24ca96f74ee1464007aa51cc749e215f3be257fc06ccd7715b43cbe2”,
“chainSupply”: {
“monitored”: true,
“chainValue”: 13644790.79054480,
“chainValueZat”: 1364479079054480,
“valueDelta”: 3.12500000,
“valueDeltaZat”: 312500000
},
“valuePools”: [
{
“id”: “transparent”,
“monitored”: true,
“chainValue”: 12440934.65328114,
“chainValueZat”: 1244093465328114,
“valueDelta”: 14.24731293,
“valueDeltaZat”: 1424731293
},
{
“id”: “sprout”,
“monitored”: true,
“chainValue”: 26765.73008004,
“chainValueZat”: 2676573008004,
“valueDelta”: 0.00000000,
“valueDeltaZat”: 0
},
{
“id”: “sapling”,
“monitored”: true,
“chainValue”: 1116861.30485344,
“chainValueZat”: 111686130485344,
“valueDelta”: 0.00000000,
“valueDeltaZat”: 0
},
{
“id”: “orchard”,
“monitored”: true,
“chainValue”: 60229.10233018,
“chainValueZat”: 6022910233018,
“valueDelta”: -11.12231293,
“valueDeltaZat”: -1112231293
}
],
“previousblockhash”: “000000000099c7bfa7bc5fc4ec69f3bec552e2d5ebbd0bd5df681810102498e8”
}
.
.
john@john-HP-Z400-Workstation:~/zcash/src$ ./zcash-cli -conf=/home/john/zcash.conf getblockdeltas ‘“0000000000cf959bdc2cafc39f72afffb9919fd2aec3a7e713d81fbc098834d2”’
{
“hash”: “0000000000cf959bdc2cafc39f72afffb9919fd2aec3a7e713d81fbc098834d2”,
“confirmations”: 1,
“size”: 951478,
“height”: 2052850,
“version”: 4,
“merkleroot”: “dcb4f0cc1e61019de9c4acb25d917748ac74224fbadde6c6c2097abc557b2bf9”,
“deltas”: [
{
“txid”: “9a331db8336a884318a03e9352dc071fa79072678177f7440416f0ca6b7ea920”,
“index”: 0,
“inputs”: [
],
“outputs”: [
{
“address”: “t1at7nVNsv6taLRrNRvnQdtfLNRDfsGc3Ak”,
“satoshis”: 250005986,
“index”: 0
},
{
“address”: “t3XyYW8yBFRuMnfvm5KLGFbEVz25kckZXym”,
“satoshis”: 25000000,
“index”: 1
},
{
“address”: “t3dvVE3SQEi7kqNzwrfNePxZ1d4hUyztBA1”,
“satoshis”: 15625000,
“index”: 2
},
{
“address”: “t3gkDUe9Gm4GGpjMk86TiJZqhztBVMiUSSA”,
“satoshis”: 21875000,
“index”: 3
}
]
},
{
“txid”: “ff057974080015e46b433dcbefe5ee1d5e21bc302538153378a58568cadf8b8e”,
“index”: 1,
“inputs”: [
],
“outputs”: [
{
“address”: “t1aip2moYgZZgfRYQQLRCmmrpoZaARrKuD8”,
“satoshis”: 3823100000,
“index”: 0
}
]
},
{
“txid”: “f8ee1e9b902bd32b000d2b6d815caa17ea20c452452f1c28e6bcaf53a7af6d02”,
“index”: 2,
“inputs”: [
{
“address”: “t1MWnpCPVtVKTmqh3DRj2pd4UZrF9z13UiB”,
“satoshis”: -1708726707,
“index”: 0,
“prevtxid”: “9eec2b681dc473d2f4765372bea1789710bf0e2e0cb7a5304bb44eeaa82fcba2”,
“prevout”: 0
}
],
“outputs”: [
]
},
{
“txid”: “71702567d49b1463e03702efa18f4415cef32cef0bfc4e3e514c9c5f39ce0ed0”,
“index”: 3,
“inputs”: [
{
“address”: “t1S73G4WtFCeVbvaoFkfVgJ9KaBjGtjdtvX”,
“satoshis”: -1002147000,
“index”: 0,
“prevtxid”: “b5310cacc22b9d7cc98a686e5556d3dffca26f2e4e519c2b45c378db1be0dc87”,
“prevout”: 0
}
],
“outputs”: [
]
},
{
“txid”: “f0ae7f5c08a677273188fafe124180542e83590872200fef777000381c8be83e”,
“index”: 4,
“inputs”: [
],
“outputs”: [
]
},
{
“txid”: “67057333a0f26d9540798a9740f6363cfb4b2a604cc2d13804fb06daaef5f515”,
“index”: 5,
“inputs”: [
],
“outputs”: [
]
},
{
“txid”: “d8555d9cd503bbd5b7b130b062582f712f01ce4918fefa288249a7c09caf1106”,
“index”: 6,
“inputs”: [
{
“address”: “t1YxywuYAidkE5TjXS2KLAc5THAH6gQaUci”,
“satoshis”: -1562996160,
“index”: 0,
“prevtxid”: “e6a730da11ceb04ba5480d87debabbf148210c3033b0d59c4ee03a8cc6212758”,
“prevout”: 0
}
],
“outputs”: [
{
“address”: “t1YQV51DKzKP63xJcynXuRfryMjfmgTJ7Jc”,
“satoshis”: 1562995975,
“index”: 0
}
]
},
{
“txid”: “5d067a851479330dde62ff9f46497f9e0f14c5147f692419ad4082c3ab856ff4”,
“index”: 7,
“inputs”: [
{
“address”: “t1aZB96BZe1EeMZArCLA6hZ9ZWKPZNeCYkU”,
“satoshis”: -100,
“index”: 0,
“prevtxid”: “e41a8acbf824274f039f28c8470069e7c520f9a5ef947267bc4897ef1e88d6bf”,
“prevout”: 50
},
{
“address”: “t1V2zFeyJFJ2Mu5tfrzPvS68fFtdQ7PY2R7”,
“satoshis”: -6380,
“index”: 1,
“prevtxid”: “21f08f0739e73a51db0a2e0c9dd275d4dceac10a5b8608741145eab5f9c5d25a”,
“prevout”: 38
},
{
“address”: “t1f6n6TYZWNpm43iMxBHASGHbyyZ1JmJywX”,
“satoshis”: -258437,
“index”: 2,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 4
},
{
“address”: “t1PEKgstY5fhv3fEfcpH1s3Wb8pfCYzMp2k”,
“satoshis”: -767880,
“index”: 3,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 26
},
{
“address”: “t1Xbgebd4TSSyUBv7k8JXwR2dmgiJTH86VJ”,
“satoshis”: -1307337,
“index”: 4,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 29
}
],
“outputs”: [
{
“address”: “t1RLijEmezD9DFFQUMcJRQxi738D3z4BP6U”,
“satoshis”: 2339333,
“index”: 0
}
]
}
],
“time”: 1681586768,
“mediantime”: 1681586379,
“nonce”: “f59b110000000000000000000037000000000000000000000000000030f66d72”,
“bits”: “1c0188b5”,
“difficulty”: 87494417.2062109,
“chainwork”: “0000000000000000000000000000000000000000000000000d0a824eabb63cbb”,
“previousblockhash”: “000000000099c7bfa7bc5fc4ec69f3bec552e2d5ebbd0bd5df681810102498e8”
}
Nodes can verify Equihash solutions without having to run the memory-hard algorithm that miners use to find the solutions.
Simplifying a bit, an Equihash solution is basically a special kind of collision between multiple hash functions. The algorithm miners use to find those “multi-collisions” needs a lot of memory and time. However, once a multi-collision has been found, it can be verified without using as much memory, by just hashing the values and checking that they collide. So it’s expensive to solve, but cheap to verify.
The reason you can’t circumvent the memory-hard algorithm for finding the solutions is because that algorithm is (approximately) the fastest known way to find the solutions. You can make some optimizations and time-vs-memory trade-offs, but there is no way to circumvent the hard work it takes to find the solutions.