A simple, payload signing backend application that validates Cloudflare Turnstile tokens and generates signed payloads for wallet addresses. In connection with Flaunch UI and Flaunch protocol it's meant to act as anti-bot solution for Fair Launches.
Users, before they can buy / sell tokens need to pass Cloudflare Turnstile challenge, which provides the UI with signature, which then is passed into this app, which then validates it against Cloudflare and returns signed payload, which then is verified on protocol level for validity.
Full documentation - https://docs.google.com/document/d/1DoQObCZJZD4lFTo6dtTUgGcTUyt7Eu9AiNwIleLQPL0
├── cmd/
│ └── server/ # Application entry point
│ └── main.go
├── internal/
│ ├── config/ # Configuration management
│ │ └── config.go
│ ├── handler/ # HTTP request handlers
│ │ └── handler.go
│ ├── models/ # Data structures
│ │ └── payload.go
│ └── service/ # Business logic services
│ ├── turnstile.go # Turnstile verification
│ └── signer.go # Payload signing
├── bin/ # Build output directory
├── Makefile # Build automation
├── go.mod
└── go.sum
The application requires the following environment variables:
# Server Configuration
PORT=8080 # Optional, defaults to 8080
# Cloudflare Turnstile Configuration
TURNSTILE_SECRET_KEY=your_turnstile_secret_key # Required
# Wallet Configuration
SIGNER_PRIVATE_KEY=your_private_key_here # Required (without 0x prefix)
# Payload deadline in minutes (default: 5 minutes)
PAYLOAD_DEADLINE=5 # Optional, defaults to 5# Build the binary
make build
# Run the application
make run
# Run in development mode (with go run)
make dev
# Build for multiple platforms
make build-cross
# Clean build artifacts
make clean
# Run tests
make test
# Show all available targets
make help# Build
go build -o ./bin/flaunch-anti-bot ./cmd/server
# Run
./bin/flaunch-anti-bot
# Or run directly
go run ./cmd/serverValidates a Turnstile token and generates a signed payload.
Request:
{
"token": "turnstile_token",
"walletAddress": "0x1234567890123456789012345678901234567890"
}Response (Success):
{
"success": true,
"message": "Payload generated successfully",
"payload": {
"wallet": "0x1234567890123456789012345678901234567890",
"deadline": 1640995200,
"signature": "0x...",
"signer": "0x..."
}
}Response (Failure):
{
"success": false,
"message": "Captcha verification failed",
"payload": null
}Health check endpoint.
Response:
{
"status": "healthy"
}# Run tests
make test- The application uses Ethereum-style message signing
- CORS is configured to allow all origins by default (configurable)
- Input validation is performed on wallet addresses
- Turnstile tokens are verified against the requesting IP address