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

[gh-2295] support bitcoin multisig address #2298

Merged
merged 8 commits into from
Jul 31, 2024
Merged

Conversation

feliciss
Copy link
Collaborator

@feliciss feliciss commented Jul 27, 2024

Copy link

vercel bot commented Jul 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 2:38pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2024 2:38pm

Comment on lines 10 to 11
[.new.base, "parse.base", 1000 * MUL],
[.new.per_byte, "parse.per_byte", 30 * MUL],
Copy link
Contributor

Choose a reason for hiding this comment

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

原来的 gas config 名称写错了,但不能删除。删除会有兼容性问题。可以把原来的保留,直接新增 parse gas config。

另外新增的 gas config 必须是 optional 模式,这样才能兼容。

cc @steelgeek091

Copy link
Collaborator

@steelgeek091 steelgeek091 Jul 29, 2024

Choose a reason for hiding this comment

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

可以参考一下这个 PR 里面的写法 #1892
文件 frameworks/bitcoin-move/src/natives/ord/mod.rs 里面的代码可以参考。
有问题可以在 Discord 讨论。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Create another issue and resolve in that issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 10 to 15
[.verify_bitcoin_address_with_public_key.base, "verify_bitcoin_address_with_public_key.base", 1000 * MUL],
[.verify_bitcoin_address_with_public_key.per_byte, "verify_bitcoin_address_with_public_key.per_byte", 30 * MUL],
[.derive_multisig_xonly_pubkey_from_xonly_pubkeys.base, "derive_multisig_xonly_pubkey_from_xonly_pubkeys.base", 1000 * MUL],
[.derive_multisig_xonly_pubkey_from_xonly_pubkeys.per_byte, "derive_multisig_xonly_pubkey_from_xonly_pubkeys.per_byte", 30 * MUL],
[.derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.base, "derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.base", 1000 * MUL],
[.derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.per_byte, "derive_bitcoin_taproot_address_from_multisig_xonly_pubkey.per_byte", 30 * MUL],
Copy link
Contributor

Choose a reason for hiding this comment

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

这些 gas config 也必须是 optional 的

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Others have to be handled at #2312.

Comment on lines 17 to 22
const E_INVALID_ADDRESS: u64 = 1;
const E_ARG_NOT_VECTOR_U8: u64 = 2;
const E_INVALID_PUBLIC_KEY: u64 = 3;
const E_INVALID_THRESHOLD: u64 = 4;
const E_INVALID_KEY_EGG_CONTEXT: u64 = 5;
const E_INVALID_XONLY_PUBKEY: u64 = 6;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Error as Prefix

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

/// Parse the Bitcoin address string bytes to Move BitcoinAddress
native fun parse(raw_addr: &vector<u8>): BitcoinAddress;
native fun verify_with_pk (addr: &vector<u8>, pk: &vector<u8>): bool;
Copy link
Contributor

Choose a reason for hiding this comment

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

原有的方法不能变,不然无法升级,需要通过新增方法解决。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved.

@feliciss feliciss force-pushed the #2295 branch 2 times, most recently from 6e95ff4 to 394ca1e Compare July 31, 2024 14:10
@feliciss feliciss merged commit c9b7597 into rooch-network:main Jul 31, 2024
7 checks passed
@feliciss feliciss deleted the #2295 branch July 31, 2024 16:21
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.

[Framework] Native function support deriving multi-sign address
3 participants