Skip to content

Conversation

@Scitz0
Copy link
Contributor

@Scitz0 Scitz0 commented Jan 23, 2025

A new CIP for multi-signatures wallet registration and discovery handling. CIP-1854 describes the meat of multisig (native scripts) but leaves some areas in the peripheral untouched.

Metadatum label 1854 is also added to the CIP-10 registry.


Rendered Proposal

@Ryun1 Ryun1 added the Category: Wallets Proposals belonging to the 'Wallets' category. label Jan 23, 2025
@rphair rphair added the State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction. label Jan 23, 2025
nathanbogale added a commit to input-output-hk/catalyst-CIPs that referenced this pull request Jan 23, 2025
@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 4, 2025

Thanks @Crypto2099 for raising the potential issue at today's CIP editors meeting.

To quickly describe the issue mentioned, we (Eternl) are adding multi-sig (native script) support to our upcoming v2 release. With this, we created this specification (harmonization between wallets/dapps) for how you can pre-announce this native script using the aux data field in tx together with metadata. This was the intention of the field in CDDL as described by CIP-1854. Each participant in the multi-sig somehow needs to know about the script, either through public or offline sharing. The discovery process described in CIP draft looks for TXs containing metadata with label 1854 and native scripts that contain the user's multi-sig key cred.

The problem as mentioned by Adam is that some malicious user could look for these registration transactions and post their own, mimicking the real one but with a modified script that would allow them to drain the native script without the other participant's involvement. When the participant tries to discover multi-sig wallets that include his multi-sig key cred, they would find both the invalid (scam) wallet in addition to the real one, and might add and fund the wrong one.

Is it a problem in real life 🤷‍♂️ ... but it's sort of similar to the scam tokens we have seen sent around. There isn't much you can do about those except be vigilant and educate yourself that scammers exist and what methods they use.

The only solution I can currently think of is that a multi-sig key (cred) can only be used/registered once. All subsequent registrations would need to use the next key index. Thus a scammer could not replay a posted registration re-using an existing key cred. It complicates handling and syncing but currently the only thing I can think of to mitigate this issue. The other solution would be to acknowledge that it's a potential issue we need to educate users about.

Feel free to add other potential solutions to the problem.

@rphair rphair changed the title CIP-???? | Multi-signatures wallet registration and discovery CIP-0146? | Multi-signatures wallet registration and discovery Feb 4, 2025
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

@Scitz0 we agreed at today's CIP meeting to assign this a CIP number regardless of how the issue mentioned in #971 (comment) may progress.

Please rename the proposal directory to CIP-0146 and update the proposal link in the first comment above. 🎉

@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 6, 2025

Updates pushed according to the above-proposed solution for mitigation against attack vector on public multisig wallet registration. It also contains changes to metadata format and various tweaks to improve the standard.

@rphair rphair added State: Confirmed Candiate with CIP number (new PR) or update under review. and removed State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction. labels Feb 17, 2025
@QSchlegel
Copy link

Brief comment on Registration could you change to off Chain sharing instead of offline as we expect most pre- registrations to be shared online but off Chain, rather than offline.

Best Regards
QS

@QSchlegel
Copy link

Also what do you think about using CIP-0083 (encrypted message metadata) for a pre-registration tx to each potential wallet member.

Downside only works if member wallet addresses are known pre-registration.

To much chain bloat?

Or is this out of scope for CIP-0146?

@rphair
Copy link
Collaborator

rphair commented Feb 23, 2025

@Scitz0 #971 (comment): Feel free to add other potential solutions to the problem.

@QSchlegel #971 (comment): what do you think about using CIP-0083 (encrypted message metadata) for a pre-registration tx to each potential wallet member.

It sounds like this could be one solution (assuming those addresses are known in advance)... @Scitz0 can you confirm or refute?

@Scitz0 Scitz0 closed this Feb 24, 2025
@Scitz0 Scitz0 reopened this Feb 24, 2025
@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 24, 2025

Clicked the wrong button 😆

@gitmachtl
Copy link
Contributor

How about adding another scope to CIP88? Like we did in the CIP88v2 for Pool-Daily-Key Registration?

@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 24, 2025

@Scitz0 #971 (comment): Feel free to add other potential solutions to the problem.

@QSchlegel #971 (comment): what do you think about using CIP-0083 (encrypted message metadata) for a pre-registration tx to each potential wallet member.

It sounds like this could be one solution (assuming those addresses are known in advance)... @Scitz0 can you confirm or refute?

Encrypted metadata wouldn't solve issue with replay of multisig wallet registration. The only solution I can see is by rotating keys as currently described in CIP.
AUX data CDDL for conway look like this:

;               metadata: shelley
;   transaction_metadata: shelley-ma
; #6.259(0 ==> metadata): alonzo onwards
; 
auxiliary_data = metadata
                  / [transaction_metadata : metadata
                    , auxiliary_scripts : [* native_script]]
                  / #6.259({? 0 : metadata
                           , ? 1 : [* native_script]
                           , ? 2 : [* plutus_v1_script]
                           , ? 3 : [* plutus_v2_script]
                           , ? 4 : [* plutus_v3_script]})

A MultiSig wallet registration contains two parts. The native scripts that define the MultiSig in auxiliary_scripts, alternatively in 1 native_script array for 259 tagged set. This is not encryptable and contains the pub keys of participants. The label 1854 metadata defined in CIP is mainly for additional data like describing the MultiSig. This could theoretically be encrypted according to CIP-83 if you want to publically share but hide this additional data describing the wallet with a name, description etc. CIP-83 is however an addendum to CIP-20 for label 674 metadata and placing this additional MultiSig metadata under this label would make it harder/less performant to search for MultiSig registration transactions. It would also force participants to share this secret off-chain/offline to be able to reconstruct the metadata.

If you feel encrypting metadata as a way of hiding 1854 metadata is worth looking into, I could add this as an optional feature. In this case, I would reference CIP-83 and not re-define it. So if enc field is present just like described in CIP-83, use that to determine if payload needs to be decrypted or not. In that case I would argue that each string value should be decrypted according to CIP-83, ie something like:

{ 
  "1854": { 
    "enc": "<encryption-method>",
    types: ScriptType[
      "base64-string 1", "base64-string 2" ...
    ],
    name: "base64-string",
    description: "base64-string",
    icon: "base64-string",
    participants: {
      [key: string]: {
        name: "base64-string",
        description: "base64-string",
        icon: "base64-string"
      }
      ...
    }
  }
}

@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 24, 2025

How about adding another scope to CIP88? Like we did in the CIP88v2 for Pool-Daily-Key Registration?

Though I have read through CIP-88 (once) I'm not that familiar with how it works. Could you please in more detail go over what parts of this CIP you think CIP-88 could solve in a better way?

Note that it's important to be able to search for native scripts that include the user's 1854-derived pub key to find all MultiSig wallet registrations that it belongs to. So these must be available on-chain to search for to link to the native script. It's also not possible for participants of the MultiSig to all witness this registration as that would defeat the purpose of the registration/discovery flow and people could just off-chain share the registration. Because of this I currently don't see how CIP-88 in this case can solve it better but as I just explained, I haven't looked deep into CIP88 so I might just not see it.

@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 24, 2025

Brief comment on Registration could you change to off Chain sharing instead of offline as we expect most pre- registrations to be shared online but off Chain, rather than offline.

Best Regards QS

Updated according to your comment wording for offline to off-chain 👍

@Scitz0
Copy link
Contributor Author

Scitz0 commented Feb 24, 2025

I will try to join the CIP editors meeting on March 4th where we can maybe talk it through further.

@rphair
Copy link
Collaborator

rphair commented Feb 24, 2025

@Scitz0 no problem; have put it on the agenda: https://hackmd.io/@cip-editors/107 (cc @Crypto2099 @jinglescode @QSchlegel @gitmachtl)

…ript to be included for wallet registration to be valid.
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

thanks @Scitz0 - my understanding was that securing the metadata was the last thing we were waiting for. The rest of this has always looked OK to me (though I don't have practical experience in the field) so I'm ready to approve this after a couple formatting adjustments.

Scitz0 and others added 2 commits April 4, 2025 00:11
Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Robert Phair <[email protected]>
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

@Ryun1 - in summarising this for my April report I noticed that all our feedback from that period has been addressed: so this should have moved into the final review stages 🤔 cc @Scitz0

@rphair rphair added State: Last Check Review favourable with disputes resolved; staged for merging. and removed State: Confirmed Candiate with CIP number (new PR) or update under review. labels May 15, 2025
@rphair rphair requested review from Crypto2099 and Ryun1 May 15, 2025 03:29
@Scitz0
Copy link
Contributor Author

Scitz0 commented May 15, 2025

@Ryun1 - in summarising this for my April report I noticed that all our feedback from that period has been addressed: so this should have moved into the final review stages 🤔 cc @Scitz0

Ok, yeah I don't think I have anything more to add to the CIP.

@rphair
Copy link
Collaborator

rphair commented May 28, 2025

@Scitz0 the feedback from the CIP meeting today is that this is ready to merge as soon as #971 (comment) is addressed to everyone's satisfaction (assuming no further challenges are raised). Therefore this is still in Last Check for the next meeting (https://hackmd.io/@cip-editors/113) unless most editors approve if for merge earlier.

@QSchlegel
Copy link

Additional Implementors

The multisig platform from Mesh is also in the process of implementing this CIP.

https://github.com/MeshJS/multisig
https://multisig.meshjs.dev/

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

thanks @QSchlegel (cc @Scitz0) ... proposing we add this to the Acceptance Criteria as a box to be ticked as soon as CIP-0146 compliance is demonstrated:

@Scitz0
Copy link
Contributor Author

Scitz0 commented Jun 18, 2025

I made a minor adjustment: if metadata is encrypted, values need to be string arrays, as the length of the content might exceed the 64-character limit.

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

Added MeshJS as Path to Active implementor in 0f9b649 as per #971 (comment).

Last Check status for next CIP meeting (https://hackmd.io/@cip-editors/114) was punted from previous meeting when we ran out of time due to a long issue discussion.

Final approval to merge (as previously suggested in #971 (comment)) should be contingent upon @perturbing @Scitz0 conversation #971 (comment) being resolved... I believe it's currently resolved by default since no actual change has been suggested since then. 👀

@rphair rphair requested a review from perturbing June 18, 2025 16:45
@rphair rphair merged commit 75a145a into cardano-foundation:master Jun 24, 2025
2 checks passed
@rphair rphair removed the State: Last Check Review favourable with disputes resolved; staged for merging. label Jul 4, 2025
rphair added a commit that referenced this pull request Aug 5, 2025
* feat: CIP-30 extension to capture network magic

* Update CIP-XXXX/README.md

updated the CIP number in readme

Co-authored-by: Robert Phair <[email protected]>

* Update CIP-XXXX/README.md

added description to the motivation section

Co-authored-by: Robert Phair <[email protected]>

* Update CIP-XXXX/README.md

added description to the rationale section

Co-authored-by: Robert Phair <[email protected]>

* CIP-0142: changed from CIP-XXXX, readme updated with feedback

* CIP-network-magic: removed the assigned CIP number, added discussion link

* Revert "CIP-network-magic: removed the assigned CIP number, added discussion link"

This reverts commit daae1b8.
Added #971 to the discussion

* CIP-0142: added #972 to discussions

* fix: removed temporary from extension identifier

* fix: removed zero padding from the extension naming

* fix: adjusted the zero padding inconsistency

* fix: acceptance criteria modifications

* fix: implemented wallet providers update

* fix: need confirmation on Lace

* Update CIP-0142/README.md

updated

Co-authored-by: Robert Phair <[email protected]>

* fix: handled duplicated lines

---------

Co-authored-by: Robert Phair <[email protected]>
nhenin pushed a commit to nhenin/CIPs that referenced this pull request Sep 8, 2025
…tion#972)

* feat: CIP-30 extension to capture network magic

* Update CIP-XXXX/README.md

updated the CIP number in readme

Co-authored-by: Robert Phair <[email protected]>

* Update CIP-XXXX/README.md

added description to the motivation section

Co-authored-by: Robert Phair <[email protected]>

* Update CIP-XXXX/README.md

added description to the rationale section

Co-authored-by: Robert Phair <[email protected]>

* CIP-0142: changed from CIP-XXXX, readme updated with feedback

* CIP-network-magic: removed the assigned CIP number, added discussion link

* Revert "CIP-network-magic: removed the assigned CIP number, added discussion link"

This reverts commit daae1b8.
Added cardano-foundation#971 to the discussion

* CIP-0142: added cardano-foundation#972 to discussions

* fix: removed temporary from extension identifier

* fix: removed zero padding from the extension naming

* fix: adjusted the zero padding inconsistency

* fix: acceptance criteria modifications

* fix: implemented wallet providers update

* fix: need confirmation on Lace

* Update CIP-0142/README.md

updated

Co-authored-by: Robert Phair <[email protected]>

* fix: handled duplicated lines

---------

Co-authored-by: Robert Phair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Wallets Proposals belonging to the 'Wallets' category.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants