Feature: Request Login with Payment #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
NumberFieldOrderinstead.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