# Introducing Phage
<!-- .slide: data-background="https://hackmd.io/_uploads/S1PanyS62.png" -->
## Programmable Transaction Middleware for Ethereum Nodes
---
## Phage is a rust based library that provides programmable transaction middleware for Ethereum nodes
---
### Current transaction broadcasting infrastructure is passive

---
### Existing protection tools are concentrated on the wallet layer

---
## Phage modules enable nodes to make automated decisions

---
## With Phage you can build...
✅ Custom RPC methods
✅ Intelligent transaction routing
✅ Real time threat interception
✅ Invisible policy enforcement & alerting
---
## Build modules in 3 steps
### Define the services
### Define the rules
### Install on your node
---
### Modules contain hooks for external services

---
<!-- .slide: data-background="https://hackmd.io/_uploads/ryULj1Ha3.png" data-background-color="#005" -->
## Rules are defined using Banyan
### The declarative policy language for modules based on Cedar by AWS

---
<!-- .slide: data-background="https://hackmd.io/_uploads/ryULj1Ha3.png" data-background-color="#005" -->
## Define transaction rules based on decoded & enriched transaction data
``` javascript [1|3|4-8|9]
@name("WARN-NATIVE-ASSET-THRESHOLD")
@advice("Warn when sending funds over X threshold")
@notification("WEBHOOK-e03a0aa1")
forbid (
principal,
action == Action::"EOATransaction",
resource
)
when { context.value.u256GreaterThan(principal.valueLimit) };
```
---
### Use modules to dynamically route & bundle transactions

---
### Enrich MPC transaction services with policies & detailed context

---
### Intercept threats with external datasets & AI models

---
## Read More
* https://hackmd.io/@shield3/intro-phage
* https://github.com/ipatka/banyan
* Twitter: @isaacpatka
{"title":"SLIDES Introducing Phage, Programmable Transaction Middleware by Shield3","description":"Programmable Transaction Middleware for Ethereum Nodes","slideOptions":"{\"transition\":\"fade\"}","image":"https://hackmd.io/_uploads/S1JHAgS6h.png","contributors":"[{\"id\":\"e8ca9a78-d9ca-46a7-ba49-7089e65d8c39\",\"add\":7818,\"del\":5596}]"}