Replace name & use contract data with an ipfs hash#3
Replace name & use contract data with an ipfs hash#3johnbayne wants to merge 1 commit intojsaur:masterfrom
Conversation
| ``` | ||
| [sudo] npm install -g truffle // Version 3.0.5+ required. | ||
| [sudo] npm install -g ethereumjs-testrpc | ||
| [sudo] npm install -g ganache-cli |
There was a problem hiding this comment.
@jsaur what do you think about us defaulting to ganache? seems useful. @johnbayne You've found ganache really useful for getting up to speed, right?
There was a problem hiding this comment.
Sounds good, it seems like there's not much of a difference but that ganache is what truffle is going with now
There was a problem hiding this comment.
@coderintherye @jsaur Yes, absolutely. TestRPC redirects to ganache-cli these days - I think ganache has officially superseded it.
Last week we used ganache as opposed to ganache-cli, the above recommends the CLI. Same backend, less mouseclicks, more portability.
|
|
||
| addNameUseHash (name, use) { | ||
| // TODO: Discuss 'salt' with team. Has pros & cons | ||
| const ipfsData = JSON.stringify({name: name, use: use, salt: Math.random()}) |
There was a problem hiding this comment.
@johnbayne I like this approach, @jsaur what do you think?
Either way agreed that we'll want the IPFS data to be represented in JSON
There was a problem hiding this comment.
Great, glad to hear. We can salt elsewhere down the line, but I wanted to introduce it here to ensure we didn't forget to do so. IPFS sends blocks of identical content to the same hash, so if a borrower put the same use for multiple loans, anyone who had access to the name/use of one loan could see all that borrower's loans that shared the same use.
On one hand, the salt protects against that. On the other, well - it seems slightly overkill. I'm happy either way. :-)
| selenium-debug.log | ||
|
|
||
|
|
||
| build/contracts/ |
Do not merge. Just PRing to share my solution to the weekly coding challenge
This PR replaces the name & use fields in LoanContract.sol with an ipfs hash. That ipfs hash points to a file containing the same name & use data stored on the interplanetary file system.
As currently implemented, the solution provides negligible privacy for name/use data, because the ifpsHash is stored in the public blockchain. Once we decide whether to:
the ipfsHash will obfuscate name/use data from nosey members of the public.
A few other notes:
testrpc's own recommendationsAlso, there are no tests for this code. Probably worth discussing testing strategy at some point.