From 65a7fc1b2041e12b7143e03c779926731b73a107 Mon Sep 17 00:00:00 2001 From: nikos-terzo Date: Thu, 7 Nov 2024 16:47:51 +0200 Subject: [PATCH] Add function to derive the zklogin address from its public identifier --- move/sources/multisig.move | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/move/sources/multisig.move b/move/sources/multisig.move index befc480..21c1b41 100644 --- a/move/sources/multisig.move +++ b/move/sources/multisig.move @@ -146,6 +146,15 @@ module multisig::multisig { address_from_bytes(pk, 34, 0x02) } + /// Converts a ZKLoginPublicIdentifier to an address. + /// identifier - The ZKLoginPublicIdentifier including the 0x05 scheme flag. + /// Returns the address. + public fun zklogin_public_identifier_to_address( + identifier: &vector, + ): address { + address_from_bytes(identifier, identifier.length(), 0x05) + } + /// Converts a public key to an address. /// pk - The public key. /// length - The expected length of the public key.