IClinktree (web3 alternative of linktree)

As you might know me from vibe coding projects here and there, my last project was ICfirewall and i liked it, so here we are with a new one, i included everything in the readme on github, hope i was helpful, youtube video about it soon on my channel

https://github.com/iTechBod/IClinktree

if you want to see the website live you can check it here:

https://2n2uw-uaaaa-aaaag-at2hq-cai.icp.net

see you around!

v2 is here!
updates:

  1. Social Media Links & Fallback Permissions (setup.py)
  • v1 Behavior: Automatically injected default developer links as inline fallbacks (or "https://...") if any social input was left blank.
  • v2 Changes:
    Defined a dedicated default_socials dictionary upfront.
    Updated inputs to accept empty strings (.strip()) when hitting Enter.
    Added an interactive permission prompt if any social link is skipped: ans = input("\nDo you give permission to use the original dev's links for any blank/skipped social media? (y/n) [default: y]: ").
    Implemented logic to map user-provided links or fallback to default developer links based on that permission choice (support_socials).

2. ICP Ecosystem dApp Referrals & Conditional Rendering (setup.py & index.html)

  • v1 Behavior: dApp links were completely absent from the wizard workflow and hardcoded directly into the template.
  • v2 Changes:
    Added a brand-new — 3. ICP Ecosystem dApp Referrals — interactive setup section covering OpenChat, Clown, Oisy, and Randseed.
    Added a developer support permission prompt for blank dApp fields (y/n).
    Dynamic Conditional Rendering: Created a check (has_icp_section = len(dapps) > 0). If a user skips all dApp fields and declines original developer fallbacks, the entire ICP Ecosystem filter tab and its cards are dynamically omitted from the generated HTML.

3. Dynamic HTML & Template Compilation (assets/index.html)

  • v1 Behavior: Used rigid static string-replacements (__YOUTUBE__, __OPENCHAT__, etc.) inside a fixed HTML structure.
  • v2 Changes:
    Replaced static string replacements with a programmatic list-iteration approach (social_meta and dapp_meta).
    Python dynamically builds filter_pills_html and grid_cards_str, ensuring only active, configured links are written into the DOM.

4. Push Script Synchronization (push.py)

  • v1 Behavior: Hardcoded channel_url = socials['youtube'] directly from the initial raw terminal input.
  • v2 Changes:
    Updated push.py generation to pull dynamically from socials.get('youtube', ...), ensuring the YouTube scraper targets the correct URL even if fallback permissions modified it.

5. Backend Owner Principal Hardcoding & Authorization (backend/main.mo)

  • v1 Behavior: The Motoko backend actor had no concept of an owner Principal ID at the smart contract level.
  • v2 Changes:
    Automatically detects the user’s local dfx principal via get_principal(), falling back to a secure developer principal if uninitialized.
    Injects let OWNER : Principal = Principal.fromText("__OWNER_PRINCIPAL__");directly into backend/main.mo.
    Updates shared canister entry points (logVisit, seedVideos, clearLibrary) to accept message contexts (_msg) to enforce strict controller/owner boundaries for administrative actions.

6. Privacy: Consent-Before-Tracking (assets/script.js)

  • v1 Behavior: Analytics and device ID generation fired immediately on page load, regardless of cookie/consent choices.
  • v2 Changes:
    Introduced the shouldTrack() check to completely block device ID generation, IP geolocation fetching (ipapi.co), and traffic logging unless visitors explicitly click “Accept” on the banner.

7. Safe DOM Rendering (assets/script.js)

  • v1 Behavior: Built and injected complex analytics cards using raw, potentially unsafe innerHTML string templates.
  • v2 Changes:
    Refactored the UI rendering logic to construct elements programmatically using safe document.createElement() and textContent methods, preventing DOM-based vulnerabilities.

8. Cycle Optimization & Capped Log Limits (backend/main.mo)

  • v1 Behavior: Logged all requests linearly, causing potential cycle-burning and bloat over time as visit logs expanded.
  • v2 Changes:
    Separated raw pageViews from totalEvents and implemented independent tracking metrics.
    Enforced a hard log capacity cap (MAX_VISIT_LOGS : Nat = 50_000) paired with rolling 7-day automated data pruning to maintain optimal canister performance and low cycles.

9. Chat Widget Error Handling & Feedback Resilience (assets/script.js)

  • v1 Behavior: If backend canister connections failed or stats couldn’t be fetched, the chat widget would fail silently or display generic placeholders.
  • v2 Changes:
    Added explicit backend verification (if (!backend)), robust error catching (${e.message || 'Error'}), and dynamic text-node feedback directly inside the chat window (botMsg.textContent) to prevent unhandled promise rejections.

V3 is here

1. :key: Threshold Cryptography & Key Derivation (⁠vetKeys⁠)

ICP Management Canister Integration: Interfaces directly with ICP’s native threshold key derivation endpoints (⁠vetkd_public_key⁠ / ⁠vetkd_derive_key⁠).

On-Demand Key Derivation: Replaces static client-side key storage with verifiably derived, threshold-derived keys bound directly to caller identities.

Decentralized Key Exchange: Allows secure key derivation and transport directly on-chain without exposing private decryption keys to intermediate canisters, nodes, or build tools.

2. :locked: End-to-End Encrypted (E2EE) Tickets

Client-Side AES-GCM Wrapping: Contact form submissions are encrypted in the browser using standard Web Crypto (⁠AES-GCM⁠) before transmission.

Zero-Knowledge On-Chain Storage: The backend canister (⁠backend/main.mo⁠) strictly persists ⁠Blob⁠ ciphertexts, ensuring raw message content is never visible to canister nodes, network relays, or unauthorized callers.

Master Principal Decryption: Only the creator authenticated as the Master Owner Principal via Internet Identity (II) can derive decryption keys to read ticket payloads in-browser (⁠getTickets⁠, ⁠clearTickets⁠, ⁠markAllRead⁠).

Automated Expiration Pruning: Retention policies run natively over encrypted blob metadata to purge expired tickets after a configurable retention window (e.g., 7 days) without exposing plaintext contents on-chain.

3. :puzzle_piece: Dual-Principal Architecture & Wizard Overhaul (⁠setup.py⁠)

Publisher PID vs. Master PID Decoupling: Explicitly separates the Publisher/Terminal Principal (the automated deployment key running ⁠dfx deploy⁠ / ⁠push.py⁠) from the Master Owner Principal (the creator’s Internet Identity). This guarantees deployment scripts, automated build pipelines, or CI environments never gain access to private inbox decryption keys.

Dynamic Motoko AST/Code Generation: ⁠setup.py⁠ dynamically compiles tailored Motoko source files (⁠backend/main.mo⁠) enforcing owner checks, ⁠vetKeys⁠ Management Canister interfaces, encrypted ticket storage limits, and retention timers prior to deployment.

Interactive Ticket Configuration: Adds setup prompts to configure ticket system toggles, custom retention windows, and explicit fallback permissions.