proof-of-strike 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/boss.mjs +6733 -0
- package/package.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# proof-of-strike —— 一撃の証明
|
|
2
|
+
|
|
3
|
+
毎週ひとつだけ現れる世界共通のモンスターを、HTTP 402 だけで殴り倒す協力型ゲーム。
|
|
4
|
+
|
|
5
|
+
**攻撃力は掘ったハッシュの深さと、ウォレットが積んだ年月で決まる。払った額では強くならない。**
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx proof-of-strike init # 財布を用意する(初回だけ)
|
|
9
|
+
npx proof-of-strike play # 敵を見て、掘って、殴る
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
覚える命令はこの二つだけ。`play` が今週の敵を出し、攻撃するか訊き、
|
|
13
|
+
在庫が無ければ掘り、署名して殴り、結果まで出す。
|
|
14
|
+
|
|
15
|
+
決済は **Base Sepolia のテスト USDC**(一撃 0.0001)。金銭的価値はなく、額そのものに意味もない。
|
|
16
|
+
|
|
17
|
+
## 仕組み
|
|
18
|
+
|
|
19
|
+
EIP-3009 の `authorization nonce` は、支払者が自由に決められて、チェーンに永久に残り、
|
|
20
|
+
誰も見ていない32バイト。そこに proof-of-work を書き込む。
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
depth = sha256("atk:v1" ‖ weekSeed ‖ chainId ‖ payer ‖ nonce) の先頭ゼロビット数
|
|
24
|
+
dmg = ⌊100 × depth² × 属性 × crit × (1−DEF/100) × levelMul × 0.9^(n−1)⌋
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
掘るほど強いが効果は**対数**。GPU 農場と数秒だけ掘った人の差は 4.3 倍しかつかない。
|
|
28
|
+
|
|
29
|
+
## 一段ずつ回す
|
|
30
|
+
|
|
31
|
+
`play` は下の命令を順に呼んでいるだけで、中で別のことはしていない。
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
boss # 今週の戦況(引数なしで戦闘画面)
|
|
35
|
+
boss grind # nonce を掘る(1本掘れたら終わり)
|
|
36
|
+
boss grind --for 10m # 時間を使い切って、より深いものを狙う
|
|
37
|
+
boss grind --element VOID # 弱点を狙う。当たれば2倍、当たりは1/6
|
|
38
|
+
boss stash # 掘り溜めた在庫
|
|
39
|
+
boss attack # いちばん深いもので殴る
|
|
40
|
+
boss replay 2026-W35 # チェーンから週を再現する
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 鍵の置き場
|
|
44
|
+
|
|
45
|
+
`init` は `~/.boss/key` に 0600 で置く。**Base Sepolia のテストネット専用**で、
|
|
46
|
+
本物の資産を持つ財布の鍵を置く用途は想定していない。
|
|
47
|
+
|
|
48
|
+
環境変数 `STRIKE_PRIVATE_KEY` があればそちらが優先で、ファイルは作らない。
|
|
49
|
+
引数では渡せない —— シェルの履歴と `ps` に残るため。
|
|
50
|
+
|
|
51
|
+
鍵を渡さずに署名する道もある。
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
boss attack --signer-cmd './my-signer'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
EIP-712 の `domain` / `types` / `message` 一式を渡すので、署名器の側で組み直して照合できる。
|
|
58
|
+
|
|
59
|
+
## 検証
|
|
60
|
+
|
|
61
|
+
すべての攻撃は Base Sepolia の `AuthorizationUsed` として残る。
|
|
62
|
+
仕様は https://proof-of-strike.com/spec に全部ある。**サーバーを見ずに週を再計算できる。**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
boss replay 2026-W35
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
curl でも配っている: `curl -fsSL https://proof-of-strike.com/boss.mjs -o boss.mjs`
|