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

add threshold Schnorr examples #903

Merged
merged 40 commits into from
Jun 17, 2024

Conversation

altkdf
Copy link
Contributor

@altkdf altkdf commented Jun 13, 2024

This PR adds a Motoko and Rust example for the use of management canister's threshold Schnorr API: signing and fetching the public key by a third canister. it also shows how such signatures can be verified.

Since the management canister API is not yet implemented for threshold Schnorr, the example canisters use a mock canister that mocks the behavior of management canister for threshold Schnorr in an INSECURE way. This will be removed as soon as the implementation is finished.

@altkdf altkdf requested a review from a team as a code owner June 13, 2024 20:17
@altkdf altkdf requested a review from fspreiss June 13, 2024 20:18
@altkdf altkdf self-assigned this Jun 13, 2024
@ghost
Copy link

ghost commented Jun 13, 2024

hello @altkdf. Please also update CODEOWNERS to reflect the owner of the example. Additionally, please provide a workflow that runs an end to end test. See .github/workflows directory for examples. thanks!

Copy link
Member

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @altkdf! Find some comments attached!

motoko/threshold-schnorr/Makefile Show resolved Hide resolved
motoko/threshold-schnorr/Makefile Outdated Show resolved Hide resolved
rust/threshold-schnorr/package.json Outdated Show resolved Hide resolved
motoko/threshold-schnorr/package.json Outdated Show resolved Hide resolved
rust/threshold-schnorr/src/schnorr_example_rust/src/lib.rs Outdated Show resolved Hide resolved
@altkdf
Copy link
Contributor Author

altkdf commented Jun 14, 2024

hello @altkdf. Please also update CODEOWNERS to reflect the owner of the example. Additionally, please provide a workflow that runs an end to end test. See .github/workflows directory for examples. thanks!

Thanks for pointing out @dfx-json, didn't notice it existed. Done.

@altkdf altkdf requested a review from a user June 14, 2024 16:44
@altkdf
Copy link
Contributor Author

altkdf commented Jun 14, 2024

There's one error remaining, which I encounter myself time to time as well and that is in the linking of the example. I believe this is due to the cdylib crate type and I'm not sure how to solve this. Any suggestions?

unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/runner/work/examples/examples/rust/threshold-schnorr/target/debug/deps/libschnorr_example_rust.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld:/tmp/rustchzKclQ/list:4: syntax error in VERSION script
          collect2: error: ld returned 1 exit status
          

   Compiling pocket-ic v3.1.0
error: could not compile `schnorr_example_rust` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

There's also one related question on stackexchange, but it doesn't seem to have a solution.

Copy link
Member

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @altkdf!

@altkdf altkdf merged commit 6c9e0a6 into dfinity:master Jun 17, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants