Skip to content

Conversation

@the-dev-z
Copy link
Collaborator

Summary

Improves the user experience of the two-stage private key input by changing the character split from 32+32 to 58+6.

Problem

Users reported issues with the current 32+32 split:

  • Hard to count: Second stage still requires entering 32 characters
  • Time-consuming: Need to carefully count characters in both stages
  • Error-prone: Easy to miscount and enter wrong characters

Real user feedback:

"为什么要分32 / 32... 我去数私钥的位数都数晕了... 32 + 32 也是个小天才设计😂"

Solution

Change to 58 + 6 split:

Stage 1 (58 characters):

  • Enter the majority of the private key
  • Easy to copy/paste the prefix part

Stage 2 (6 characters):

  • Only 6 characters - much easier to count
  • ✅ Quick verification of key suffix
  • ✅ Significantly reduces user errors

Changes

// Before: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// After: Optimized split
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters

Benefits

Aspect Before (32+32) After (58+6)
Stage 2 input 32 characters 😰 6 characters ✅
Counting difficulty Need to count 64 chars Only count 6 chars
User errors Higher (easy to miscount) Lower (6 chars easy)
Security Two-stage validation ✅ Two-stage validation ✅

Test plan

  • ✅ Frontend builds successfully (npm run build)
  • ✅ TypeScript compilation passes
  • ✅ User-friendly improvement
  • ✅ Security unchanged (still two-stage input with obfuscation)

Screenshots

N/A (UX improvement, no visual changes)

## Problem

Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting

## Solution

Change the split from 32+32 to **58+6**

**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix

**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors

## Changes

```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```

## Test plan

✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged
@github-actions
Copy link

🤖 Advisory Check Results

These are advisory checks to help improve code quality. They won't block your PR from being merged.

📋 PR Information

Title Format: ✅ Good - Follows Conventional Commits
PR Size: 🟢 Small (6 lines: +4 -2)

🔧 Backend Checks

Go Formatting: ✅ Good
Go Vet: ✅ Good
Tests: ✅ Passed

Fix locally:

go fmt ./...      # Format code
go vet ./...      # Check for issues
go test ./...     # Run tests

⚛️ Frontend Checks

Build & Type Check: ✅ Success

Fix locally:

cd web
npm run build  # Test build (includes type checking)

📖 Resources

Questions? Feel free to ask in the comments! 🙏


These checks are advisory and won't block your PR from being merged. This comment is automatically generated from pr-checks-run.yml.

@tinkle-community tinkle-community merged commit 7af0daf into NoFxAiOS:dev Nov 12, 2025
15 of 16 checks passed
the-dev-z added a commit to the-dev-z/nofx that referenced this pull request Nov 12, 2025
合併 5 個上游 commits:
- b7fe547: fix(web): unify password validation logic (NoFxAiOS#943)
- 7af0daf: fix: improve two-stage private key input UX (NoFxAiOS#942)
- 5ad731d: fix(web): fix button disabled validation (NoFxAiOS#937)
- cca7bc5: feat: Hyperliquid Agent Wallet docs (NoFxAiOS#936)
- 70adfd7: feat(docs): add Hyperliquid tutorial (NoFxAiOS#935)

解決衝突:
- TwoStageKeyModal.tsx: 選擇上游英文註釋版本

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
sparrow211 pushed a commit to sparrow211/nofx that referenced this pull request Nov 12, 2025
…xAiOS#942)

## Problem

Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting

## Solution

Change the split from 32+32 to **58+6**

**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix

**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors

## Changes

```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```

## Test plan

✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged

Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
bebest2010 pushed a commit to bebest2010/nofx that referenced this pull request Nov 18, 2025
…xAiOS#942)

## Problem

Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting

## Solution

Change the split from 32+32 to **58+6**

**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix

**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors

## Changes

```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```

## Test plan

✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged

Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
tinkle-community pushed a commit that referenced this pull request Nov 26, 2025
## Problem

Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting

## Solution

Change the split from 32+32 to **58+6**

**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix

**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors

## Changes

```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```

## Test plan

✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged

Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
tinkle-community pushed a commit that referenced this pull request Nov 26, 2025
## Problem

Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting

## Solution

Change the split from 32+32 to **58+6**

**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix

**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors

## Changes

```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32

// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```

## Test plan

✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged

Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
tinkle-community pushed a commit that referenced this pull request Dec 7, 2025
## Problem
Users reported that the 32+32 character split design is not user-friendly:
1. ❌ Second stage still requires entering 32 characters - hard to count
2. ❌ Need to count many characters in both stages
3. ❌ Easy to make mistakes when counting
## Solution
Change the split from 32+32 to **58+6**
**Stage 1**: 58 characters
- Enter the majority of the key (90%)
- Easy to copy/paste the prefix
**Stage 2**: 6 characters
- ✅ Only need to count last 6 chars (very easy)
- ✅ Quick verification of key suffix
- ✅ Reduces user errors
## Changes
```typescript
// Old: Equal split
const expectedPart1Length = Math.ceil(expectedLength / 2)  // 32
const expectedPart2Length = expectedLength - expectedPart1Length  // 32
// New: Most of key + last 6 chars
const expectedPart1Length = expectedLength - 6  // 58
const expectedPart2Length = 6  // Last 6 characters
```
## Test plan
✅ Frontend builds successfully (npm run build)
✅ User-friendly: Only need to count 6 characters
✅ Maintains security: Two-stage input logic unchanged
Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants