BitTonica is a blockchain protocol that bridges Bitcoin Ordinals to the TON blockchain, enabling seamless Ordinal NFT representation and ownership on TON.
BitTonica allows users to mint NFTs on the TON blockchain that represent their Bitcoin Ordinals. The system includes smart contract verification, multi-verifier authentication, and optimized gas management to ensure a secure and efficient bridging process.
contracts/- Source code of all the smart contracts and their dependencieswrappers/- Wrapper classes for the contracts, including serialization primitives and compilation functionstests/- Tests for the contractsscripts/- Utility scripts, mainly for deploymentbackend/- Backend services for monitoring and verification
# Install dependencies
npm install ton@latest
# Build, test, or run scripts
npx blueprint build
npx blueprint test
npx blueprint run [script-name]
# Create a new contract
npx blueprint create AnotherContract- Ordinal Representation: Mint TON NFTs representing Bitcoin Ordinals
- Duplicate Prevention: Ensures the same Ordinal cannot be minted twice
- Gas Optimization: Optimized gas usage with excess refund mechanisms
- Multi-Verifier Support: Enhanced security through multiple verification nodes
- Secure Transaction Flow: Streamlined and secure minting process
- Event Listeners: Monitors for minting requests and Bitcoin wallet inscriptions
- Verification System: Validates Ordinal ownership through transaction IDs and signatures
- Secure Bridge: Ensures only verified Ordinals can be represented on TON
- User initiates Ordinal minting request on TON
- Backend listener (
index.js) captures the event - Bitcoin wallet monitor (
ordinal_listener.py) confirms inscription details - Verifier checks transaction ID, inscription ID, and signature
- Smart contract mints the corresponding NFT on TON
- ✅ TON smart contracts completed
⚠️ Backend services partially implemented- 🔄 Verification system in development
- Telegram Mini App Marketplace: Developing a marketplace on Telegram Mini App using the TON network where users can sell their NFTs
- Support for native TON payments
- Integration with TGBTC payments through TON API
- TGBTC Integration: Implementing TGBTC payment gateway using the TON API
- User Interface: Building intuitive UI for minting, buying, and selling Ordinals
- Transaction History: Adding functionality to track and display transaction history
- Collection Management: Tools for users to manage their Ordinal collections
- Search and Discovery: Features to browse and discover Ordinals on the marketplace
// Example of gas optimization with refunds
let excess = ctx.value - required_fee;
if (excess > 0) {
send(SendParameters{
to: sender(),
value: excess,
bounce: false,
mode: SendIgnoreErrors
});
}- Prevention of reentrancy attacks
- Protection against integer overflows
- Authorization checks for minting operations
- Multi-verifier consensus for enhanced security