Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cannot serialize Attestation and Secrets from NotarizationOutputs #598

Open
0xtsukino opened this issue Sep 20, 2024 · 4 comments
Open
Milestone

Comments

@0xtsukino
Copy link
Collaborator

https://github.com/tlsnotary/tlsn/blob/dev/crates/wasm/src/prover/mod.rs#L138-L141

For some reason a json object is returned here instead of a serializable class

Screenshot 2024-09-20 at 4 15 24 PM

@0xtsukino 0xtsukino added this to the Alpha7 milestone Sep 20, 2024
@heeckhau
Copy link
Member

Are you sure it is json? tsify did create an interface NotarizationOutput automatically:
https://github.com/tlsnotary/tlsn-js/blob/cdd70e365e14bc12eec9cb5bbc68563ae5b83f34/wasm/pkg/tlsn_wasm.d.ts#L85 ?

@sinui0
Copy link
Member

sinui0 commented Sep 20, 2024

My intention was for you to move the attestation and secrets out and serialize them separately

@0xtsukino
Copy link
Collaborator Author

Are you sure it is json? tsify did create an interface NotarizationOutput automatically: https://github.com/tlsnotary/tlsn-js/blob/cdd70e365e14bc12eec9cb5bbc68563ae5b83f34/wasm/pkg/tlsn_wasm.d.ts#L85 ?

Yep, you can try running the react demo example in tlsn-js alpha7 branch

My intention was for you to move the attestation and secrets out and serialize them separately

I want to serialize them separately too, but the output is a json object, and both Attestation and Secrets doesn't have a method that allows me to serialize them from json

@0xtsukino
Copy link
Collaborator Author

for more context, i am trying to serialize them here: https://github.com/tlsnotary/tlsn-js/pull/67/files#diff-e59662795ab51f95e1bf2a44d30dd0debbc194a499adffd1bb6a197bd188d4b5R233-R236

const output = await prover.notarize(commit);

return {
  attestation: output.attestation.serialize(),
  secrets: output.secrets.serialize(),
};

for whatever reason, the output from notarize didn't return Attestation and Secrets as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants