From ce1e26b1768e0b3665be082feb2ffcc2dcbd8a7c Mon Sep 17 00:00:00 2001 From: Tsuki Date: Sat, 18 Apr 2026 13:43:39 +0800 Subject: [PATCH 1/6] Create TERMS.md --- PiRC2/TERMS.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 PiRC2/TERMS.md diff --git a/PiRC2/TERMS.md b/PiRC2/TERMS.md new file mode 100644 index 000000000..f6e26f051 --- /dev/null +++ b/PiRC2/TERMS.md @@ -0,0 +1,50 @@ +# Terms of Service + +Last updated: 2026 + +## 1. Acceptance of Terms +By accessing or using PiRC ("Service"), you agree to be bound by these Terms. + +## 2. Description of Service +PiRC provides validation APIs including but not limited to: +- Email validation +- Crypto address validation +- URL validation + +## 3. Accounts & API Keys +- Users must keep API keys secure +- You are responsible for all activity under your account + +## 4. Usage Limits +- Free tier: limited requests/day +- Paid plans: based on subscription +- Abuse or excessive usage may result in suspension + +## 5. Prohibited Use +You agree NOT to: +- Use the service for illegal activities +- Attempt to reverse engineer or exploit the API +- Bypass rate limits or authentication + +## 6. Payments +- Paid plans are billed monthly +- No refunds unless required by law +- We may change pricing with prior notice + +## 7. Termination +We reserve the right to suspend or terminate accounts at any time for violations. + +## 8. Disclaimer +Service is provided "as is" without warranties. + +## 9. Limitation of Liability +We are not liable for: +- Data loss +- Financial loss +- Service interruptions + +## 10. Changes to Terms +We may update these Terms at any time. + +## 11. Contact +Email: your@email.com \ No newline at end of file From 6b1c1040bb2328aa8bd309d575bdac904e8e9ad1 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Sat, 18 Apr 2026 13:44:32 +0800 Subject: [PATCH 2/6] Create PRIVACY.md --- PiRC2/PRIVACY.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 PiRC2/PRIVACY.md diff --git a/PiRC2/PRIVACY.md b/PiRC2/PRIVACY.md new file mode 100644 index 000000000..3186c1a8a --- /dev/null +++ b/PiRC2/PRIVACY.md @@ -0,0 +1,38 @@ +# Privacy Policy + +Last updated: 2026 + +## 1. Information We Collect +We may collect: +- Email address +- API usage data +- IP address + +## 2. How We Use Data +- To provide and improve our service +- To monitor usage and prevent abuse +- For billing purposes + +## 3. Data Sharing +We do NOT sell user data. + +We may share data with: +- Payment providers +- Legal authorities if required + +## 4. Data Security +We implement reasonable security measures to protect data. + +## 5. Cookies +We may use cookies for analytics and authentication. + +## 6. User Rights +You may request: +- Data deletion +- Account removal + +## 7. Changes +We may update this policy at any time. + +## 8. Contact +Email: your@email.com \ No newline at end of file From a372b134f8a0f063dcd6e90d5c7e4e7e7558a152 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Sat, 18 Apr 2026 21:35:17 +0800 Subject: [PATCH 3/6] Create codeql.yml --- .github/workflows/codeql.yml | 97 ++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..6b8f1ce7d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,97 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '18 4 * * 6' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹ️ Command-line programs to run using the OS shell. + # πŸ“š See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" From 958da1e0ba5749ddd28556e067f15dabfa4d45e9 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Thu, 23 Apr 2026 21:13:33 +0800 Subject: [PATCH 4/6] Create SKILL.md --- SKILL.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 SKILL.md diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 000000000..1dff30b1d --- /dev/null +++ b/SKILL.md @@ -0,0 +1,42 @@ +--- +name: frontend-design +description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics. +license: Complete terms in LICENSE.txt +--- + +This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices. + +The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints. + +## Design Thinking + +Before coding, understand the context and commit to a BOLD aesthetic direction: +- **Purpose**: What problem does this interface solve? Who uses it? +- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction. +- **Constraints**: Technical requirements (framework, performance, accessibility). +- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember? + +**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity. + +Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is: +- Production-grade and functional +- Visually striking and memorable +- Cohesive with a clear aesthetic point-of-view +- Meticulously refined in every detail + +## Frontend Aesthetics Guidelines + +Focus on: +- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font. +- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. +- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise. +- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density. +- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays. + +NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character. + +Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations. + +**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well. + +Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision. \ No newline at end of file From 0576b42e78ccbd7ea313180ba32027ec1696f249 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Thu, 23 Apr 2026 21:34:31 +0800 Subject: [PATCH 5/6] Create generate_logo_v2.py --- PiRC2/Logo-keypair-addres/generate_logo_v2.py | 441 ++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 PiRC2/Logo-keypair-addres/generate_logo_v2.py diff --git a/PiRC2/Logo-keypair-addres/generate_logo_v2.py b/PiRC2/Logo-keypair-addres/generate_logo_v2.py new file mode 100644 index 000000000..2a66ebbbe --- /dev/null +++ b/PiRC2/Logo-keypair-addres/generate_logo_v2.py @@ -0,0 +1,441 @@ +""" +Logo generator v2 β€” Public/Private Key Demo +Refined for museum-quality craftsmanship. +""" + +import math +import random +from PIL import Image, ImageDraw, ImageFont, ImageFilter + +random.seed(42) + +FONT_DIR = "/mnt/skills/examples/canvas-design/canvas-fonts" + +W, H = 1200, 630 + +# ── Palette ────────────────────────────────────────────────────────────────── +BG = (7, 8, 13) +GOLD = (210, 172, 70) +GOLD_MID = (130, 100, 38) +GOLD_DIM = (55, 42, 14) +TEAL = (32, 168, 124) +TEAL_MID = (18, 96, 70) +TEAL_DIM = (10, 42, 30) +WHITE = (230, 234, 244) +MUTED = (80, 90, 112) +DIM = (28, 32, 48) +LINE = (36, 42, 62) + +img = Image.new("RGB", (W, H), BG) +draw = ImageDraw.Draw(img) + +def font(name, size): + try: + return ImageFont.truetype(f"{FONT_DIR}/{name}", size) + except: + return ImageFont.load_default() + +f_jet_sm = font("JetBrainsMono-Regular.ttf", 12) +f_jet_md = font("JetBrainsMono-Regular.ttf", 15) +f_jet_b = font("JetBrainsMono-Bold.ttf", 22) +f_jura = font("Jura-Light.ttf", 13) +f_jura_m = font("Jura-Medium.ttf", 15) +f_outfit = font("Outfit-Bold.ttf", 44) +f_out_sm = font("Outfit-Regular.ttf", 17) +f_work_b = font("WorkSans-Bold.ttf", 11) + +# ── Dot grid ───────────────────────────────────────────────────────────────── +for gx in range(0, W + 28, 28): + for gy in range(0, H + 28, 28): + col = (14, 16, 24) + draw.ellipse([gx-1, gy-1, gx+1, gy+1], fill=col) + +# ── Scanlines ───────────────────────────────────────────────────────────────── +for y in range(0, H, 3): + draw.line([(0, y), (W, y)], fill=(10, 11, 18), width=1) + +# ── Diagonal accent lines (atmosphere) ─────────────────────────────────────── +for i in range(10): + x1 = random.randint(0, W) + draw.line([(x1, 0), (x1 + 60, H)], fill=(16, 18, 28), width=1) + +# ───────────────────────────────────────────────────────────────────────────── +# HELPER: draw a refined lock icon +# ───────────────────────────────────────────────────────────────────────────── +def draw_lock_closed(cx, cy, color, col_dim, size=1.0): + s = size + # shackle + draw.arc([int(cx-26*s), int(cy-46*s), int(cx+26*s), int(cy+8*s)], + 195, 345, fill=color, width=3) + # body outer + draw.rounded_rectangle([int(cx-32*s), int(cy-6*s), int(cx+32*s), int(cy+38*s)], + radius=4, fill=(12, 10, 6), outline=color, width=2) + # inner body panel + draw.rounded_rectangle([int(cx-26*s), int(cy), int(cx+26*s), int(cy+32*s)], + radius=2, fill=(18, 14, 6), outline=col_dim, width=1) + # keyhole oval + draw.ellipse([int(cx-8*s), int(cy+6*s), int(cx+8*s), int(cy+20*s)], + fill=BG, outline=color, width=2) + # keyhole slot + draw.rectangle([int(cx-4*s), int(cy+16*s), int(cx+4*s), int(cy+30*s)], fill=BG) + +def draw_lock_open(cx, cy, color, col_dim, size=1.0): + s = size + # shackle open (lifted left side) + draw.arc([int(cx-26*s), int(cy-48*s), int(cx+26*s), int(cy+6*s)], + 200, 360, fill=color, width=3) + # lifted right tip + draw.line([int(cx+26*s), int(cy-21*s), int(cx+26*s), int(cy-52*s)], fill=color, width=3) + draw.ellipse([int(cx+22*s), int(cy-56*s), int(cx+30*s), int(cy-48*s)], + fill=color) + # body + draw.rounded_rectangle([int(cx-32*s), int(cy-6*s), int(cx+32*s), int(cy+38*s)], + radius=4, fill=(6, 14, 10), outline=color, width=2) + draw.rounded_rectangle([int(cx-26*s), int(cy), int(cx+26*s), int(cy+32*s)], + radius=2, fill=(8, 18, 13), outline=col_dim, width=1) + # keyhole + draw.ellipse([int(cx-8*s), int(cy+6*s), int(cx+8*s), int(cy+20*s)], + fill=BG, outline=color, width=2) + draw.rectangle([int(cx-4*s), int(cy+16*s), int(cx+4*s), int(cy+30*s)], fill=BG) + +# ───────────────────────────────────────────────────────────────────────────── +# LEFT PANEL β€” PRIVATE KEY +# ───────────────────────────────────────────────────────────────────────────── +PX, PY, PW, PH = 52, 88, 348, 450 + +# Outer glow layers +for i in range(20, 0, -1): + intensity = i / 20 + r = int(GOLD[0] * intensity * 0.22) + g = int(GOLD[1] * intensity * 0.10) + draw.rectangle([PX-i, PY-i, PX+PW+i, PY+PH+i], + outline=(max(r,0), max(g,0), 0)) + +# Panel +draw.rectangle([PX, PY, PX+PW, PY+PH], fill=(10, 9, 5), outline=GOLD_DIM, width=1) +# Top bar +draw.rectangle([PX, PY, PX+PW, PY+4], fill=GOLD) +# Inner inset line +draw.rectangle([PX+8, PY+12, PX+PW-8, PY+12], fill=GOLD_DIM) + +# Label row +draw.text((PX+20, PY+18), "PRIVATE KEY", font=f_work_b, fill=GOLD) +# 3 dots (terminal indicator) +for d in range(3): + draw.ellipse([PX+PW-30+d*10, PY+22, PX+PW-24+d*10, PY+28], fill=GOLD_DIM) + +draw.line([(PX+20, PY+38), (PX+PW-20, PY+38)], fill=GOLD_DIM, width=1) + +# Hex key bytes β€” staggered brightness +rows = [ + "18 e1 4a 7b 6a 30 7f 42", + "6a 94 f8 11 47 01 e7 c8", + "e7 74 e7 f9 a4 7e 2c 20", + "35 db 29 a2 06 32 17 25", +] +y_hex = PY + 52 +for row in rows: + x_hex = PX + 20 + for ch in row: + if ch == ' ': + x_hex += 8 + continue + bright = random.uniform(0.45, 1.0) + col = tuple(int(c * bright) for c in GOLD) + draw.text((x_hex, y_hex), ch, font=f_jet_md, fill=col) + x_hex += 13 + y_hex += 24 + +draw.line([(PX+20, y_hex+4), (PX+PW-20, y_hex+4)], fill=GOLD_DIM, width=1) + +# Lock icon centered +LOCK_CX = PX + PW//2 +LOCK_CY = y_hex + 100 +draw_lock_closed(LOCK_CX, LOCK_CY, GOLD, GOLD_DIM) + +# Technical annotations +y_ann = LOCK_CY + 68 +draw.line([(PX+20, y_ann), (PX+PW-20, y_ann)], fill=GOLD_DIM, width=1) +y_ann += 12 +draw.text((PX+20, y_ann), "curve secp256k1", font=f_jura, fill=GOLD_MID) +y_ann += 20 +draw.text((PX+20, y_ann), "entropy 256 bit", font=f_jura, fill=GOLD_MID) +y_ann += 20 +draw.text((PX+20, y_ann), "op SIGN(msg, k) β†’ Οƒ", font=f_jet_sm, fill=GOLD_DIM) + +# ───────────────────────────────────────────────────────────────────────────── +# RIGHT PANEL β€” PUBLIC KEY +# ───────────────────────────────────────────────────────────────────────────── +RX = W - 52 - PW +RY, RW, RH = PY, PW, PH + +for i in range(20, 0, -1): + intensity = i / 20 + g2 = int(TEAL[1] * intensity * 0.22) + b2 = int(TEAL[2] * intensity * 0.12) + draw.rectangle([RX-i, RY-i, RX+RW+i, RY+RH+i], + outline=(0, max(g2,0), max(b2,0))) + +draw.rectangle([RX, RY, RX+RW, RY+RH], fill=(5, 10, 8), outline=TEAL_DIM, width=1) +draw.rectangle([RX, RY, RX+RW, RY+4], fill=TEAL) +draw.rectangle([RX+8, RY+12, RX+RW-8, RY+12], fill=TEAL_DIM) + +draw.text((RX+20, RY+18), "PUBLIC KEY", font=f_work_b, fill=TEAL) +for d in range(3): + draw.ellipse([RX+RW-30+d*10, RY+22, RX+RW-24+d*10, RY+28], fill=TEAL_DIM) + +draw.line([(RX+20, RY+38), (RX+RW-20, RY+38)], fill=TEAL_DIM, width=1) + +pub_rows = [ + "04 50 86 3a d6 4a 87 ae", + "8a 2f e8 3c 1a f1 a8 40", + "3c b5 3f 53 e4 86 d8 51", + "1d ad 8a 04 88 7e 5b 23", + "52 2c d4 70 24 34 53 a2", + "99 fa 9e 77 23 77 16 10", +] +y_hex2 = RY + 52 +for row in pub_rows: + x_hex = RX + 20 + for ch in row: + if ch == ' ': + x_hex += 8 + continue + bright = random.uniform(0.45, 1.0) + col = tuple(int(c * bright) for c in TEAL) + draw.text((x_hex, y_hex2), ch, font=f_jet_md, fill=col) + x_hex += 13 + y_hex2 += 22 + +draw.line([(RX+20, y_hex2+4), (RX+RW-20, y_hex2+4)], fill=TEAL_DIM, width=1) + +RLOCK_CX = RX + RW//2 +RLOCK_CY = y_hex2 + 80 +draw_lock_open(RLOCK_CX, RLOCK_CY, TEAL, TEAL_DIM) + +y_ann2 = RLOCK_CY + 68 +draw.line([(RX+20, y_ann2), (RX+RW-20, y_ann2)], fill=TEAL_DIM, width=1) +y_ann2 += 12 +draw.text((RX+20, y_ann2), "format 04 + x + y (65 B)", font=f_jura, fill=TEAL_MID) +y_ann2 += 20 +draw.text((RX+20, y_ann2), "usage shareable address", font=f_jura, fill=TEAL_MID) +y_ann2 += 20 +draw.text((RX+20, y_ann2), "op VERIFY(msg, Οƒ, Q)", font=f_jet_sm, fill=TEAL_DIM) + +# ───────────────────────────────────────────────────────────────────────────── +# CENTER β€” Transform zone +# ───────────────────────────────────────────────────────────────────────────── +CX = W // 2 +CY = H // 2 + +# Background center glow (very subtle) +for r in range(90, 0, -5): + alpha = int(3 * (1 - r/90)) + draw.ellipse([CX-r, CY-r, CX+r, CY+r], fill=(10+alpha, 12+alpha, 20+alpha)) + +# Horizontal arrow +AY = CY - 10 +arrow_x1 = PX + PW + 22 +arrow_x2 = RX - 22 + +# Arrow line with gradient effect β€” draw segments +segs = 30 +for i in range(segs): + t = i / segs + x_a = int(arrow_x1 + (arrow_x2 - arrow_x1) * t) + x_b = int(arrow_x1 + (arrow_x2 - arrow_x1) * (i+1)/segs) + if t < 0.5: + s = t * 2 + col = tuple(int(GOLD[j]*(1-s) + WHITE[j]*s) for j in range(3)) + else: + s = (t - 0.5) * 2 + col = tuple(int(WHITE[j]*(1-s) + TEAL[j]*s) for j in range(3)) + draw.line([(x_a, AY), (x_b, AY)], fill=col, width=2) + +# Arrowhead (teal) +draw.polygon([(arrow_x2, AY-8), (arrow_x2, AY+8), (arrow_x2+14, AY)], fill=TEAL) + +# Γ—G multiplication symbol +draw.text((CX, AY - 24), "Γ— G", font=f_jet_b, fill=WHITE, anchor="mm") + +# Dotted vertical dividers on arrow +for xd in [CX - 60, CX + 60]: + for yd in range(AY - 18, AY + 20, 5): + draw.ellipse([xd, yd, xd+2, yd+2], fill=LINE) + +# SHA-256 + ECDSA stacked +y_mid = AY + 30 +draw.text((CX, y_mid), "SHA-256", font=f_jura_m, fill=MUTED, anchor="mm") +y_mid += 18 +draw.line([(CX-22, y_mid), (CX+22, y_mid)], fill=LINE, width=1) +y_mid += 12 +draw.text((CX, y_mid), "ECDSA", font=f_jura_m, fill=MUTED, anchor="mm") +y_mid += 18 +draw.line([(CX-22, y_mid), (CX+22, y_mid)], fill=LINE, width=1) + +# Abstract elliptic curve arc +EY = y_mid + 30 +# yΒ² = xΒ³ + 7 β€” sketch a couple arcs +draw.arc([CX-38, EY, CX+38, EY+50], 200, 340, fill=LINE, width=2) +draw.arc([CX-22, EY+8, CX+52, EY+42], 10, 170, fill=LINE, width=2) +# Point on curve +draw.ellipse([CX+24, EY+14, CX+32, EY+22], fill=MUTED) +# tangent line through point +draw.line([(CX+4, EY+30), (CX+48, EY+6)], fill=DIM, width=1) + +# ───────────────────────────────────────────────────────────────────────────── +# HEADER +# ───────────────────────────────────────────────────────────────────────────── +draw.line([(52, 54), (W-52, 54)], fill=LINE, width=1) + +# Corner brackets top +for cx2, dx in [(52, 1), (W-52, -1)]: + draw.line([(cx2, 54), (cx2+dx*20, 54)], fill=MUTED, width=1) + draw.line([(cx2, 54), (cx2, 54+12)], fill=MUTED, width=1) + +title = "PUBLIC / PRIVATE KEY" +draw.text((CX, 30), title, font=f_out_sm, fill=MUTED, anchor="mm") + +# ───────────────────────────────────────────────────────────────────────────── +# FOOTER +# ───────────────────────────────────────────────────────────────────────────── +FOOTER_Y = H - 54 +draw.line([(52, FOOTER_Y), (W-52, FOOTER_Y)], fill=LINE, width=1) + +# Corner brackets bottom +for cx2, dx in [(52, 1), (W-52, -1)]: + draw.line([(cx2, FOOTER_Y), (cx2+dx*20, FOOTER_Y)], fill=MUTED, width=1) + draw.line([(cx2, FOOTER_Y), (cx2, FOOTER_Y-12)], fill=MUTED, width=1) + +draw.text((72, FOOTER_Y + 12), "Blockchain 101 Β· Key Pair Demo", font=f_jura, fill=MUTED) +draw.text((W-72, FOOTER_Y + 12), "secp256k1 Β· ECDSA Β· SHA-256", font=f_jura, fill=MUTED, anchor="ra") + +# Hash strip (goldβ†’teal gradient) +HASH = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +x_h = 72 +y_h = FOOTER_Y - 18 +for i, ch in enumerate(HASH[:54]): + frac = i / 54 + if frac < 0.45: + t = frac / 0.45 + col = tuple(int(GOLD_MID[j]*(1-t) + MUTED[j]*t) for j in range(3)) + else: + t = (frac - 0.45) / 0.55 + col = tuple(int(MUTED[j]*(1-t) + TEAL_MID[j]*t) for j in range(3)) + draw.text((x_h + i*19, y_h), ch, font=f_jet_sm, fill=col) + +# ───────────────────────────────────────────────────────────────────────────── +# SAVE +# ───────────────────────────────────────────────────────────────────────────── +out = "/mnt/user-data/outputs/keypair_logo.png" +img.save(out, "PNG", dpi=(144, 144)) +print(f"Saved: {out} [{W}Γ—{H}]") + +# ───────────────────────────────────────────────────────────────────────────── +# SQUARE ICON VERSION (512Γ—512) +# ───────────────────────────────────────────────────────────────────────────── +IS = 512 +icon = Image.new("RGB", (IS, IS), BG) +id2 = ImageDraw.Draw(icon) + +# dot grid +for gx in range(0, IS+24, 24): + for gy in range(0, IS+24, 24): + id2.ellipse([gx-1, gy-1, gx+1, gy+1], fill=(14,16,24)) + +# scanlines +for y in range(0, IS, 3): + id2.line([(0,y),(IS,y)], fill=(10,11,18), width=1) + +ICX = IS//2 +ICY = IS//2 + +# left half β€” gold +LP = 28 +id2.rectangle([LP, LP, ICX-12, IS-LP], fill=(10,9,5), outline=GOLD_DIM, width=1) +id2.rectangle([LP, LP, ICX-12, LP+3], fill=GOLD) + +# right half β€” teal +id2.rectangle([ICX+12, LP, IS-LP, IS-LP], fill=(5,10,8), outline=TEAL_DIM, width=1) +id2.rectangle([ICX+12, LP, IS-LP, LP+3], fill=TEAL) + +# left lock +f2_jura = font("Jura-Light.ttf", 11) +f2_work = font("WorkSans-Bold.ttf", 10) +f2_jet = font("JetBrainsMono-Regular.ttf", 11) + +id2.text((LP+14, LP+10), "PRIVATE", font=f2_work, fill=GOLD) + +# hex rows left +hrows2 = ["18 e1 4a 7b", "6a 94 f8 11", "e7 74 e7 f9", "35 db 29 a2"] +yh2 = LP + 32 +for row in hrows2: + xh2 = LP + 14 + for ch in row: + if ch == ' ': + xh2 += 7; continue + b = random.uniform(0.45, 1.0) + id2.text((xh2, yh2), ch, font=f2_jet, fill=tuple(int(c*b) for c in GOLD)) + xh2 += 11 + yh2 += 18 + +# closed lock left +LCX2 = LP + (ICX-12-LP)//2 +draw_lock_closed.__wrapped__ = False + +# manual mini-lock for icon +def mini_lock_closed(d, cx, cy, color): + d.arc([cx-20, cy-36, cx+20, cy+4], 198, 342, fill=color, width=2) + d.rounded_rectangle([cx-24, cy-4, cx+24, cy+28], radius=3, fill=(12,10,6), outline=color, width=2) + d.ellipse([cx-6, cy+4, cx+6, cy+16], fill=BG, outline=color, width=2) + d.rectangle([cx-3, cy+13, cx+3, cy+25], fill=BG) + +def mini_lock_open(d, cx, cy, color): + d.arc([cx-20, cy-38, cx+20, cy+2], 200, 360, fill=color, width=2) + d.line([cx+20, cy-18, cx+20, cy-44], fill=color, width=2) + d.ellipse([cx+17, cy-48, cx+23, cy-40], fill=color) + d.rounded_rectangle([cx-24, cy-4, cx+24, cy+28], radius=3, fill=(6,14,10), outline=color, width=2) + d.ellipse([cx-6, cy+4, cx+6, cy+16], fill=BG, outline=color, width=2) + d.rectangle([cx-3, cy+13, cx+3, cy+25], fill=BG) + +mini_lock_closed(id2, LCX2, yh2+50, GOLD) + +# right panel content +id2.text((ICX+26, LP+10), "PUBLIC", font=f2_work, fill=TEAL) + +prows2 = ["04 50 86 3a", "8a 2f e8 3c", "3c b5 3f 53", "1d ad 8a 04", "52 2c d4 70", "99 fa 9e 77"] +yh3 = LP + 32 +for row in prows2: + xh3 = ICX + 26 + for ch in row: + if ch == ' ': xh3 += 7; continue + b = random.uniform(0.45, 1.0) + id2.text((xh3, yh3), ch, font=f2_jet, fill=tuple(int(c*b) for c in TEAL)) + xh3 += 11 + yh3 += 17 + +RCX2 = ICX + 12 + (IS-LP - ICX-12)//2 +mini_lock_open(id2, RCX2, yh3+44, TEAL) + +# Center arrow +AY2 = IS//2 + 20 +for i in range(20): + t = i/20 + x_a = ICX - 10 + i*1 + col = tuple(int(GOLD[j]*(1-t)+TEAL[j]*t) for j in range(3)) + id2.ellipse([x_a, AY2, x_a+3, AY2+3], fill=col) + +# Γ—G +f2_b = font("JetBrainsMono-Bold.ttf", 18) +id2.text((ICX, AY2-24), "Γ—G", font=f2_b, fill=WHITE, anchor="mm") + +# Dividing line +id2.line([(ICX, LP+6), (ICX, IS-LP-6)], fill=LINE, width=1) + +# Bottom strip +id2.line([(LP, IS-LP-20), (IS-LP, IS-LP-20)], fill=LINE, width=1) +id2.text((ICX, IS-LP-10), "secp256k1", font=f2_jura, fill=MUTED, anchor="mm") + +icon_out = "/mnt/user-data/outputs/keypair_icon.png" +icon.save(icon_out, "PNG", dpi=(144,144)) +print(f"Icon saved: {icon_out} [512Γ—512]") From 863ebcece545bc73e3a80facaa3b30b71c3e1b83 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Thu, 23 Apr 2026 21:39:56 +0800 Subject: [PATCH 6/6] Create generate_logo.py Logo blockchain PI to exchange crypto this new browser --- PiRC2/Logo-keypair-addres/generate_logo.py | 245 +++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 PiRC2/Logo-keypair-addres/generate_logo.py diff --git a/PiRC2/Logo-keypair-addres/generate_logo.py b/PiRC2/Logo-keypair-addres/generate_logo.py new file mode 100644 index 000000000..c88fb9e7e --- /dev/null +++ b/PiRC2/Logo-keypair-addres/generate_logo.py @@ -0,0 +1,245 @@ +""" +Logo generator for Public/Private Key Demo +Philosophy: "Cryptographic Duality" β€” the interplay of lock and openness, +mathematical purity expressed through geometric precision. +""" + +import math +import random +from PIL import Image, ImageDraw, ImageFont + +FONT_DIR = "/mnt/skills/examples/canvas-design/canvas-fonts" + +W, H = 1200, 630 # OG image / banner ratio + +# ── Palette ────────────────────────────────────────────────────────────────── +BG = (8, 9, 14) # near-black deep navy +GRID = (18, 22, 36) # subtle grid +GOLD = (212, 175, 83) # private key gold +GOLD_DIM = (100, 82, 35) +TEAL = (29, 158, 117) # public key teal +TEAL_DIM = (14, 76, 57) +WHITE = (235, 238, 245) +MUTED = (90, 98, 120) +ACCENT_LINE = (50, 58, 85) + +# ── Canvas ─────────────────────────────────────────────────────────────────── +img = Image.new("RGB", (W, H), BG) +draw = ImageDraw.Draw(img) + +# ── Fonts ───────────────────────────────────────────────────────────────────── +def font(name, size): + try: + return ImageFont.truetype(f"{FONT_DIR}/{name}", size) + except: + return ImageFont.load_default() + +f_mono_sm = font("JetBrainsMono-Regular.ttf", 11) +f_mono_md = font("JetBrainsMono-Regular.ttf", 14) +f_mono_lg = font("JetBrainsMono-Bold.ttf", 18) +f_main = font("Outfit-Bold.ttf", 54) +f_sub = font("Outfit-Regular.ttf", 20) +f_label = font("Jura-Light.ttf", 13) +f_label_md = font("Jura-Medium.ttf", 15) + +# ── 1. Dot grid background ──────────────────────────────────────────────────── +STEP = 32 +for gx in range(0, W + STEP, STEP): + for gy in range(0, H + STEP, STEP): + draw.ellipse([gx-1, gy-1, gx+1, gy+1], fill=GRID) + +# ── 2. Subtle horizontal scan lines ─────────────────────────────────────────── +for y in range(0, H, 4): + draw.line([(0, y), (W, y)], fill=(15, 17, 26), width=1) + +# ── 3. Left panel β€” PRIVATE KEY zone (gold) ─────────────────────────────────── +PX = 80 # panel left edge +PY = 100 +PW = 340 +PH = 430 + +# Panel glow aura +for i in range(18, 0, -1): + alpha_r = int(100 * (i / 18) * 0.18) + aura_col = (GOLD[0], GOLD[1] // 3, 0, alpha_r) + draw.rectangle([PX - i, PY - i, PX + PW + i, PY + PH + i], + outline=(int(GOLD[0] * i/18 * 0.3), int(GOLD[1] * i/18 * 0.15), 0)) + +# Panel fill +draw.rectangle([PX, PY, PX + PW, PY + PH], fill=(12, 11, 8), outline=GOLD_DIM, width=1) + +# Panel top accent bar +draw.rectangle([PX, PY, PX + PW, PY + 3], fill=GOLD) + +# PRIVATE KEY label +draw.text((PX + 20, PY + 18), "PRIVATE KEY", font=f_label_md, fill=GOLD) +draw.line([(PX + 20, PY + 36), (PX + PW - 20, PY + 36)], fill=GOLD_DIM, width=1) + +# Key hex rows +hex_lines = [ + "18e14a7b6a307f42", + "6a94f8114701e7c8", + "e774e7f9a47e2c20", + "35db29a206321725", +] +y_cur = PY + 52 +for i, line in enumerate(hex_lines): + # color chars individually for visual depth + x_cur = PX + 20 + for ch in line: + brightness = random.randint(55, 100) / 100 + col = tuple(int(c * brightness) for c in GOLD) + draw.text((x_cur, y_cur), ch, font=f_mono_md, fill=col) + x_cur += 14 + y_cur += 22 + +# Separator +draw.line([(PX + 20, y_cur + 8), (PX + PW - 20, y_cur + 8)], fill=GOLD_DIM, width=1) +y_cur += 24 + +# Lock icon (hand drawn with PIL) +LCX = PX + PW // 2 +LCY = y_cur + 70 +# shackle arc +draw.arc([LCX-28, LCY-50, LCX+28, LCY+10], 200, 340, fill=GOLD, width=3) +# body +draw.rectangle([LCX - 34, LCY - 8, LCX + 34, LCY + 40], + fill=(20, 16, 6), outline=GOLD, width=2) +# keyhole circle +draw.ellipse([LCX-10, LCY+6, LCX+10, LCY+26], fill=BG, outline=GOLD, width=2) +# keyhole notch +draw.rectangle([LCX-4, LCY+20, LCX+4, LCY+36], fill=BG) + +y_cur += 155 + +# ECDSA label +draw.text((PX + 20, y_cur), "secp256k1 Β· ECDSA", font=f_label, fill=GOLD_DIM) +y_cur += 22 +draw.text((PX + 20, y_cur), "256-bit entropy", font=f_label, fill=GOLD_DIM) +y_cur += 22 +draw.text((PX + 20, y_cur), "SIGN(msg, privKey) β†’ (r, s)", font=f_mono_sm, fill=(int(GOLD[0]*0.7), int(GOLD[1]*0.7), 0)) + +# ── 4. Right panel β€” PUBLIC KEY zone (teal) ─────────────────────────────────── +RX = W - 80 - PW +RY = PY +RW = PW +RH = PH + +# Glow +for i in range(18, 0, -1): + draw.rectangle([RX - i, RY - i, RX + RW + i, RY + RH + i], + outline=(0, int(TEAL[1] * i/18 * 0.25), int(TEAL[2] * i/18 * 0.15))) + +draw.rectangle([RX, RY, RX + RW, RY + RH], fill=(6, 12, 10), outline=TEAL_DIM, width=1) +draw.rectangle([RX, RY, RX + RW, RY + 3], fill=TEAL) + +draw.text((RX + 20, RY + 18), "PUBLIC KEY", font=f_label_md, fill=TEAL) +draw.line([(RX + 20, RY + 36), (RX + RW - 20, RY + 36)], fill=TEAL_DIM, width=1) + +pub_lines = [ + "04 50863ad64a87ae", + "8a2fe83c1af1a840", + "3cb53f53e486d851", + "1dad8a04887e5b23", + "522cd47024345 3a2", + "99fa9e7723771610", +] +y_cur2 = RY + 52 +for line in pub_lines: + x_cur = RX + 20 + for ch in line: + brightness = random.randint(50, 100) / 100 + col = tuple(int(c * brightness) for c in TEAL) + draw.text((x_cur, y_cur2), ch, font=f_mono_md, fill=col) + x_cur += 14 + y_cur2 += 22 + +draw.line([(RX + 20, y_cur2 + 8), (RX + RW - 20, y_cur2 + 8)], fill=TEAL_DIM, width=1) +y_cur2 += 24 + +# Open lock icon +RCX = RX + RW // 2 +RCY = y_cur2 + 70 +# shackle open (rotated up-right) +draw.arc([RCX - 28, RCY - 52, RCX + 28, RCY + 8], 200, 360, fill=TEAL, width=3) +draw.line([(RCX + 28, RCY - 22), (RCX + 38, RCY - 40)], fill=TEAL, width=3) +# body +draw.rectangle([RCX - 34, RCY - 8, RCX + 34, RCY + 40], + fill=(6, 16, 12), outline=TEAL, width=2) +# keyhole +draw.ellipse([RCX-10, RCY+6, RCX+10, RCY+26], fill=BG, outline=TEAL, width=2) +draw.rectangle([RCX-4, RCY+20, RCX+4, RCY+36], fill=BG) + +y_cur2 += 155 +draw.text((RX + 20, y_cur2), "VERIFY(msg, sig, pubKey)", font=f_mono_sm, fill=(0, int(TEAL[1]*0.7), int(TEAL[2]*0.7))) +y_cur2 += 22 +draw.text((RX + 20, y_cur2), "uncompressed Β· 04 prefix", font=f_label, fill=TEAL_DIM) +y_cur2 += 22 +draw.text((RX + 20, y_cur2), "shareable Β· blockchain addr", font=f_label, fill=TEAL_DIM) + +# ── 5. Center β€” arrow / transform zone ──────────────────────────────────────── +CX = W // 2 +CY = H // 2 + +# Elliptic curve multiply label +draw.text((CX, CY - 80), "elliptic curve", font=f_label, fill=MUTED, anchor="mm") +draw.text((CX, CY - 62), "multiplication", font=f_label, fill=MUTED, anchor="mm") + +# Arrow right (privKey β†’ pubKey) +AY = CY - 20 +draw.line([(PX + PW + 18, AY), (RX - 18, AY)], fill=WHITE, width=2) +# arrowhead +draw.polygon([(RX - 18, AY - 7), (RX - 18, AY + 7), (RX - 4, AY)], fill=WHITE) + +# Arrow label +draw.text((CX, AY - 14), "Γ—G", font=f_mono_lg, fill=WHITE, anchor="mm") + +# SHA-256 hash indicator +draw.text((CX, CY + 20), "SHA-256", font=f_label_md, fill=MUTED, anchor="mm") +draw.text((CX, CY + 38), "↓", font=f_sub, fill=MUTED, anchor="mm") +draw.text((CX, CY + 60), "ECDSA sign", font=f_label, fill=MUTED, anchor="mm") + +# Small secp256k1 curve sketch (abstract ellipse) +draw.arc([CX - 30, CY + 75, CX + 30, CY + 110], 0, 360, fill=ACCENT_LINE, width=1) +draw.arc([CX - 20, CY + 80, CX + 40, CY + 105], 10, 200, fill=MUTED, width=1) + +# ── 6. Header / title ───────────────────────────────────────────────────────── +# Top thin line +draw.line([(60, 58), (W - 60, 58)], fill=ACCENT_LINE, width=1) + +TITLE = "PUBLIC / PRIVATE KEY" +draw.text((CX, 30), TITLE, font=f_sub, fill=MUTED, anchor="mm") + +# ── 7. Footer ───────────────────────────────────────────────────────────────── +draw.line([(60, H - 56), (W - 60, H - 56)], fill=ACCENT_LINE, width=1) + +draw.text((80, H - 40), "Blockchain 101 Β· Key Pair Demo", font=f_label, fill=MUTED) +draw.text((W - 80, H - 40), "secp256k1 Β· ECDSA Β· SHA-256", font=f_label, fill=MUTED, anchor="ra") + +# ── 8. Hash string across bottom of panels (atmosphere) ─────────────────────── +hash_str = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +x_off = 80 +y_hash = H - 72 +for i, ch in enumerate(hash_str[:60]): + frac = i / 60 + # blend gold β†’ muted β†’ teal + if frac < 0.5: + t = frac * 2 + col = tuple(int(GOLD[j]*(1-t) + MUTED[j]*t) for j in range(3)) + else: + t = (frac - 0.5) * 2 + col = tuple(int(MUTED[j]*(1-t) + TEAL[j]*t) for j in range(3)) + draw.text((x_off + i * 17, y_hash), ch, font=f_mono_sm, fill=col) + +# ── 9. Corner decorations ───────────────────────────────────────────────────── +corner_size = 18 +corners = [(60, 64), (W-60, 64), (60, H-60), (W-60, H-60)] +dirs = [(1,1), (-1,1), (1,-1), (-1,-1)] +for (cx2, cy2), (dx, dy) in zip(corners, dirs): + draw.line([(cx2, cy2), (cx2 + dx*corner_size, cy2)], fill=ACCENT_LINE, width=1) + draw.line([(cx2, cy2), (cx2, cy2 + dy*corner_size)], fill=ACCENT_LINE, width=1) + +# ── 10. Save ────────────────────────────────────────────────────────────────── +out = "/mnt/user-data/outputs/keypair_logo.png" +img.save(out, "PNG", dpi=(144, 144)) +print(f"Saved: {out} [{W}Γ—{H}]")