I want to verify the pow of memory of one computer, then I use the ethash
algorithm that used by ethereum
to do the work. The problem is that the cache and dataset in the algorithm is too large for contracts. How can I verify the work?
In my opinion, the block number and account address and the nonce should pass to the contract, then contract verify it.
Or is there any other way memory base algorithm to prove one computer's memory? Thanks.
I'd like to change the structure vm.Context,
type Context struct {
// CanTransfer returns whether the account contains
// sufficient ether to transfer the value
CanTransfer CanTransferFunc
// Transfer transfers ether from one account to the other
Transfer TransferFunc
// GetHash returns the hash corresponding to n
GetHash GetHashFunc
// VerifyMemoryDifficulty return true if the given nonce is valid
VerifyMemoryDifficulty VerifyMemoryDifficultyFunc
// .......
// Difficulty *big.Int // Provides information for DIFFICULTY
}
VerifyMemoryDifficultyFunc func(*big.Int)
But, when I call it in my solidity, it returns error:
Error: Different number of arguments in return statement than in returns declaration.
return block.difficulty(99);
^-------------------------^
It seems that the the solidity was checked error by compiler, my question is that what should i do, if i want to modify existing opcode with some parameters passed in?