# How does equihash verify the solution?

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?

1 Like

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)

1 Like

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.

1 Like

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.

1 Like

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.

1 Like

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)?

1 Like

Now realized someone else also asked the same question:

Is it so hard and complicated that the question is not well received?

1 Like

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.

2 Likes

I read this before nut it doesn’t mention node verification.

1 Like

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).

1 Like

Looks like there is a lot more to learn.
Do you recommend any resources for better understanding?

2 Likes

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,
“blockcommitments”: “bbf2fa0c4d76625bee53b9bb8bcb58699f663da9e264298ff469a3598162afaa”,
“authdataroot”: “f4ab5089003db863dafc354cd2de2e098d5819572b8b8eda6f1ebe03f7554642”,
“finalsaplingroot”: “27c9ba8487cb34445a43bb71272df9a04689d1ba2188f43a4268fc662b649302”,
“finalorchardroot”: “2e1abbf8dc342a66131ffb5aff0ef2589968ce4c9bd2a650c80dc62b63aeb036”,
“chainhistoryroot”: “7c3ed4c64b051bec238b1c039c6f332f62646b3f529e43ae6f49eb9ce8b4ca26”,
“tx”: [
“9a331db8336a884318a03e9352dc071fa79072678177f7440416f0ca6b7ea920”,
“f8ee1e9b902bd32b000d2b6d815caa17ea20c452452f1c28e6bcaf53a7af6d02”,
“71702567d49b1463e03702efa18f4415cef32cef0bfc4e3e514c9c5f39ce0ed0”,
“f0ae7f5c08a677273188fafe124180542e83590872200fef777000381c8be83e”,
“67057333a0f26d9540798a9740f6363cfb4b2a604cc2d13804fb06daaef5f515”,
“d8555d9cd503bbd5b7b130b062582f712f01ce4918fefa288249a7c09caf1106”,
],
“time”: 1681586768,
“nonce”: “f59b110000000000000000000037000000000000000000000000000030f66d72”,
“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,
“deltas”: [
{
“txid”: “9a331db8336a884318a03e9352dc071fa79072678177f7440416f0ca6b7ea920”,
“index”: 0,
“inputs”: [
],
“outputs”: [
{
“satoshis”: 250005986,
“index”: 0
},
{
“satoshis”: 25000000,
“index”: 1
},
{
“satoshis”: 15625000,
“index”: 2
},
{
“satoshis”: 21875000,
“index”: 3
}
]
},
{
“index”: 1,
“inputs”: [
],
“outputs”: [
{
“satoshis”: 3823100000,
“index”: 0
}
]
},
{
“txid”: “f8ee1e9b902bd32b000d2b6d815caa17ea20c452452f1c28e6bcaf53a7af6d02”,
“index”: 2,
“inputs”: [
{
“satoshis”: -1708726707,
“index”: 0,
“prevtxid”: “9eec2b681dc473d2f4765372bea1789710bf0e2e0cb7a5304bb44eeaa82fcba2”,
“prevout”: 0
}
],
“outputs”: [
]
},
{
“txid”: “71702567d49b1463e03702efa18f4415cef32cef0bfc4e3e514c9c5f39ce0ed0”,
“index”: 3,
“inputs”: [
{
“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”: [
{
“satoshis”: -1562996160,
“index”: 0,
“prevtxid”: “e6a730da11ceb04ba5480d87debabbf148210c3033b0d59c4ee03a8cc6212758”,
“prevout”: 0
}
],
“outputs”: [
{
“satoshis”: 1562995975,
“index”: 0
}
]
},
{
“index”: 7,
“inputs”: [
{
“satoshis”: -100,
“index”: 0,
“prevtxid”: “e41a8acbf824274f039f28c8470069e7c520f9a5ef947267bc4897ef1e88d6bf”,
“prevout”: 50
},
{
“satoshis”: -6380,
“index”: 1,
“prevtxid”: “21f08f0739e73a51db0a2e0c9dd275d4dceac10a5b8608741145eab5f9c5d25a”,
“prevout”: 38
},
{
“satoshis”: -258437,
“index”: 2,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 4
},
{
“satoshis”: -767880,
“index”: 3,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 26
},
{
“satoshis”: -1307337,
“index”: 4,
“prevtxid”: “1244cbf1eee91fd5971e56051cc7a9b631760bda61d795a64221e98ae8648bc0”,
“prevout”: 29
}
],
“outputs”: [
{
“satoshis”: 2339333,
“index”: 0
}
]
}
],
“time”: 1681586768,
“mediantime”: 1681586379,
“nonce”: “f59b110000000000000000000037000000000000000000000000000030f66d72”,
“bits”: “1c0188b5”,
“difficulty”: 87494417.2062109,
“chainwork”: “0000000000000000000000000000000000000000000000000d0a824eabb63cbb”,
“previousblockhash”: “000000000099c7bfa7bc5fc4ec69f3bec552e2d5ebbd0bd5df681810102498e8”
}

1 Like

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.