[SOLVED] Unsupported CACAO signature type

Hi guys, I’m recently seeing this when creating a Tile: “Error: HTTP request to ‘https://ceramic-clay.3boxlabs.com/api/v0/streams’ failed with status ‘Internal Server Error’: {“error”:“Unsupported CACAO signature type”}” I’m using the latest from DID Session - Ceramic Developers

k, I might be reading this wrong, but I think the problem was introduced in this pull request: Add SIWS to Cacao and some tests by haardikk21 · Pull Request #12 · ceramicnetwork/cacao · GitHub the ‘caip122’ header type was introduced, but the conditions on the verify function were not updated: cacao/cacao.ts at c792f1b89c62ac44c12bfb3e9c23904f88876325 · ceramicnetwork/cacao · GitHub @haardik.eth does this ring a bell?


Thanks for filing this issue here.

Do me a couple of favours and please share the following information:

  1. Exact version of did-session package being used - inspect your node_modules/@glazed/did-session/package.json file and share the version property
  2. Exact version of ceramic-cacao package being used - node_modules/ceramic-cacao/package.json
  3. If you can, try to log the Cacao object being sent over to the Clay API when you are creating your Tile.


P.S. Here’s my internal thought process so far

Cacao was expanded to support SIWx instead of just SIWE, and as a result the header type of Cacao’s was updated from eip4361 to caip122 This upgrade came with a bump from the Cacao library from 1.1.1 to 1.2.1 . It also updated a verification condition which changed as such:

- if (cacao.h.t === "eip4361" && cacao.s?.t === "eip191") {...}
+ if (cacao.s?.t === "eip191") {...}

Shortly after, due to us noticing some bugs, we tagged the version 1.2.1 to be @next as it was breaking certain existing apps, and we had to do more thinking around how to include backward compatibility.

You’re saying you’re getting an error Unsupported CACAO signature type when trying to create a Tile using did-session

did-session and js-ceramic both use Cacao ^1.1.1

If a Cacao was created using 1.2.1 and then attempt to being verified within version 1.1.1 - it would cause a problem due to the if condition changes I mentioned above, and thereby fallback to the Error he is mentioning.

I do not see why a Cacao created using 1.1.1 (with Header type eip4361 ) would cause an error being verified with 1.2.1 - since we don’t care about the header in the Verification code at that point.

If I learn any more details about this, I will share with you ASAP. Would be extremely helpful to get the information I asked for above from you.

Thanks for the clue! the latest versions of the packages seem to be installing ceramic-cacao 1.2.1 as a dependency, so I had to manually force to 1.1.1 like this:

yarn upgrade ceramic-cacao@1.1.1

After that the problem is gone,

1 Like