@@ -20,6 +20,7 @@ use aptos_types::{
2020 block_metadata:: BlockMetadata ,
2121 block_metadata_ext:: BlockMetadataExt ,
2222 contract_event:: { ContractEvent , EventWithVersion } ,
23+ oidb,
2324 transaction:: {
2425 authenticator:: {
2526 AccountAuthenticator , AnyPublicKey , AnySignature , MultiKey , MultiKeyAuthenticator ,
@@ -28,7 +29,6 @@ use aptos_types::{
2829 webauthn:: { PartialAuthenticatorAssertionResponse , MAX_WEBAUTHN_SIGNATURE_BYTES } ,
2930 Script , SignedTransaction , TransactionOutput , TransactionWithProof ,
3031 } ,
31- zkid,
3232} ;
3333use once_cell:: sync:: Lazy ;
3434use poem_openapi:: { Object , Union } ;
@@ -1198,24 +1198,24 @@ impl VerifyInput for WebAuthnSignature {
11981198}
11991199
12001200#[ derive( Clone , Debug , PartialEq , Eq , Serialize , Deserialize , Object ) ]
1201- pub struct ZkIdSignature {
1201+ pub struct OidbSignature {
12021202 pub public_key : HexEncodedBytes ,
12031203 pub signature : HexEncodedBytes ,
12041204}
12051205
1206- impl VerifyInput for ZkIdSignature {
1206+ impl VerifyInput for OidbSignature {
12071207 fn verify ( & self ) -> anyhow:: Result < ( ) > {
12081208 let public_key_len = self . public_key . inner ( ) . len ( ) ;
12091209 let signature_len = self . signature . inner ( ) . len ( ) ;
1210- if public_key_len > zkid :: ZkIdPublicKey :: MAX_LEN {
1210+ if public_key_len > oidb :: OidbPublicKey :: MAX_LEN {
12111211 bail ! (
1212- "zkID public key length is greater than the maximum number of {} bytes: found {} bytes" ,
1213- zkid :: ZkIdPublicKey :: MAX_LEN , public_key_len
1212+ "OIDB public key length is greater than the maximum number of {} bytes: found {} bytes" ,
1213+ oidb :: OidbPublicKey :: MAX_LEN , public_key_len
12141214 )
1215- } else if signature_len > zkid :: ZkIdSignature :: MAX_LEN {
1215+ } else if signature_len > oidb :: OidbSignature :: MAX_LEN {
12161216 bail ! (
1217- "zkID signature length is greater than the maximum number of {} bytes: found {} bytes" ,
1218- zkid :: ZkIdSignature :: MAX_LEN , signature_len
1217+ "OIDB signature length is greater than the maximum number of {} bytes: found {} bytes" ,
1218+ oidb :: OidbSignature :: MAX_LEN , signature_len
12191219 )
12201220 } else {
12211221 Ok ( ( ) )
@@ -1230,7 +1230,7 @@ pub enum Signature {
12301230 Ed25519 ( HexEncodedBytes ) ,
12311231 Secp256k1Ecdsa ( HexEncodedBytes ) ,
12321232 WebAuthn ( HexEncodedBytes ) ,
1233- ZkId ( HexEncodedBytes ) ,
1233+ Oidb ( HexEncodedBytes ) ,
12341234}
12351235
12361236impl TryFrom < Signature > for AnySignature {
@@ -1241,7 +1241,7 @@ impl TryFrom<Signature> for AnySignature {
12411241 Signature :: Ed25519 ( s) => AnySignature :: ed25519 ( s. inner ( ) . try_into ( ) ?) ,
12421242 Signature :: Secp256k1Ecdsa ( s) => AnySignature :: secp256k1_ecdsa ( s. inner ( ) . try_into ( ) ?) ,
12431243 Signature :: WebAuthn ( s) => AnySignature :: webauthn ( s. inner ( ) . try_into ( ) ?) ,
1244- Signature :: ZkId ( s) => AnySignature :: zkid ( s. inner ( ) . try_into ( ) ?) ,
1244+ Signature :: Oidb ( s) => AnySignature :: oidb ( s. inner ( ) . try_into ( ) ?) ,
12451245 } )
12461246 }
12471247}
@@ -1258,7 +1258,7 @@ impl From<AnySignature> for Signature {
12581258 AnySignature :: WebAuthn { signature } => {
12591259 Signature :: WebAuthn ( signature. to_bytes ( ) . to_vec ( ) . into ( ) )
12601260 } ,
1261- AnySignature :: ZkId { signature } => Signature :: ZkId ( signature. to_bytes ( ) . into ( ) ) ,
1261+ AnySignature :: OIDB { signature } => Signature :: Oidb ( signature. to_bytes ( ) . into ( ) ) ,
12621262 }
12631263 }
12641264}
@@ -1270,7 +1270,7 @@ pub enum PublicKey {
12701270 Ed25519 ( HexEncodedBytes ) ,
12711271 Secp256k1Ecdsa ( HexEncodedBytes ) ,
12721272 Secp256r1Ecdsa ( HexEncodedBytes ) ,
1273- ZkId ( HexEncodedBytes ) ,
1273+ Oidb ( HexEncodedBytes ) ,
12741274}
12751275
12761276impl TryFrom < PublicKey > for AnyPublicKey {
@@ -1281,7 +1281,7 @@ impl TryFrom<PublicKey> for AnyPublicKey {
12811281 PublicKey :: Ed25519 ( p) => AnyPublicKey :: ed25519 ( p. inner ( ) . try_into ( ) ?) ,
12821282 PublicKey :: Secp256k1Ecdsa ( p) => AnyPublicKey :: secp256k1_ecdsa ( p. inner ( ) . try_into ( ) ?) ,
12831283 PublicKey :: Secp256r1Ecdsa ( p) => AnyPublicKey :: secp256r1_ecdsa ( p. inner ( ) . try_into ( ) ?) ,
1284- PublicKey :: ZkId ( p) => AnyPublicKey :: zkid ( p. inner ( ) . try_into ( ) ?) ,
1284+ PublicKey :: Oidb ( p) => AnyPublicKey :: oidb ( p. inner ( ) . try_into ( ) ?) ,
12851285 } )
12861286 }
12871287}
@@ -1298,7 +1298,7 @@ impl From<AnyPublicKey> for PublicKey {
12981298 AnyPublicKey :: Secp256r1Ecdsa { public_key } => {
12991299 PublicKey :: Secp256r1Ecdsa ( public_key. to_bytes ( ) . to_vec ( ) . into ( ) )
13001300 } ,
1301- AnyPublicKey :: ZkId { public_key } => PublicKey :: ZkId ( public_key. to_bytes ( ) . into ( ) ) ,
1301+ AnyPublicKey :: OIDB { public_key } => PublicKey :: Oidb ( public_key. to_bytes ( ) . into ( ) ) ,
13021302 }
13031303 }
13041304}
@@ -1330,7 +1330,7 @@ impl VerifyInput for SingleKeySignature {
13301330 signature : s. clone ( ) ,
13311331 }
13321332 . verify ( ) ,
1333- ( PublicKey :: ZkId ( p) , Signature :: ZkId ( s) ) => ZkIdSignature {
1333+ ( PublicKey :: Oidb ( p) , Signature :: Oidb ( s) ) => OidbSignature {
13341334 public_key : p. clone ( ) ,
13351335 signature : s. clone ( ) ,
13361336 }
@@ -1374,12 +1374,12 @@ impl TryFrom<SingleKeySignature> for AccountAuthenticator {
13741374 ) ?;
13751375 AnyPublicKey :: secp256r1_ecdsa ( key)
13761376 } ,
1377- PublicKey :: ZkId ( p) => {
1377+ PublicKey :: Oidb ( p) => {
13781378 let key = p
13791379 . inner ( )
13801380 . try_into ( )
1381- . context ( "Failed to parse given public_key bytes as ZkIdPublicKey " ) ?;
1382- AnyPublicKey :: zkid ( key)
1381+ . context ( "Failed to parse given public_key bytes as OidbPublicKey " ) ?;
1382+ AnyPublicKey :: oidb ( key)
13831383 } ,
13841384 } ;
13851385
@@ -1405,12 +1405,12 @@ impl TryFrom<SingleKeySignature> for AccountAuthenticator {
14051405 . context ( "Failed to parse given signature bytes as PartialAuthenticatorAssertionResponse" ) ?;
14061406 AnySignature :: webauthn ( signature)
14071407 } ,
1408- Signature :: ZkId ( s) => {
1408+ Signature :: Oidb ( s) => {
14091409 let signature = s
14101410 . inner ( )
14111411 . try_into ( )
1412- . context ( "Failed to parse given signature bytes as ZkIdSignature " ) ?;
1413- AnySignature :: zkid ( signature)
1412+ . context ( "Failed to parse given signature bytes as OidbSignature " ) ?;
1413+ AnySignature :: oidb ( signature)
14141414 } ,
14151415 } ;
14161416
@@ -1475,12 +1475,12 @@ impl TryFrom<MultiKeySignature> for AccountAuthenticator {
14751475 ) ?;
14761476 AnyPublicKey :: secp256r1_ecdsa ( key)
14771477 } ,
1478- PublicKey :: ZkId ( p) => {
1478+ PublicKey :: Oidb ( p) => {
14791479 let key = p
14801480 . inner ( )
14811481 . try_into ( )
1482- . context ( "Failed to parse given public_key bytes as ZkIdPublicKey " ) ?;
1483- AnyPublicKey :: zkid ( key)
1482+ . context ( "Failed to parse given public_key bytes as OidbPublicKey " ) ?;
1483+ AnyPublicKey :: oidb ( key)
14841484 } ,
14851485 } ;
14861486 public_keys. push ( key) ;
@@ -1508,12 +1508,12 @@ impl TryFrom<MultiKeySignature> for AccountAuthenticator {
15081508 ) ?;
15091509 AnySignature :: webauthn ( paar)
15101510 } ,
1511- Signature :: ZkId ( s) => {
1511+ Signature :: Oidb ( s) => {
15121512 let signature = s
15131513 . inner ( )
15141514 . try_into ( )
1515- . context ( "Failed to parse given signature as ZkIdSignature " ) ?;
1516- AnySignature :: zkid ( signature)
1515+ . context ( "Failed to parse given signature as OidbSignature " ) ?;
1516+ AnySignature :: oidb ( signature)
15171517 } ,
15181518 } ;
15191519 signatures. push ( ( indexed_signature. index , signature) ) ;
0 commit comments