Signature Generation
Securing Your Blockchain Transactions
When dealing with blockchain transactions, security is paramount. That's why Portal Pay requires a digital signature for certain types of payments. Let's break down how this works and why it's important.
When Do You Need a Signature?
For some blockchain payments, you'll need to provide a digital signature when creating a TransactionRequest. This extra step helps ensure the security and authenticity of the transaction.
Creating the Signature Content
The signature content is a simple JSON object that includes the Payment ID. Here's what it looks like:
{ "payment_id": "74d2f515-3517-4e76-be13-30880443546f" }
While you can add more information to this object if needed, the payment_id
is the crucial piece. We'll validate this when you create a TransactionRequest.
Encoding Your Signature
Different blockchains use different encoding methods for signatures. Here's a quick guide:
Blockchain | Encoding |
---|---|
Ethereum | Hex |
Solana | Base 58 |
Make sure you're using the correct encoding for the blockchain you're working with. This ensures that Portal Pay can properly verify your signature.
By implementing this signature system, Portal Pay helps protect both you and your customers from potential fraud or errors in the transaction process.
Updated 5 months ago