This project provides a template for verifying Ethereum addresses on the Base network. It includes two main verification methods: balance checking and transaction history verification.
VERIFIER-TEMPLATE
├── api
│ ├── balance-of-eth-base.ts
│ ├── create-tx-base.ts
│ └── signature.ts
├── test
│ └── verify.test.ts
├── .env
├── .env.sample
├── .gitignore
├── bun.lockb
├── jest.config.js
├── package.json
├── README.md
└── tsconfig.json
- Balance Verification: Checks if an address has a minimum balance of 0.1 ETH on the Base network.
- Transaction Verification: Verifies if an address has any transactions on the Base network.
- Signature Generation: Creates a signature for verified addresses.
- Clone the repository
- Install dependencies:
bun install
- Copy
.env.sample
to.env
and fill in the required values:BASESCAN_API_KEY=your_basescan_api_key SIGNER_PRIVATE_KEY=your_private_key
The balance-of-eth-base.ts
file contains the logic for checking an address's balance on the Base network.
The create-tx-base.ts
file handles the verification of an address's transaction history using the Basescan API.
To run the tests:
bun run test
The project is designed to be deployed as serverless functions. The main handler functions are:
/api/balance-of-eth-base
: Checks the balance of a given address/api/create-tx-base
: Verifies the transaction history of a given address
Both endpoints return a JSON response with the verification result and a signature.
BASESCAN_API_KEY
: Your Basescan API key for accessing the Basescan APISIGNER_PRIVATE_KEY
: Private key used for signing the verification results
This project is designed to be deployed as serverless functions using Vercel Functions. Each file in the api directory corresponds to a serverless function:
/api/balance-of-eth-base: Checks the balance of a given address /api/create-tx-base: Verifies the transaction history of a given address
Both endpoints return a JSON response with the verification result and a signature.
Please also setup environment values to your vercel.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT