Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Cardano Lock #10

Merged
merged 17 commits into from
Jun 13, 2023
Merged

Cardano Lock #10

merged 17 commits into from
Jun 13, 2023

Conversation

joii2020
Copy link
Contributor

Support cardano lock.

@joii2020 joii2020 requested a review from XuJiandong May 30, 2023 01:51
c/auth.c Outdated Show resolved Hide resolved
c/auth.c Outdated Show resolved Hide resolved
@joii2020 joii2020 requested a review from contrun May 31, 2023 09:04
CardanoDemo_OutputCapacityLen,
} CardanoDemoErr;

int check_costom_data(const uint8_t *data, size_t data_len) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

'costom` typo.

docs/cardano_lock.md Show resolved Hide resolved
* ```cardano_tx.signed.json``` is signatured

Then, use the public key in cardano-success to verify the data.
Verify uses the same library(cardano_serialization_lib) as the signature data witness into the script, so that it can be indirectly verified to be compatible with the official.
Copy link
Collaborator

Choose a reason for hiding this comment

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

How to verify? Write down the steps.

docs/cardano_lock.md Show resolved Hide resolved
--cold-signing-key-file test_data/cold.skey.json \
--operational-certificate-issue-counter-file test_data/cold.counter.json
```
2. Use get-sign-hash to generate hash. (tests/cardano_lock/src/bin/get-sign-hash.rs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add build script and command line example for this step.

--mainnet \
--out-file test_data/cardano_tx.signed.json
```
4. Pass the whole cborHex in the output json as the witnesses of ckb-auth.
Copy link
Collaborator

Choose a reason for hiding this comment

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

How to verify?


pub fn run_auth_exec(algorithm_id: AlgorithmType, pubkey_hash: &[u8], message: &[u8], sign: &[u8]) {
let args = format!(
"{}:{:02X?}:{:02X?}:{}:{}:{}",
Copy link
Contributor

Choose a reason for hiding this comment

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

The point of ckb-auth is that it can use signatures generated by other blockchain wallet and then use this signature to verify the validity of some transaction. I think here we just verify that a signature is valid, but the message of that signature is not related to any transaction. Maybe we need to generate a valid transaction, then sign a message related to that transaction and finally verify this signature is valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think ckb-auth-cli is just meant to demonstrate the availability of a certain authentication feature. If a complete test is conducted, I believe you can review the test cases (tests/cardano_lock/Makefile).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ckb-auth-cli will add more contracts in the future, so I created a new project for it.

@@ -0,0 +1,84 @@
mod auth_script;
Copy link
Contributor

Choose a reason for hiding this comment

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

I also created a command line client for ckb-auth in #14 . We should join the force.

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

Successfully merging this pull request may close these issues.

3 participants