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

[Framework] Native function support deriving multi-sign address #2295

Closed
jolestar opened this issue Jul 26, 2024 · 4 comments · Fixed by #2298
Closed

[Framework] Native function support deriving multi-sign address #2295

jolestar opened this issue Jul 26, 2024 · 4 comments · Fixed by #2298
Assignees
Labels
area::bitcoin area:stdlib Move stdlib or framework issues skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue
Milestone

Comments

@jolestar
Copy link
Contributor

jolestar commented Jul 26, 2024

rooch_framework::bitcoin_address{
  public native fun verify_bitcoin_address_with_public_key(addr: &BitcoinAddress, pk: &vector<u8>): bool;
  public native fun derive_taproot_multisign_public_key(public_keys: &vector<vector<u8>>, threshold: u64): vector<u8>;
    public native fun derive_taproot_address(taproot_public_key: &vector<u8>): BitcoinAddress;
}

#2294

@jolestar jolestar added skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue area:stdlib Move stdlib or framework issues area::bitcoin labels Jul 26, 2024
@jolestar jolestar added this to the Rooch v0.7 milestone Jul 26, 2024
@feliciss
Copy link
Collaborator

feliciss commented Jul 26, 2024

  public native fun verify_bitcoin_address_with_public_key(addr: &BitcoinAddress, pk: &vector<u8>): bool;

Secp256k1 public key can be converted to bitcoin p2tr and p2pkh. Should it be handled for all cases or just p2tr and p2pkh addresses from the public key bytes?

@feliciss
Copy link
Collaborator

feliciss commented Jul 26, 2024

  public native fun verify_bitcoin_address_with_public_key(addr: &BitcoinAddress, pk: &vector<u8>): bool;

Secp256k1 public key can be converted to bitcoin p2tr and p2pkh. Should it be handled for all cases or just p2tr and p2pkh addresses from the public key bytes?

To verify it, convert the pk bytes to the bitcoin address (address type unknown at the time) and check if it's the same address with the first addr param.

feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 27, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 27, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 27, 2024
@jolestar
Copy link
Contributor Author

The native function definition is changed. #2294

@feliciss
Copy link
Collaborator

The native function definition is changed. #2294

I will change it to derive_taproot_multisig_public_key instead of multisign as I will use multisig2 rust lib to achieve this feature.

feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 29, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
…eys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss pushed a commit to feliciss/rooch that referenced this issue Jul 31, 2024
feliciss added a commit that referenced this issue Jul 31, 2024
* [gh-2295] from verify_with_pk to verify_bitcoin_address_with_public_key.

* [gh-2295] add derive_multi_sign_address.

* [gh-2295] add derive_multisig_xonly_pubkey_from_public_keys and derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.

* [gh-2295] add functions of multisig xonly pubkeys.

* [gh-2295] roolback from parse to new.

* [gh-2295] make the newly added functions optional.

* [gh-2295] fix move args.

* [gh-2295] add tests and leave function unchanged.

---------

Co-authored-by: Feliciss <10203-feliciss@users.noreply.0xacab.org>
@github-project-automation github-project-automation bot moved this to Done in Rooch Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::bitcoin area:stdlib Move stdlib or framework issues skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants