Skip to main content
Didit Raises $7.5M to Build the Infrastructure for Identity and Fraud
Didit
Back to blog
Blog · March 6, 2026

Building a High-Performance gRPC Microservice for Didit Webhook Consumption in Go

Learn to build a robust, high-performance gRPC microservice in Go for consuming Didit webhooks. This guide covers signature verification, secure handling of real-time identity verification data, and scalable architecture for.

By DiditUpdated
building-a-high-performance-grpc-microservice-for-didit-webhook-consumption-in-go.png

Secure Webhook ConsumptionImplementing robust HMAC-SHA256 signature verification is crucial for authenticating incoming Didit webhooks and protecting your system from spoofing attempts.

High-Performance Processing with Go and gRPCLeverage Go's concurrency features and gRPC for building efficient, low-latency microservices capable of handling high volumes of real-time identity verification events.

Event-Driven ArchitectureDesign your webhook consumer as an event-driven microservice to decouple processing logic, enhance scalability, and ensure reliable delivery of critical identity updates.

Seamless Integration with DiditDidit's flexible webhook configuration, including payload versioning and secret key management, makes integrating real-time identity verification results straightforward and secure.

The Importance of Real-Time Identity Verification Events

In today's fast-paced digital economy, real-time feedback on identity verification (IDV) outcomes is not just a luxury; it's a necessity. Whether you're onboarding new users, preventing fraud, or ensuring compliance, immediate access to verification results allows for instantaneous decision-making and a superior user experience. Webhooks are the backbone of this real-time communication, acting as an event-driven mechanism where Didit proactively notifies your application of significant events, such as a completed ID verification, a failed liveness check, or an updated AML screening status.

Relying on polling an API for updates can introduce latency, consume unnecessary resources, and is inefficient for high-volume scenarios. Webhooks, conversely, push data to your specified endpoint as soon as an event occurs, ensuring your system is always synchronized with the latest identity verification status. This is particularly critical for applications that require rapid responses, such as financial services needing instant AML Screening & Monitoring updates or online marketplaces verifying user identities with ID Verification and Passive & Active Liveness to combat fraud.

Designing a Robust gRPC Microservice for Webhook Consumption

Building a high-performance webhook consumer requires careful consideration of security, scalability, and reliability. Go, with its strong concurrency model and excellent performance characteristics, is an ideal language for this task. Coupling Go with gRPC, a high-performance, open-source universal RPC framework, provides several advantages:

  • Efficiency: gRPC uses Protocol Buffers for serialization, which are smaller and faster than JSON, reducing network overhead.
  • Performance: Built on HTTP/2, gRPC supports multiplexing, header compression, and server push, leading to lower latency and higher throughput.
  • Strong Typing: Protocol Buffers enforce a schema, ensuring data consistency and reducing runtime errors.
  • Interoperability: While we're focusing on Go, gRPC clients and servers can be implemented in a multitude of languages, facilitating microservice communication across heterogeneous environments.

For consuming Didit webhooks, your gRPC microservice will act as the server, exposing an endpoint that Didit's webhook system can call. While webhooks typically use HTTP/S POST requests, the internal communication within your microservice architecture could benefit from gRPC. The external-facing endpoint will still be an HTTP/S endpoint that receives the webhook, but its subsequent processing can be delegated to an internal gRPC service.

Implementing Secure Webhook Verification in Go

Security is paramount when consuming webhooks. You must verify that the incoming request genuinely originated from Didit and has not been tampered with. Didit provides a shared secret key for HMAC-SHA256 signature verification. This is a critical step to prevent malicious actors from injecting fake verification results into your system.

Here's a conceptual outline for secure webhook consumption in Go:

  1. Retrieve Webhook Secret: Obtain your secret_shared_key from Didit's Business Console or via the Didit API (GET /v3/webhook/).
  2. Receive Webhook Request: Your HTTP/S endpoint will receive a POST request from Didit. The raw request body and the X-Signature header are essential.
  3. Verify Signature: Calculate the HMAC-SHA256 signature of the raw request body using your secret_shared_key. Compare this calculated signature with the one provided in the X-Signature header. If they don't match, reject the request immediately.
  4. Validate Timestamp: Didit webhooks include a timestamp. Validate that this timestamp is fresh (e.g., within 5 minutes) to mitigate replay attacks.
  5. Parse Payload: Once verified, parse the JSON payload, which will contain detailed information about the identity verification session, including the outcome of processes like ID Verification, Passive & Active Liveness, or AML Screening.
  6. Process Event: Based on the event type and status, trigger appropriate downstream actions within your application.

Didit's webhooks support different versions (v1, v2, v3), with v3 being the recommended choice for its comprehensive data structure. You can configure your preferred webhook_version and webhook_url using the Didit API (PATCH /v3/webhook/) or through the Business Console. You can also rotate your secret_shared_key as needed for enhanced security.

Scaling and Data Retention Considerations

As your user base grows, so will the volume of webhooks. Your Go gRPC microservice should be designed for scalability. This can involve:

  • Asynchronous Processing: Instead of processing the webhook synchronously within the HTTP handler, push the verified payload to a message queue (e.g., Kafka, RabbitMQ) for asynchronous processing by dedicated worker services. This decouples the ingestion from the processing, improving responsiveness and fault tolerance.
  • Load Balancing: Deploy multiple instances of your webhook consumer behind a load balancer to distribute traffic and handle peak loads.
  • Monitoring: Implement robust logging and monitoring to track webhook delivery, processing times, and potential errors.

Data retention is another critical aspect, especially with identity data. Didit acts as a data processor, and you remain the data controller. Didit offers configurable data retention policies in the Business Console, allowing you to set retention periods from 1 month to 10 years, or unlimited. This ensures compliance with regulations like GDPR by controlling how long verification inputs, outputs, and metadata are stored. For your own microservice, ensure you also have a clear data retention strategy for the webhook payloads you store and process internally, aligning with your legal and compliance obligations.

How Didit Helps

Didit provides the foundational identity infrastructure that makes building high-performance webhook consumers straightforward and secure. Our platform offers a Free Core KYC tier, enabling you to start verifying identities without upfront costs. Didit's modular architecture means you can pick and choose the identity primitives you need, such as ID Verification for document checks, Passive & Active Liveness for fraud prevention, or AML Screening & Monitoring for compliance, and integrate them seamlessly into your workflows.

Our webhooks are designed for developers, providing real-time notifications for critical events. With features like configurable webhook URLs, payload versions (v3 recommended), and easy secret key rotation, Didit ensures you have the tools to build a secure and scalable webhook consumption service. Our AI-native approach to identity verification means you receive highly accurate and reliable results, which your Go gRPC microservice can then consume and act upon instantly. Didit also supports NFC Verification for ePassports and eIDs, providing the highest level of assurance, with all results pushable via webhooks.

Ready to Get Started?

Ready to see Didit in action? Get a free demo today.

Start verifying identities for free with Didit's free tier.

Infrastructure for identity and fraud.

One API for KYC, KYB, Transaction Monitoring, and Wallet Screening. Integrate in 5 minutes.

Ask an AI to summarise this page
Go gRPC Microservice for Didit Webhook Consumption.