json-ld.org icon indicating copy to clipboard operation
json-ld.org copied to clipboard

"Error: [jsig.sign] The data to sign is empty" error from playground in certain cases

Open harlantwood opened this issue 7 years ago • 17 comments

Reproduction:

  1. Load/reload http://json-ld.org/playground/
  2. Click Signed tab
  3. Click Person tab
  4. Click Place tab

Expected: no error message

Actual: on my mac/chrome, I consistently see the error message Error: [jsig.sign] The data to sign is empty. This error may be caused because a "@context" was not supplied in the input which would cause any terms or prefixes to be undefined.

Screenshot:

screenshot 2016-09-21 14 20 42

Note that if I click on the Place tab again, the error goes away.

harlantwood avatar Sep 21 '16 21:09 harlantwood

I wonder whether we should remove the signed tab altogether as this is now handled by a different group.

lanthaler avatar Oct 10 '16 08:10 lanthaler

@lanthaler It's not really handled by a different group now. The Linked Data Signatures work is parked temporarily in the Web Payments CG for now and may transition to the Blockchain CG group. There is no other site where people can try out digitally signing JSON-LD data, so let's not remove it just now. We're currently trying to setup another site for Linked Data Signatures, so give us some time to do that before anyone starts removing digital signature functionality from json-ld.org's playground.

msporny avatar Oct 10 '16 12:10 msporny

I actually plan to create a PR to add another signing mechanism to the playground (with a bitcoin private key), now that https://github.com/digitalbazaar/jsonld-signatures/pull/9 is merged.

harlantwood avatar Oct 10 '16 22:10 harlantwood

Sure, no need to rush the removal.. not sure though we should add more signing mechanisms. People are already confused by the signing operation now (I regularly get questions about this at conferences etc.)

lanthaler avatar Oct 12 '16 19:10 lanthaler

People are already confused by the signing operation now (I regularly get questions about this at conferences etc.)

What sort of confusion are people having wrt. digital signatures on Linked Data?

msporny avatar Oct 12 '16 19:10 msporny

@msporny @lanthaler I won't do the extra work to merge the bitcoin signing functionality with the existing RSA signing functionality until and unless I hear that such a PR is welcome, and likely to be merged.

@gkellogg gave a thumbs up in #431, so inviting him to comment as well.

cc @ChristopherA

harlantwood avatar Oct 14 '16 19:10 harlantwood

I support a PR to merge in bitcoin signing functionality... there's no other place to demonstrate Linked Data Signatures yet. Longer term we should create a Linked Data Signatures playground website and move things over there. We (Digital Bazaar) have a bit of code related to that but aren't ready to put out such a site.

dlongley avatar Oct 14 '16 20:10 dlongley

Arguably, LD Signatures is not JSON-LD specific, and could be done on the raw triples. If another playground for this comes about, that might be a good place for it. Otherwise, adding it to the JSON-LD playground may be the next best thing. Is a payments playground anticipated?

gkellogg avatar Oct 15 '16 13:10 gkellogg

If another playground for this comes about, that might be a good place for it.

We are trying to get around to putting this playground together, @gkellogg. We have something very preliminary here: http://lds.json-ld.org/

However, that's not good enough, we need something more like the JSON-LD Playground for Linked Data Signatures. We'll probably get to it in the next 6-12 months as work on Linked Data Signatures is starting to gain a bit of traction and we're starting to have enough people asking for it that it's getting bumped up a bit on our priority queue.

In the meantime, we didn't want to stop the good work @harlantwood is doing. We'd rather have the Bitcoin signature stuff somewhere publicly accessible and usable than keep it buried in a library. So, +1 for putting it into the JSON-LD Playground now and then moving it out to a Linked Data Signatures playground as soon as we get a half-decent one out there.

msporny avatar Oct 15 '16 18:10 msporny

To respond to the actual issue in this thread - seems like a race condition downloading and caching the remote contexts (that might be why the signature is sporadically failing).

msporny avatar Oct 15 '16 18:10 msporny

People are already confused by the signing operation now (I regularly get questions about this at conferences etc.)

What sort of confusion are people having wrt. digital signatures on Linked Data?

People don't understand the relationship to JSON-LD and can't find much information about it. Others think it is necessary or a core part of JSON-LD and "don't want to touch complex crypto stuff". People that already looked into JSON-LD a bit more are often wondering why it is not available in the JSON-LD processor they use.

lanthaler avatar Oct 19 '16 19:10 lanthaler

People don't understand the relationship to JSON-LD and can't find much information about it.

Here's a shot-term and long-term plan to address this:

In the short term, we have a number of organizations that are waiting for this Bitcoin/Ethereum signatures PR https://github.com/json-ld/json-ld.org/pull/432 to be merged in order to show it off at conferences and to their colleagues.

Not pulling in that PR is preventing some of us from talking about how flexible Linked Data, JSON-LD, and Linked Data Signatures are. Overall, I think it would be good to address this short term need by modifying the playground, even if it does lead to slightly more confusion in the short term (the long-term gains outweigh the confusion, IMHO).

In the long term, we should remove signatures from the JSON-LD playground entirely and move them to a Linked Data Signature playground for the reasons that Markus mentions above. The problem with doing that right now is that we're all pressed for time.

So, concrete proposal:

  1. Accept @harlantwood's PR to add signatures to the JSON-LD playground.
  2. Create a new Linked Data Signatures playground and migrate the signature stuff there once it's ready.

Can we get some :+1: or :-1: on this proposal so we can resolve @harlantwood's PR?

msporny avatar Nov 23 '16 19:11 msporny

+1

ChristopherA avatar Nov 23 '16 21:11 ChristopherA

I added a commit to #432 to remove the "blocking" dependency on https://github.com/digitalbazaar/jsonld-signatures/pull/10 -- we can always do this later. Trying to remove any friction I can.

harlantwood avatar Nov 24 '16 07:11 harlantwood

I've merged the PR in question in this thread due to no downvotes.

msporny avatar Dec 03 '16 18:12 msporny

The PR still doesn't address the race condition issue which was the original issue in this thread. Leaving the thread open until that is resolved.

msporny avatar Dec 03 '16 18:12 msporny

Note that this error also erroneously occurs when @id is set to an empty string ("") and other properties are present to generate triples.

dlongley avatar Apr 18 '17 16:04 dlongley