Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.
/ receive-kit Public archive

↙️ Easily receive and validate data from share-kit.

Notifications You must be signed in to change notification settings

hellobloom/receive-kit

Repository files navigation

⚠️ Notice ⚠️

This library is no longer maintained.

Receive Kit

Easily receive, validate, and further process data from share-kit.

Summary

Receive-kit implements a single HTTP POST handler endpoint at /api/receive. Requests should contain a JSON body structured like the ResponseData documented in share-kit. Assuming the request structure if valid, the handler then performs the following validations:

  • Basic off-chain data:
    • Validate the shared subject ethereum address matches the address recovered based on the shared packedData and signature.
    • Validate that we're able to recreate the shared packedData value by hashing the JSON representation of the shared data and token.
  • Per node off-chain data:
    • Validate the hash of the shared rootHash and rootHashNonce matches the shared layer2Hash.
    • Validate the shared attester ethereum address matches the address recovered based on the hash of the shared attestation node and its signature.
    • Validate the merkle proof.
  • On-chain data:
    • Validate the shared data hash matches the hash that is on-chain for the shared transaction hash.
    • Validate the shared subject ethereum address matches the address that is on-chain for the shared transaction hash.
    • Validate the shared attester ethereum address matches the address that is on-chain for the shared transaction hash.

Try it out

Deploy

About

↙️ Easily receive and validate data from share-kit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published