Detailed Poetry Generation Logic

Title Generation

Input: nonce (numerical value from block mining)

Conversion flow: nonce → hexadecimal(8 digits) → 32 bits → 11-bit chunks → word indices

Steps

1

Convert nonce to 8-digit hexadecimal (e.g., deadbeef)

2

Convert hexadecimal to 32-bit binary

3

Divide into 11-bit chunks (BIP39 word index range)

4

Determine word count from last 2 digits (1-3 words)

5

Combine selected words to create title

Example nonce: 3735928559 ↓ hex: deadbeef ↓ binary: 11011110101011011011111011101111 chunks: [1903, 1467, ...] ↓ words: ["umbrella", "oxygen"] ↓ title: "Umbrella Oxygen"

Determining Title Word Count

Steps

1

Extract last 2 digits of nonce (hexadecimal)

2

Convert to decimal and divide by 3

3

Remainder becomes 0, 1, or 2

4

Add 1 to determine 1, 2, or 3 words

Example

nonce = 12345678

78 → parseInt("78", 16) = 120 → 120 % 3 = 0 → 0 + 1 = 1 word

nonce = 87654321

21 → parseInt("21", 16) = 33 → 33 % 3 = 0 → 0 + 1 = 1 word

nonce = 11111111

11 → parseInt("11", 16) = 17 → 17 % 3 = 2 → 2 + 1 = 3 words

Body Generation

Input: previousHash, currentHash, transactionCount, version

Line Count Determination

  • Minimum lines: 2 - Maximum lines: 10

  • Normalization formula: norm = clamp((tx_count - 10) / (10000 - 10), 0, 1)

  • Line count = round(2 + norm × (10 - 2))

Transaction Count

Calculation Process

Normalized Value

Poetry Lines

10

(10-10)/9990 = 0

0.000

2 lines

1,000

(1000-10)/9990 ≈ 0.099

0.099

3 lines

5,000

(5000-10)/9990 ≈ 0.499

0.499

6 lines

10,000

(10000-10)/9990 ≈ 1.0

1.000

10 lines

15,000

clamp → 1.0

clamp applied → 1.0

1.000

10 lines

Word Selection Logic

A  Bridge Words (Block Continuity)

Express blockchain continuity

1

First 2 words of first line: Generated from last 8 characters of previous block hash

2

Last 2 words of last line: Generated from last 8 characters of current block hash

B Normal Word Selection

1

Main words: Generated from middle 32 characters of currentHash

2

Helper words: Selected by combination of version × position × line × word

C  Word Type Determination

30% probability for helper word usage

Helper Word System

50 Types of Helper Words

Prepositions (20 words)

'the', 'and', 'in', 'on', 'with', 'for', 'to', 'from', 'by', 'as', 'of', 'at', 'about', 'under', 'beyond', 'within', 'above', 'across', 'around', 'behind',

Location・Direction (10 words)

'near', 'through', 'toward', 'upon', 'without', 'into', 'over', 'below', 'beside', 'among',

Time・Relationship (10 words)

'between', 'during', 'before', 'after', 'since', 'until', 'while', 'though', 'although', 'because',

Question・Connection (10 words)

'if', 'when', 'where', 'why', 'how', 'but', 'or', 'nor', 'so', 'yet'

Distribution Improvement

The version value enables deterministic yet diverse selection, ensuring all 50 words are used while significantly reducing repeated use of the same auxiliary words.

Last updated