decentralized-identity / sidetree-ethereum Goto Github PK
View Code? Open in Web Editor NEWBlockchain-specific code for the Sidetree-based DID Method implementation on Ethereum
Blockchain-specific code for the Sidetree-based DID Method implementation on Ethereum
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(func, FILE, LINE, #e) : (void)0)
^
2 warnings and 5 errors generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
nextIndex
that indicates where in the array to write the next AFHNot doing yet:
The smart contract containing all the anchors will live on the Ethereum main net. We want to ensure only valid actors are able to update the state of the contract. This could involve staking ether that releases back to the owner over time, to insure good behavior. There are other options too.
The purpose of this ticket is to discuss the implementation, and we can then create an issue for the implementation work required.
Given a passed in request body, generate a DID of the form did:side-eth:xyz
where xyz
is the hash of the passed in request body. This function should return the generated DID
This ticket is for the service function, not the API route.
Since this may be the first API, this will have a lot of other subtasks including:
We should encapsulate the IPFS interface within a module. The interface should expose methods that allow a caller to:
Create a truffle project, add the .gitignore, basic README and get the project going
Here are some issues I found with the EthDIDAnchor contract:
anchorHash
and ipfsHash
It's not clear why we need both anchorHash
and ipfsHash
and what the relationship between them are. The implementation spec in the sidetree-core
repo specifies the use of an "anchor file hash" that represents the hash of the file containing the batch of sidetree operations. It seems that we can just use one anchorFileHash
in the transactions
array.
Anyone can call the function newAnchorHash
with an existing _anchorHash
and an arbitrary _ipfsHash
. This overwrites the previous mapping in the anchors
map. I'm not sure about the functionality of the two hashes (see above) but this is probably not the intended functionality.
The sidetree-core spec requires that the anchor file hash be recorded together with a transaction number (which is included here) as well as a transactionTime
, which can be a block number. To remedy this another array blocknumber
can be introduced where the blocknumber can be stored indexed by the transaction number.
Since we are not expecting that the data here should be readable by smart contracts on-chain we could log the data only as an Event (like what is done with AnchorHashCreated
). This will avoid some unneccessary on-chain state but will still give strong guarantees about the data.
A downside of this optimization is that it is more cumbersome to read the data since it's not all available in the latest state database. The whole blockchain will need to be traversed sequentially.
ipfsHash
and the anchors
mappingThis is not needed in order to be compliant with the sidetree-core spec. Only one hash is needed.
Add an array blocknumbers
to map transaction numbers to block numbers in order to be able to get block numbers along with anchor file hashes.
If we want to do this optimization we may remove all on-chain data except transactionNumber and use an Event to store the following data: anchor file hash, transaction number, block number (block number may be reconstructed later so may can probably be omitted).
What does ./env file here means?
Related to decentralized-identity/sidetree#37
We want to be able to fetch batches by their corresponding transaction numbers. Each batch added to the smart contract will have a transaction number, starting at 1 and incrementing by 1 for each added batch.
Sample response: https://github.com/decentralized-identity/sidetree-core/blob/master/docs/implementation.md#response-body-example
An open question is how many transactions in addition to this one do we want to return? The spec keeps this open. It would help to understand how this is intended to be used. If it's for paginating through all transactions, then returning 10 (or more) makes sense, or having that be another request parameter.
@thehenrytsai thoughts?
We'll need to persist the transaction number for each batch. We'll prob need another mapping to track this, smth like:
transactions[transactionNumber - 1] = ipfsHash
// and since we're currently setting the `anchors` mapping(hash) to a boolean, we could set it to the txNumber instead
anchors[ipfsHash] = transactionNumber
Given a passed in request body, revoke a key from a given DID.
The tests should handle the case where the given DID can not be found.
This ticket is for the service function, not the API route.
Given a passed in DID, return the latest version of its corresponding DID document.
I am trying to run sidetree on top of ethereum,but seems this repo is no longer used.
Where should I start for sidetree + ethereum?
Specifically, how does sidetree-based DID method differ from ERC-725 and ERC-735 implementation? I am working on ERC725 and ERC 735 and am exploring how DID identifiers can be related vis-a-vis Ethereum.
We need a repo similar to https://github.com/decentralized-identity/ion
which uses core, ipfs and ethereum sidetree repos, and can be used to test integration.
Given a passed in request body for an existing DID, update the DID's document. Example update would be to add an additional key.
The tests should cover the case where the passed in DID can not be found.
This ticket is for the service function, not the API route.
Look into adding Koa or Express for the API route handling. Koa is used in sidetree-core
so it may be helpful to keep in sync with that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.