Skip to content

expose multisig functions#785

Open
maidh91 wants to merge 1 commit intomainfrom
expose-multisig-fn
Open

expose multisig functions#785
maidh91 wants to merge 1 commit intomainfrom
expose-multisig-fn

Conversation

@maidh91
Copy link

@maidh91 maidh91 commented Mar 12, 2026

@maidh91 maidh91 requested a review from lejeunerenard March 12, 2026 10:58
@maidh91 maidh91 force-pushed the expose-multisig-fn branch from 883ce5d to 62aa64b Compare March 12, 2026 22:34
Copy link
Contributor

@lejeunerenard lejeunerenard left a comment

Choose a reason for hiding this comment

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

I think the exports method for exports from lib/multisig.js makes more sense. The methods are currently used externally via the requiring lib/multisig.js and so adding the module via exports fits better.

Also made a note that the core verifier should be used instead of assemble() directly to account for whether the core is a compat core.

return Replicator.clearRequests(session, err)
}

static assemble = assemble
Copy link
Contributor

Choose a reason for hiding this comment

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

The Verifier.assemble() is what you want instead and is accessible via the core.core.verifier property. This is because cores can be an old compat which used a different assemble method for assembling proofs & patches. The main place that we use multisig (besides hyper-multisig) is autobase where we use the verifier.

Assembling is core specific and can be done via the verifier, so there is no need for a static method in my view.

Copy link
Author

@maidh91 maidh91 Mar 16, 2026

Choose a reason for hiding this comment

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

thanks @lejeunerenard, I will check carefullly the verifier again (it's been running ok so far for ages)

for the export convention, in hyper-multisig repo, we are importing like this, and we want to avoid this pattern (should require('hypercore') only)

const { assemble, partialSignature } = require('hypercore/lib/multisig')

https://github.com/holepunchto/hyper-multisig/blob/dc8477095477c0ff9aa00f23ce905428a748284c/lib/util.js#L23

cc @HDegroote

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