Quickstart: your first contract
This uses bkc-starter-hardhat, a ready Hardhat project with the BKC plugin wired in. Five minutes, start to verified contract.
Prerequisites
- Node.js 22+
- A terminal and git
1. Clone and install
git clone https://github.com/bkc-network/bkc-starter-hardhat my-app
cd my-app
npm install
cp .env.example .env2. Create an account
npx hardhat bkc-new-accountIt prints a 32-byte seed and the account's bkc1… and 0x… addresses. Put the seed in .env:
# .env — gitignored; keep it that way
BKC_SEED=0x… # the seed bkc-new-account printed
BKC_EVM_RPC=https://rpc.bkc.network
BKC_COSMOS_RPC=https://comet-rpc.bkc.network
BKC_EXPLORER=https://explorer.bkc.networkFund the address at the faucet.
The seed is not a private key
BKC keys are ML-DSA-65. The seed is what the key is derived from; a secp256k1 private key from MetaMask means nothing here. The BKC Wallet can export the same kind of seed.
3. Check everything
npm run doctorReady to deploy.
ok EVM endpoint https://rpc.bkc.network · chain 262144
ok Cosmos endpoint https://comet-rpc.bkc.network · bkc-testnet
ok account bkc1…
ok 0x…
ok balance 1 BKC
ok gas price 5000000bkcEvery failing line says what to do. A fresh, unfunded account fails balance.
4. Deploy
npm run deploydeploying from 0x…
Counter 0x268f598Cc797A9B1ed1E3eb3619F8ef59d288c76
increment() 0x…
value 1
next: npm run verify -- 0x268f598Cc797A9B1ed1E3eb3619F8ef59d288c76scripts/deploy.js is ordinary Hardhat code:
const counter = await (await hre.ethers.getContractFactory("Counter")).deploy();
await counter.waitForDeployment();
await (await counter.increment()).wait();5. Verify on the explorer
npm run verify -- 0xYourContractThe source appears on explorer.bkc.network. With constructor arguments, pass them after the address. See Verify contracts for what Blockscout does differently.
6. Test against the chain
npm testTests in test/ run against the live network through the same plugin.
What just happened
Nothing in your code mentions ML-DSA. The plugin intercepted the deployment's eth_sendTransaction, wrapped it in a MsgExecuteEvmCall, signed it with your seed and broadcast it through CometBFT RPC; the chain ran it in the EVM and returned an ordinary Ethereum hash and receipt. Details: Transactions & EVM calls.
