Skip to content

Instantly share code, notes, and snippets.

@niksmac
Created September 8, 2016 02:14
Show Gist options
  • Select an option

  • Save niksmac/ccd49a016878fc2932dc021349562d38 to your computer and use it in GitHub Desktop.

Select an option

Save niksmac/ccd49a016878fc2932dc021349562d38 to your computer and use it in GitHub Desktop.
  1. Describe why it’s hard to code a random number generator in Ethereum. Summarize a few reasons why most intuitive solutions fail (eg. getting from block number)

  2. Describe an efficient approach to using off-chain data in an ethereum contract that minimizes the amount of trust required.

  3. Create an efficient solidity contract that includes the following functions:

  • sqrt(uint x) that returns the square root of a number to 2 decimal places
  • selectionsort(uint[] x) that uses the selection sort algorithm to return a sorted array
  • factorial(int x): returns the factorial of x using recursion
@niksmac
Copy link
Author

niksmac commented Dec 9, 2016

  1. We can use some decentralised file storage like IPFS to save the big files and keep the ipfshash to keep in the blockchain. Since hash will not change the data integrity will be there.
  • In ethereum there is Swarm Swarm: decentralized storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment