Skip to content

Conversation

@zfedoran
Copy link
Collaborator

@zfedoran zfedoran commented Dec 20, 2023

This pull request aims to implement the core SDK functionality needed for requesting a public key for a user that has completed a payment. The public key is tied to the verifier / domain (unique to each domain) and signed to prove ownership.

Not yet supported on the mobile app but we're getting close.

RPC layer

The proto messages for this feature can be found here:

https://github.com/code-payments/code-sdk/blob/main/packages/rpc/src/generated/messaging/v1/messaging_service_pb.ts#L661-L689

Message Signatures

A known issue is that protobuf signatures are typically not recommended. The wire format (binary) produced by individual protobuf implementations are not byte stable or deterministic according to the specification. We are considering adding another serialization library but that seems like excessive overhead as we're already committed to using GRPC.

Other projects have encountered similar issues. Borsh may be an interesting option.

For the time being, it seems that the golang protobuf implementation is the only outlier and is knowingly producing different serializations from both the iOS and Typescript counterparts. We will use a custom marshal implementation that uses NumberFieldOrder instead.

Custom Marshaller

In the short term we will continue using protobuf with canonical encoding rules.

The golang changes required to make the wire messages consistent can be found here: code-payments/code-server#27

@zfedoran zfedoran changed the title Feature: Request Login with payment Feature: Request Login with Payment Dec 20, 2023
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