Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 248 lines 6.6 kB view raw view rendered
1# KidLisp FA2 Contract Specification 2 3*For Feral File Integration* 4*Date: September 1, 2025* 5 6## Contract Overview 7 8**Name**: KidLisp Creative Tokens 9**Symbol**: KIDLISP 10**Standard**: FA2 (Tezos Fungible Asset Standard) 11**Type**: 1/1 Unique Tokens (Non-Fungible) 12 13## Fee Structure 14 15### Minting Fees (Paid by User) 16- **Feral File Device Fee**: 2.5% of mint price 17- **Aesthetic Computer Development Fee**: 2.5% of mint price 18- **Objkt Marketplace Fee**: 2.5% of mint price 19- **Creator Receives**: 92.5% of mint price 20 21### Secondary Sales (Automatic Royalties) 22- **Creator Royalty**: 10% 23- **Feral File Fee**: 2.5% 24- **Aesthetic Computer Fee**: 2.5% 25- **Objkt Fee**: 2.5% (handled by marketplace) 26 27## Smart Contract Functions 28 29### Core FA2 Functions 30```python 31# Standard FA2 interface 32def transfer(params): 33 # Handle token transfers with royalty calculations 34 35def balance_of(params): 36 # Return token balances 37 38def update_operators(params): 39 # Manage token operators 40``` 41 42### KidLisp-Specific Functions 43```python 44def mint_kidlisp_token(code_hash, creator_address, metadata_uri, mint_price): 45 """ 46 Mint a new 1/1 KidLisp token 47 48 Args: 49 code_hash: SHA-256 hash of KidLisp source code 50 creator_address: Tezos address of the creator 51 metadata_uri: IPFS/HTTP URI for token metadata 52 mint_price: Price in mutez (1 tez = 1,000,000 mutez) 53 54 Fees automatically distributed: 55 - Feral File: mint_price * 0.025 56 - Aesthetic Computer: mint_price * 0.025 57 - Objkt: mint_price * 0.025 58 - Creator: mint_price * 0.925 59 """ 60 61def get_token_for_hash(code_hash): 62 """ 63 Check if token exists for given code hash 64 Returns: token_id or None 65 """ 66 67def get_creator(token_id): 68 """ 69 Get original creator address for token 70 """ 71 72def get_code_hash(token_id): 73 """ 74 Get original KidLisp code hash for token 75 """ 76 77def update_fees(new_feral_fee, new_ac_fee, new_objkt_fee): 78 """ 79 Admin function to update fee percentages 80 Only callable by contract admin 81 """ 82``` 83 84## Storage Structure 85 86```python 87{ 88 # Token storage 89 "tokens": big_map(token_id -> { 90 "owner": address, 91 "creator": address, 92 "code_hash": string, 93 "metadata_uri": string, 94 "mint_timestamp": timestamp, 95 "mint_price": mutez 96 }), 97 98 # Code hash to token mapping (prevent duplicates) 99 "code_to_token": big_map(code_hash -> token_id), 100 101 # Fee recipients 102 "feral_file_address": address, 103 "aesthetic_computer_address": address, 104 "objkt_address": address, 105 106 # Fee percentages (in basis points, 250 = 2.5%) 107 "feral_fee_bp": nat, 108 "ac_fee_bp": nat, 109 "objkt_fee_bp": nat, 110 "creator_royalty_bp": nat, 111 112 # Admin 113 "admin": address, 114 "next_token_id": nat, 115 116 # FA2 required storage 117 "ledger": big_map((address, token_id) -> nat), 118 "operators": big_map((address, address, token_id) -> unit), 119 "token_metadata": big_map(token_id -> token_metadata) 120} 121``` 122 123## Metadata Format 124 125```json 126{ 127 "name": "KidLisp Creation #001", 128 "description": "Interactive code art created with KidLisp", 129 "image": "https://aesthetic.computer/$abc123.png", 130 "animation_url": "https://aesthetic.computer/$abc123", 131 "attributes": [ 132 { 133 "trait_type": "Creator Handle", 134 "value": "@alice" 135 }, 136 { 137 "trait_type": "Code Hash", 138 "value": "a1b2c3..." 139 }, 140 { 141 "trait_type": "Creation Date", 142 "value": "2025-09-01" 143 }, 144 { 145 "trait_type": "Device", 146 "value": "Feral File FF-X1" 147 }, 148 { 149 "trait_type": "Code Length", 150 "value": 156 151 }, 152 { 153 "trait_type": "Functions Used", 154 "value": ["wipe", "ink", "circle", "line"] 155 } 156 ], 157 "external_url": "https://aesthetic.computer/$abc123", 158 "kidlisp_source": "(wipe blue)\n(ink red)\n(circle 50 50 25)" 159} 160``` 161 162## Minting Flow 163 1641. **User Creates KidLisp Piece** 165 - Code gets cached as `$abc123` 166 - SHA-256 hash generated: `a1b2c3d4e5f6...` 167 1682. **User Chooses to Mint** 169 - Clicks "Make This a 1/1 Token" in FF-X1 interface 170 - Sets mint price (minimum 1 tez) 171 1723. **Contract Validation** 173 - Check if token already exists for this code hash 174 - If exists: reject with error "Token already minted" 175 - If new: proceed with minting 176 1774. **Fee Distribution** 178 ``` 179 Mint Price: 10 tez 180 - Feral File: 0.25 tez (2.5%) 181 - Aesthetic Computer: 0.25 tez (2.5%) 182 - Objkt: 0.25 tez (2.5%) 183 - Creator: 9.25 tez (92.5%) 184 ``` 185 1865. **Token Creation** 187 - Mint token with unique ID 188 - Store metadata on IPFS 189 - Emit mint event for indexers 190 191## Secondary Sales Royalties 192 193When token is sold on Objkt or other marketplaces: 194 195``` 196Sale Price: 50 tez 197- Seller: 42.5 tez (85%) 198- Creator Royalty: 5 tez (10%) 199- Feral File: 1.25 tez (2.5%) 200- Aesthetic Computer: 1.25 tez (2.5%) 201``` 202 203Royalties enforced through FA2 transfer hooks that calculate and distribute fees automatically. 204 205## Security Features 206 207- **Duplicate Prevention**: Code hash mapping prevents multiple tokens for same code 208- **Creator Verification**: Only authenticated users can mint tokens 209- **Admin Controls**: Fee updates require admin approval 210- **Audit Trail**: All mints/transfers logged for transparency 211 212## Integration Points 213 214### Aesthetic Computer 215- [Auto-minting backend](https://github.com/whistlegraph/aesthetic-computer/blob/main/system/netlify/functions/store-kidlisp.mjs#L845-L870) 216- [Tezos integration](https://github.com/whistlegraph/aesthetic-computer/blob/main/tezos/src/integration.js) 217 218### Feral File FF-X1 219- iframe integration via `window.postMessage` 220- "Mint Token" button in KidLisp interface 221- Gallery view of minted pieces 222 223### Objkt Marketplace 224- Automatic token indexing 225- Secondary sales with royalty distribution 226- Collection page for KidLisp tokens 227 228## Deployment Plan 229 2301. **Testnet Deployment** (Ghostnet) 231 - Deploy contract with test addresses 232 - Integration testing with AC backend 233 - FF-X1 device testing 234 2352. **Mainnet Deployment** 236 - Deploy to Tezos mainnet 237 - Update AC production endpoints 238 - Go live with FF-X1 integration 239 2403. **Marketplace Integration** 241 - Register collection with Objkt 242 - Configure royalty settings 243 - Launch gallery curation 244 245--- 246 247**Contract Repository**: [tezos/KidLisp/](https://github.com/whistlegraph/aesthetic-computer/tree/main/tezos/KidLisp) 248**Integration Code**: [tezos/src/integration.js](https://github.com/whistlegraph/aesthetic-computer/blob/main/tezos/src/integration.js)