diff --git a/apps/hubble/src/storage/engine/index.test.ts b/apps/hubble/src/storage/engine/index.test.ts index 588be381ff..12168dce47 100644 --- a/apps/hubble/src/storage/engine/index.test.ts +++ b/apps/hubble/src/storage/engine/index.test.ts @@ -197,14 +197,18 @@ describe("mergeMessage", () => { data: { fid, network: FarcasterNetwork.TESTNET, - verificationAddEthAddressBody: { address: address, blockHash: blockHash, ethSignature: claimSignature }, + verificationAddEthAddressBody: { + address: address, + blockHash: blockHash, + protocolSignature: claimSignature, + }, }, }, { transient: { signer: signer, ethSigner: custodySigner } }, ); const result = await engine.mergeMessage(testnetVerificationAdd); // Signature will not match because we're attempting to recover the address based on the wrong network - expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid ethSignature"))); + expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid protocolSignature"))); }); describe("validateOrRevokeMessage", () => { diff --git a/apps/replicator/src/db.ts b/apps/replicator/src/db.ts index edd05c2e25..1f83faf88a 100644 --- a/apps/replicator/src/db.ts +++ b/apps/replicator/src/db.ts @@ -204,13 +204,13 @@ export type ReactionBodyJson = ReactionBodyCastJson | ReactionBodyUrlJson; export type VerificationAddEthAddressBodyJson = { address: Hex; - ethSignature: Hex; + protocolSignature: Hex; blockHash: Hex; }; export type VerificationAddSolAddressBodyJson = { address: Hex; - solSignature: Hex; + protocolSignature: Hex; blockHash: Hex; }; diff --git a/apps/replicator/src/processors/verification.ts b/apps/replicator/src/processors/verification.ts index 25a0c1e40b..b88609c10d 100644 --- a/apps/replicator/src/processors/verification.ts +++ b/apps/replicator/src/processors/verification.ts @@ -62,7 +62,7 @@ const { processAdd: processAddEthereum, processRemove } = buildAddRemoveMessageP hash: message.hash, signerAddress: verificationAddBody.address, blockHash: verificationAddBody.blockHash, - signature: verificationAddBody.ethSignature, + signature: verificationAddBody.protocolSignature, }; // Upsert the verification, if it's shadowed by a remove, mark it as deleted diff --git a/apps/replicator/src/util.ts b/apps/replicator/src/util.ts index d818cee7b9..6b58de5600 100644 --- a/apps/replicator/src/util.ts +++ b/apps/replicator/src/util.ts @@ -194,10 +194,10 @@ export function convertProtobufMessageBodyToJson(message: Message): MessageBodyJ if (!message.data.verificationAddAddressBody) { throw new Error("Missing verificationAddEthAddressBody"); } - const { address, ethSignature, blockHash } = message.data.verificationAddAddressBody; + const { address, protocolSignature, blockHash } = message.data.verificationAddAddressBody; return { address: bytesToHex(address), - ethSignature: bytesToHex(ethSignature), + protocolSignature: bytesToHex(protocolSignature), blockHash: bytesToHex(blockHash), } satisfies VerificationAddEthAddressBodyJson; } @@ -205,10 +205,10 @@ export function convertProtobufMessageBodyToJson(message: Message): MessageBodyJ if (!message.data.verificationAddAddressBody) { throw new Error("Missing verificationAddSolAddressBody"); } - const { address, solSignature, blockHash } = message.data.verificationAddAddressBody; + const { address, protocolSignature, blockHash } = message.data.verificationAddAddressBody; return { address: bytesToHex(address), - solSignature: bytesToHex(solSignature), + protocolSignature: bytesToHex(protocolSignature), blockHash: bytesToHex(blockHash), } satisfies VerificationAddSolAddressBodyJson; } diff --git a/packages/core/src/builders.test.ts b/packages/core/src/builders.test.ts index 80e7d3435b..4642aef5c7 100644 --- a/packages/core/src/builders.test.ts +++ b/packages/core/src/builders.test.ts @@ -151,7 +151,7 @@ describe("makeVerificationAddEthAddressData", () => { test("succeeds", async () => { const data = await builders.makeVerificationAddEthAddressData( - { address: ethSignerKey, blockHash, ethSignature }, + { address: ethSignerKey, blockHash: blockHash, protocolSignature: ethSignature }, { fid, network }, ); expect(data.isOk()).toBeTruthy(); @@ -189,7 +189,7 @@ describe("makeVerificationAddEthAddress", () => { test("succeeds", async () => { const message = await builders.makeVerificationAddEthAddress( - { address: ethSignerKey, blockHash, ethSignature }, + { address: ethSignerKey, blockHash: blockHash, protocolSignature: ethSignature }, { fid, network }, ed25519Signer, ); diff --git a/packages/core/src/factories.ts b/packages/core/src/factories.ts index 5f908b4b85..5e32324814 100644 --- a/packages/core/src/factories.ts +++ b/packages/core/src/factories.ts @@ -400,7 +400,7 @@ const VerificationAddEthAddressBodyFactory = Factory.define< body.address = (await ethSigner.getSignerKey())._unsafeUnwrap(); } - if (body.ethSignature.length === 0) { + if (body.protocolSignature.length === 0) { // Generate address and signature const fid = transientParams.fid ?? FidFactory.build(); const network = transientParams.network ?? FarcasterNetworkFactory.build(); @@ -411,7 +411,7 @@ const VerificationAddEthAddressBodyFactory = Factory.define< blockHash: blockHash.isOk() ? blockHash.value : "0x", address: bytesToHexString(body.address)._unsafeUnwrap(), }); - body.ethSignature = (await ethSigner.signVerificationEthAddressClaim(claim, body.chainId))._unsafeUnwrap(); + body.protocolSignature = (await ethSigner.signVerificationEthAddressClaim(claim, body.chainId))._unsafeUnwrap(); } return body; @@ -429,7 +429,7 @@ const VerificationAddEthAddressDataFactory = Factory.define< >(({ onCreate, transientParams }) => { onCreate(async (data) => { const body = data.verificationAddEthAddressBody; - if (body.ethSignature.length === 0) { + if (body.protocolSignature.length === 0) { const signedBody = await VerificationAddEthAddressBodyFactory.create(body, { transient: { fid: data.fid, network: data.network, signer: transientParams.signer }, }); diff --git a/packages/core/src/protobufs/generated/message.ts b/packages/core/src/protobufs/generated/message.ts index 28f5aef1fc..51459da53f 100644 --- a/packages/core/src/protobufs/generated/message.ts +++ b/packages/core/src/protobufs/generated/message.ts @@ -474,16 +474,14 @@ export interface ReactionBody { export interface VerificationAddAddressBody { /** Address being verified for a given Protocol */ address: Uint8Array; - /** Signature produced by the user's Ethereum address */ - ethSignature: Uint8Array; + /** Signature produced by the user's address for a given Protocol */ + protocolSignature: Uint8Array; /** Hash of the latest Ethereum block when the signature was produced */ blockHash: Uint8Array; /** Type of verification. 0 = EOA, 1 = contract */ verificationType: number; /** 0 for EOA verifications, 1 or 10 for contract verifications */ chainId: number; - /** Signature produced by the user's Solana address */ - solSignature: Uint8Array; /** Protocol of the Verification */ protocol: Protocol; } @@ -1483,11 +1481,10 @@ export const ReactionBody = { function createBaseVerificationAddAddressBody(): VerificationAddAddressBody { return { address: new Uint8Array(), - ethSignature: new Uint8Array(), + protocolSignature: new Uint8Array(), blockHash: new Uint8Array(), verificationType: 0, chainId: 0, - solSignature: new Uint8Array(), protocol: 0, }; } @@ -1497,8 +1494,8 @@ export const VerificationAddAddressBody = { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.ethSignature.length !== 0) { - writer.uint32(18).bytes(message.ethSignature); + if (message.protocolSignature.length !== 0) { + writer.uint32(18).bytes(message.protocolSignature); } if (message.blockHash.length !== 0) { writer.uint32(26).bytes(message.blockHash); @@ -1509,9 +1506,6 @@ export const VerificationAddAddressBody = { if (message.chainId !== 0) { writer.uint32(40).uint32(message.chainId); } - if (message.solSignature.length !== 0) { - writer.uint32(50).bytes(message.solSignature); - } if (message.protocol !== 0) { writer.uint32(56).int32(message.protocol); } @@ -1537,7 +1531,7 @@ export const VerificationAddAddressBody = { break; } - message.ethSignature = reader.bytes(); + message.protocolSignature = reader.bytes(); continue; case 3: if (tag != 26) { @@ -1560,13 +1554,6 @@ export const VerificationAddAddressBody = { message.chainId = reader.uint32(); continue; - case 6: - if (tag != 50) { - break; - } - - message.solSignature = reader.bytes(); - continue; case 7: if (tag != 56) { break; @@ -1586,11 +1573,10 @@ export const VerificationAddAddressBody = { fromJSON(object: any): VerificationAddAddressBody { return { address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), - ethSignature: isSet(object.ethSignature) ? bytesFromBase64(object.ethSignature) : new Uint8Array(), + protocolSignature: isSet(object.protocolSignature) ? bytesFromBase64(object.protocolSignature) : new Uint8Array(), blockHash: isSet(object.blockHash) ? bytesFromBase64(object.blockHash) : new Uint8Array(), verificationType: isSet(object.verificationType) ? Number(object.verificationType) : 0, chainId: isSet(object.chainId) ? Number(object.chainId) : 0, - solSignature: isSet(object.solSignature) ? bytesFromBase64(object.solSignature) : new Uint8Array(), protocol: isSet(object.protocol) ? protocolFromJSON(object.protocol) : 0, }; }, @@ -1599,18 +1585,14 @@ export const VerificationAddAddressBody = { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.ethSignature !== undefined && - (obj.ethSignature = base64FromBytes( - message.ethSignature !== undefined ? message.ethSignature : new Uint8Array(), + message.protocolSignature !== undefined && + (obj.protocolSignature = base64FromBytes( + message.protocolSignature !== undefined ? message.protocolSignature : new Uint8Array(), )); message.blockHash !== undefined && (obj.blockHash = base64FromBytes(message.blockHash !== undefined ? message.blockHash : new Uint8Array())); message.verificationType !== undefined && (obj.verificationType = Math.round(message.verificationType)); message.chainId !== undefined && (obj.chainId = Math.round(message.chainId)); - message.solSignature !== undefined && - (obj.solSignature = base64FromBytes( - message.solSignature !== undefined ? message.solSignature : new Uint8Array(), - )); message.protocol !== undefined && (obj.protocol = protocolToJSON(message.protocol)); return obj; }, @@ -1622,11 +1604,10 @@ export const VerificationAddAddressBody = { fromPartial, I>>(object: I): VerificationAddAddressBody { const message = createBaseVerificationAddAddressBody(); message.address = object.address ?? new Uint8Array(); - message.ethSignature = object.ethSignature ?? new Uint8Array(); + message.protocolSignature = object.protocolSignature ?? new Uint8Array(); message.blockHash = object.blockHash ?? new Uint8Array(); message.verificationType = object.verificationType ?? 0; message.chainId = object.chainId ?? 0; - message.solSignature = object.solSignature ?? new Uint8Array(); message.protocol = object.protocol ?? 0; return message; }, diff --git a/packages/core/src/validations.test.ts b/packages/core/src/validations.test.ts index 6ec0ca58df..83859d0075 100644 --- a/packages/core/src/validations.test.ts +++ b/packages/core/src/validations.test.ts @@ -672,7 +672,7 @@ describe("validateVerificationAddEthAddressSignature", () => { test("fails with invalid eth signature", async () => { const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), + protocolSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), }); const result = await validations.validateVerificationAddEthAddressSignature(body, fid, network); expect(result).toEqual(err(new HubError("unknown", "Cannot convert 0x to a BigInt"))); @@ -680,7 +680,7 @@ describe("validateVerificationAddEthAddressSignature", () => { test("fails with invalid verificationType", async () => { const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), + protocolSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), verificationType: 2, }); const result = await validations.validateVerificationAddEthAddressSignature(body, fid, network); @@ -689,7 +689,7 @@ describe("validateVerificationAddEthAddressSignature", () => { test("fails with invalid chainId", async () => { const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), + protocolSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), chainId: 7, verificationType: 1, }); @@ -699,7 +699,7 @@ describe("validateVerificationAddEthAddressSignature", () => { test("fails if client not provided for chainId", async () => { const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), + protocolSignature: Factories.Bytes.build({}, { transient: { length: 1 } }), chainId: 1, verificationType: 1, }); @@ -709,10 +709,10 @@ describe("validateVerificationAddEthAddressSignature", () => { test("fails if ethSignature is > 256 bytes", async () => { const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature: Factories.Bytes.build({}, { transient: { length: 257 } }), + protocolSignature: Factories.Bytes.build({}, { transient: { length: 257 } }), }); const result = await validations.validateVerificationAddEthAddressSignature(body, fid, network, {}); - expect(result).toEqual(err(new HubError("bad_request.validation_failure", "ethSignature > 256 bytes"))); + expect(result).toEqual(err(new HubError("bad_request.validation_failure", "protocolSignature > 256 bytes"))); }); test("succeeds for contract signatures", async () => { @@ -750,7 +750,7 @@ describe("validateVerificationAddEthAddressSignature", () => { { transient: { fid, network, contractSignature: true } }, ); const result = await validations.validateVerificationAddEthAddressSignature(body, fid, network, publicClients); - expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid ethSignature"))); + expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid protocolSignature"))); }); test("fails with eth signature from different address", async () => { @@ -759,12 +759,12 @@ describe("validateVerificationAddEthAddressSignature", () => { const ethSignature = (await ethSigner.signVerificationEthAddressClaim(claim))._unsafeUnwrap(); expect(ethSignature).toBeTruthy(); const body = await Factories.VerificationAddEthAddressBody.create({ - ethSignature, + protocolSignature: ethSignature, blockHash, address: Factories.EthAddress.build(), }); const result = await validations.validateVerificationAddEthAddressSignature(body, fid, network); - expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid ethSignature"))); + expect(result).toEqual(err(new HubError("bad_request.validation_failure", "invalid protocolSignature"))); }); }); diff --git a/packages/core/src/validations.ts b/packages/core/src/validations.ts index 7c4197d9e7..80cd9c349f 100644 --- a/packages/core/src/validations.ts +++ b/packages/core/src/validations.ts @@ -355,8 +355,8 @@ export const validateVerificationAddEthAddressSignature = async ( network: protobufs.FarcasterNetwork, publicClients: PublicClients = defaultPublicClients, ): HubAsyncResult => { - if (body.ethSignature.length > 256) { - return err(new HubError("bad_request.validation_failure", "ethSignature > 256 bytes")); + if (body.protocolSignature.length > 256) { + return err(new HubError("bad_request.validation_failure", "protocolSignature > 256 bytes")); } const reconstructedClaim = makeVerificationEthAddressClaim(fid, body.address, network, body.blockHash); @@ -366,7 +366,7 @@ export const validateVerificationAddEthAddressSignature = async ( const verificationResult = await eip712.verifyVerificationEthAddressClaimSignature( reconstructedClaim.value, - body.ethSignature, + body.protocolSignature, body.address, body.verificationType, body.chainId, @@ -378,10 +378,10 @@ export const validateVerificationAddEthAddressSignature = async ( } if (!verificationResult.value) { - return err(new HubError("bad_request.validation_failure", "invalid ethSignature")); + return err(new HubError("bad_request.validation_failure", "invalid protocolSignature")); } - return ok(body.ethSignature); + return ok(body.protocolSignature); }; export const validateVerificationAddSolAddressSignature = async ( @@ -390,8 +390,8 @@ export const validateVerificationAddSolAddressSignature = async ( network: protobufs.FarcasterNetwork, publicClients: PublicClients = defaultPublicClients, ): HubAsyncResult => { - if (body.solSignature.length > 256) { - return err(new HubError("bad_request.validation_failure", "solSignature > 256 bytes")); + if (body.protocolSignature.length > 256) { + return err(new HubError("bad_request.validation_failure", "protocolSignature > 256 bytes")); } const reconstructedClaim = makeVerificationSolAddressClaim(fid, body.address, network, body.blockHash); @@ -399,7 +399,7 @@ export const validateVerificationAddSolAddressSignature = async ( return err(reconstructedClaim.error); } - return ok(body.solSignature); + return ok(body.protocolSignature); }; export const validateUrl = (url: string): HubResult => { diff --git a/packages/hub-nodejs/docs/Builders.md b/packages/hub-nodejs/docs/Builders.md index aa8b886d44..0b0eed605d 100644 --- a/packages/hub-nodejs/docs/Builders.md +++ b/packages/hub-nodejs/docs/Builders.md @@ -366,7 +366,7 @@ if (claimResult.isOk()) { // Construct a Verification Add Message with the claim signature const verificationBody = { address: addressBytes, - ethSignature, + protocolSignature: ethSignature, blockHash: blockHashBytes, }; diff --git a/packages/hub-nodejs/src/generated/message.ts b/packages/hub-nodejs/src/generated/message.ts index 28f5aef1fc..51459da53f 100644 --- a/packages/hub-nodejs/src/generated/message.ts +++ b/packages/hub-nodejs/src/generated/message.ts @@ -474,16 +474,14 @@ export interface ReactionBody { export interface VerificationAddAddressBody { /** Address being verified for a given Protocol */ address: Uint8Array; - /** Signature produced by the user's Ethereum address */ - ethSignature: Uint8Array; + /** Signature produced by the user's address for a given Protocol */ + protocolSignature: Uint8Array; /** Hash of the latest Ethereum block when the signature was produced */ blockHash: Uint8Array; /** Type of verification. 0 = EOA, 1 = contract */ verificationType: number; /** 0 for EOA verifications, 1 or 10 for contract verifications */ chainId: number; - /** Signature produced by the user's Solana address */ - solSignature: Uint8Array; /** Protocol of the Verification */ protocol: Protocol; } @@ -1483,11 +1481,10 @@ export const ReactionBody = { function createBaseVerificationAddAddressBody(): VerificationAddAddressBody { return { address: new Uint8Array(), - ethSignature: new Uint8Array(), + protocolSignature: new Uint8Array(), blockHash: new Uint8Array(), verificationType: 0, chainId: 0, - solSignature: new Uint8Array(), protocol: 0, }; } @@ -1497,8 +1494,8 @@ export const VerificationAddAddressBody = { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.ethSignature.length !== 0) { - writer.uint32(18).bytes(message.ethSignature); + if (message.protocolSignature.length !== 0) { + writer.uint32(18).bytes(message.protocolSignature); } if (message.blockHash.length !== 0) { writer.uint32(26).bytes(message.blockHash); @@ -1509,9 +1506,6 @@ export const VerificationAddAddressBody = { if (message.chainId !== 0) { writer.uint32(40).uint32(message.chainId); } - if (message.solSignature.length !== 0) { - writer.uint32(50).bytes(message.solSignature); - } if (message.protocol !== 0) { writer.uint32(56).int32(message.protocol); } @@ -1537,7 +1531,7 @@ export const VerificationAddAddressBody = { break; } - message.ethSignature = reader.bytes(); + message.protocolSignature = reader.bytes(); continue; case 3: if (tag != 26) { @@ -1560,13 +1554,6 @@ export const VerificationAddAddressBody = { message.chainId = reader.uint32(); continue; - case 6: - if (tag != 50) { - break; - } - - message.solSignature = reader.bytes(); - continue; case 7: if (tag != 56) { break; @@ -1586,11 +1573,10 @@ export const VerificationAddAddressBody = { fromJSON(object: any): VerificationAddAddressBody { return { address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), - ethSignature: isSet(object.ethSignature) ? bytesFromBase64(object.ethSignature) : new Uint8Array(), + protocolSignature: isSet(object.protocolSignature) ? bytesFromBase64(object.protocolSignature) : new Uint8Array(), blockHash: isSet(object.blockHash) ? bytesFromBase64(object.blockHash) : new Uint8Array(), verificationType: isSet(object.verificationType) ? Number(object.verificationType) : 0, chainId: isSet(object.chainId) ? Number(object.chainId) : 0, - solSignature: isSet(object.solSignature) ? bytesFromBase64(object.solSignature) : new Uint8Array(), protocol: isSet(object.protocol) ? protocolFromJSON(object.protocol) : 0, }; }, @@ -1599,18 +1585,14 @@ export const VerificationAddAddressBody = { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.ethSignature !== undefined && - (obj.ethSignature = base64FromBytes( - message.ethSignature !== undefined ? message.ethSignature : new Uint8Array(), + message.protocolSignature !== undefined && + (obj.protocolSignature = base64FromBytes( + message.protocolSignature !== undefined ? message.protocolSignature : new Uint8Array(), )); message.blockHash !== undefined && (obj.blockHash = base64FromBytes(message.blockHash !== undefined ? message.blockHash : new Uint8Array())); message.verificationType !== undefined && (obj.verificationType = Math.round(message.verificationType)); message.chainId !== undefined && (obj.chainId = Math.round(message.chainId)); - message.solSignature !== undefined && - (obj.solSignature = base64FromBytes( - message.solSignature !== undefined ? message.solSignature : new Uint8Array(), - )); message.protocol !== undefined && (obj.protocol = protocolToJSON(message.protocol)); return obj; }, @@ -1622,11 +1604,10 @@ export const VerificationAddAddressBody = { fromPartial, I>>(object: I): VerificationAddAddressBody { const message = createBaseVerificationAddAddressBody(); message.address = object.address ?? new Uint8Array(); - message.ethSignature = object.ethSignature ?? new Uint8Array(); + message.protocolSignature = object.protocolSignature ?? new Uint8Array(); message.blockHash = object.blockHash ?? new Uint8Array(); message.verificationType = object.verificationType ?? 0; message.chainId = object.chainId ?? 0; - message.solSignature = object.solSignature ?? new Uint8Array(); message.protocol = object.protocol ?? 0; return message; }, diff --git a/packages/hub-web/src/generated/message.ts b/packages/hub-web/src/generated/message.ts index 28f5aef1fc..51459da53f 100644 --- a/packages/hub-web/src/generated/message.ts +++ b/packages/hub-web/src/generated/message.ts @@ -474,16 +474,14 @@ export interface ReactionBody { export interface VerificationAddAddressBody { /** Address being verified for a given Protocol */ address: Uint8Array; - /** Signature produced by the user's Ethereum address */ - ethSignature: Uint8Array; + /** Signature produced by the user's address for a given Protocol */ + protocolSignature: Uint8Array; /** Hash of the latest Ethereum block when the signature was produced */ blockHash: Uint8Array; /** Type of verification. 0 = EOA, 1 = contract */ verificationType: number; /** 0 for EOA verifications, 1 or 10 for contract verifications */ chainId: number; - /** Signature produced by the user's Solana address */ - solSignature: Uint8Array; /** Protocol of the Verification */ protocol: Protocol; } @@ -1483,11 +1481,10 @@ export const ReactionBody = { function createBaseVerificationAddAddressBody(): VerificationAddAddressBody { return { address: new Uint8Array(), - ethSignature: new Uint8Array(), + protocolSignature: new Uint8Array(), blockHash: new Uint8Array(), verificationType: 0, chainId: 0, - solSignature: new Uint8Array(), protocol: 0, }; } @@ -1497,8 +1494,8 @@ export const VerificationAddAddressBody = { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (message.ethSignature.length !== 0) { - writer.uint32(18).bytes(message.ethSignature); + if (message.protocolSignature.length !== 0) { + writer.uint32(18).bytes(message.protocolSignature); } if (message.blockHash.length !== 0) { writer.uint32(26).bytes(message.blockHash); @@ -1509,9 +1506,6 @@ export const VerificationAddAddressBody = { if (message.chainId !== 0) { writer.uint32(40).uint32(message.chainId); } - if (message.solSignature.length !== 0) { - writer.uint32(50).bytes(message.solSignature); - } if (message.protocol !== 0) { writer.uint32(56).int32(message.protocol); } @@ -1537,7 +1531,7 @@ export const VerificationAddAddressBody = { break; } - message.ethSignature = reader.bytes(); + message.protocolSignature = reader.bytes(); continue; case 3: if (tag != 26) { @@ -1560,13 +1554,6 @@ export const VerificationAddAddressBody = { message.chainId = reader.uint32(); continue; - case 6: - if (tag != 50) { - break; - } - - message.solSignature = reader.bytes(); - continue; case 7: if (tag != 56) { break; @@ -1586,11 +1573,10 @@ export const VerificationAddAddressBody = { fromJSON(object: any): VerificationAddAddressBody { return { address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), - ethSignature: isSet(object.ethSignature) ? bytesFromBase64(object.ethSignature) : new Uint8Array(), + protocolSignature: isSet(object.protocolSignature) ? bytesFromBase64(object.protocolSignature) : new Uint8Array(), blockHash: isSet(object.blockHash) ? bytesFromBase64(object.blockHash) : new Uint8Array(), verificationType: isSet(object.verificationType) ? Number(object.verificationType) : 0, chainId: isSet(object.chainId) ? Number(object.chainId) : 0, - solSignature: isSet(object.solSignature) ? bytesFromBase64(object.solSignature) : new Uint8Array(), protocol: isSet(object.protocol) ? protocolFromJSON(object.protocol) : 0, }; }, @@ -1599,18 +1585,14 @@ export const VerificationAddAddressBody = { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.ethSignature !== undefined && - (obj.ethSignature = base64FromBytes( - message.ethSignature !== undefined ? message.ethSignature : new Uint8Array(), + message.protocolSignature !== undefined && + (obj.protocolSignature = base64FromBytes( + message.protocolSignature !== undefined ? message.protocolSignature : new Uint8Array(), )); message.blockHash !== undefined && (obj.blockHash = base64FromBytes(message.blockHash !== undefined ? message.blockHash : new Uint8Array())); message.verificationType !== undefined && (obj.verificationType = Math.round(message.verificationType)); message.chainId !== undefined && (obj.chainId = Math.round(message.chainId)); - message.solSignature !== undefined && - (obj.solSignature = base64FromBytes( - message.solSignature !== undefined ? message.solSignature : new Uint8Array(), - )); message.protocol !== undefined && (obj.protocol = protocolToJSON(message.protocol)); return obj; }, @@ -1622,11 +1604,10 @@ export const VerificationAddAddressBody = { fromPartial, I>>(object: I): VerificationAddAddressBody { const message = createBaseVerificationAddAddressBody(); message.address = object.address ?? new Uint8Array(); - message.ethSignature = object.ethSignature ?? new Uint8Array(); + message.protocolSignature = object.protocolSignature ?? new Uint8Array(); message.blockHash = object.blockHash ?? new Uint8Array(); message.verificationType = object.verificationType ?? 0; message.chainId = object.chainId ?? 0; - message.solSignature = object.solSignature ?? new Uint8Array(); message.protocol = object.protocol ?? 0; return message; }, diff --git a/protobufs/schemas/message.proto b/protobufs/schemas/message.proto index c7cafc3fd7..eb95cc2bba 100644 --- a/protobufs/schemas/message.proto +++ b/protobufs/schemas/message.proto @@ -152,12 +152,11 @@ enum Protocol { /** Adds a Verification of ownership of an Address based on Protocol */ message VerificationAddAddressBody { bytes address = 1; // Address being verified for a given Protocol - bytes eth_signature = 2; // Signature produced by the user's Ethereum address + bytes protocol_signature = 2; // Signature produced by the user's address for a given Protocol bytes block_hash = 3; // Hash of the latest Ethereum block when the signature was produced uint32 verification_type = 4; // Type of verification. 0 = EOA, 1 = contract uint32 chain_id = 5; // 0 for EOA verifications, 1 or 10 for contract verifications - bytes sol_signature = 6; // Signature produced by the user's Solana address Protocol protocol = 7; // Protocol of the Verification }