Custom Threat Detection
Overview
The process of building custom detection models involves the following steps:
Write a web-service that conforms to the External Detector API specification listed below
Add your web-service as a new detector in your Venn node client configuration
When the Venn node client receives a request to inspect a transaction, it will now use your configured web-service for the detection stage
Your web-service responds with the detection results
That's it!
You can use the boilerplate template to build custom detection solutions on the Venn Network.
External Detector API
v0.8
[BETA]
Inspection Request
POST
/detect
A web-service over HTTP that is used by Venn node clients to inspect transactions
Headers
Content-Type
application/json
Body
Id
string
The unique identifier for the request.
Yes
ChainId
int64
The identifier of the Ethereum chain.
Yes
Hash
string
The hash of the transaction. (In Signer mode, it's the Hash of the transaction payload)
Yes
ProtocolName
string
The name of the protocol associated with the transaction.
Yes
ProtocolAddress
string
The address of the protocol associated with the transaction.
Yes
Trace
JSON
Yes
AdditionalData
JSON
Additional data associated with the transaction.
No
Inspection Response
Your web-service should always respond with a 200 OK
HTTP response code.
Errors should be indicated using the boolean Error
field, with a helpful error message in the Message
field
RequestId
string
The unique identifier for the corresponding request.
Yes
ChainId
int64
The identifier of the Ethereum chain.
Yes
Detected
bool
Indicates whether the transaction is malicious
Yes
Error
bool
Indicates whether an error occurred during processing.
No
Message
string
An optional message providing additional information.
No
ProtocolAddress
string
The address of the protocol associated with the transaction.
No
ProtocolName
string
The name of the protocol associated with the transaction.
No
AdditionalData
JSON
Additional data associated with the response.
No
Payload Examples
Last updated
Was this helpful?