decentralized-identity / ion

The Identity Overlay Network (ION) is a DID Method implementation using the Sidetree protocol atop Bitcoin
https://identity.foundation/ion
Apache License 2.0
1.23k stars 173 forks source link

Help getting DID published from local node #224

Open lemoustachiste opened 3 years ago

lemoustachiste commented 3 years ago

Hey,

so it's not so much a bug but rather a call for assistance.

I am trying to get a testnet DID published from my local machine's node and resolvable with the DIF universal resolver.

So I followed the steps from https://github.com/decentralized-identity/ion/blob/master/install-guide.md#inbound-ports-to-open, and also from https://docs.ipfs.io/how-to/nat-configuration which essentially says the same thing.

I have opened the ports (4001 > 4003) on my wifi router and redirected them to my machine, port 5001 as per my local IPFS configuration.

Now the one I had created before, but does not seem to exist elsewhere than on my machine (and thus not resolvable in the wild), I can still resolve locally.

I have then generated a new DID document using the same wallet, but this with ports open.

Here is what I see from npm run core:

Handling operation request of size 588 bytes...
Operation type: 'create', DID unique suffix: 'EiClVrnaJFb3t3j2Cl8nrWbuyBWYwNAonktL3d4JIePRUA'

The response to the client:

Successful registration
{"@context":"https://w3id.org/did-resolution/v1","didDocument":{"id":"did:ion:test:EiClVrnaJFb3t3j2Cl8nrWbuyBWYwNAonktL3d4JIePRUA","@context":["https://www.w3.org/ns/did/v1",{"@base":"did:ion:test:EiClVrnaJFb3t3j2Cl8nrWbuyBWYwNAonktL3d4JIePRUA"}],"verificationMethod":[{"id":"#key-1","controller":"","type":"EcdsaSecp256k1VerificationKey2019","publicKeyJwk":{"kty":"EC","crv":"secp256k1","x":"6_JKJIXL7PJQT9hnr03yQNda_fUfmfrcZpymkRqsmH4","y":"steT4D8LrgwmqASd1EMy6ZyyAqsl-KvNlD7rBhX3za8","kid":"_0qG5QVt8vd6pbVGs5ReFJA4-yvYNEi4Ov1HZHTsobM"}}],"authentication":["#key-1"]},"didDocumentMetadata":{"method":{"published":false,"recoveryCommitment":"EiAPFw53a-rGJJyFmKej3VIx38mp0NYSIyI3IiE_fcBEGA","updateCommitment":"EiBhUeY1Dp7saw_9SEH71byDpSA744_YJopJKsDhKCL8wQ"},"canonicalId":"did:ion:test:EiClVrnaJFb3t3j2Cl8nrWbuyBWYwNAonktL3d4JIePRUA"}}

I can then find it from my local machine (localhost:3000/identifiers/did:ion:test:EiClVrnaJFb3t3j2Cl8nrWbuyBWYwNAonktL3d4JIePRUA)

But from the universal resolver, or using the default resolution endpoint from ION I get a 500 or 400 error. Conversely I am not able to resolve a DID that I generated with the default ION endpoint from my local node (i.e: did:ion:EiD67XeFDwOoWM-kHktsm_z5BimilasvRaL1JiHKHdqrOA).

So a list of questions arises:

Thanks

napoleon211092 commented 3 years ago

I also can't create did:ion:test on testnet. It returned did:ion only despite I run testnet.

thehenrytsai commented 3 years ago

"...using the default resolution endpoint from ION I get a 500 or 400 error"

Can you clarify what you mean by "default resolution endpoint from ION?

I notice the DID generated with the default endpoint is not a test DID; does that mean it's a mainnet transaction?

The test prefix is mostly a cosmetic one, the actual payload between the two networks is the same.

is the ion:test method available on the universal resolver?

I am unsure what exactly is the "universal resolver"?

Is there a way to retrieve the tx data of the bitcoin transaction associated with a DID?

Yes, every bitcoin transaction hash is logged at time it is being broadcasted. Also each transaction containing ION operation(s) is recorded in the mongodb's transactions table which contains the block number/hash, anchor string etc which should allow you to find the transaction you are interested in.

Should I be able to see some files on my local IPFS (no files are listed currently)?

You should be able to see some files in your local files system for sure. But if you are viewing via the IPFS web UI, it does not those content, unsure why, I will raise question this with IPFS.

How can I track propagation of a DID to other ION nodes?

Propagation is more of an organic process that no one person can control as per nature of a decentralized system. But you could test to see who in IPFS that you are connected to has any given IPFS file by issuing the following IPFS command:

ipfs dht findprovs <file hash> where the file hash can be simply the "hash portion" of the anchor string found in the transactions table in mongodb.

raiseandfall commented 3 years ago

Thank you for your answers. I'm having the same issue than @napoleon211092.

I am unsure what exactly is the "universal resolver"?

I think @lemoustachiste meant https://dev.uniresolver.io/

lemoustachiste commented 3 years ago

Hi @thehenrytsai,

thanks for getting back to me.

Can you clarify what you mean by "default resolution endpoint from ION?

Sure, I mean this one: https://beta.ion.msidentity.com/api/v1.0. Being called from my local machine, after the DID creation. I assume it does not propagate to the outer world (I am able to resolve it when I call the local API (on :3000).

I am unsure what exactly is the "universal resolver"?

What @raiseandfall said, or this one for that matter: https://resolver.identity.foundation/ (more stable version of previously mentioned). It is also available to run locally (https://github.com/decentralized-identity/universal-resolver). I know that did:ion is available there, but curious about did:ion:test.

Yes, every bitcoin transaction hash is logged at time it is being broadcasted. Also each transaction containing ION operation(s) is recorded in the mongodb's transactions table which contains the block number/hash, anchor string etc which should allow you to find the transaction you are interested in.

Thanks, that's the kind of information I was looking for.

Propagation is more of an organic process that no one person can control as per nature of a decentralized system. But you could test to see who in IPFS that you are connected to has any given IPFS file by issuing the following IPFS command: ipfs dht findprovs where the file hash can be simply the "hash portion" of the anchor string found in the transactions table in mongodb.

Thanks again, I need this guidance as I am little familiar with the internals of IPFS and it's not on my immediate schedule to have time to dedicate to learning, unfortunately.

I'll keep you posted