现在销毁统计的只是 1707 mint 之后的轻节点销毁量,1706 和之前的其实都没统计,简单来算就是最早的 1706 笔 mint 出来的 XIN 的总量的 1/10 被销毁了。初步统计在 1707 笔之前的 pool size 是 305850.45205696,也就是过去几年总共有 1000000-305850-500000 = 194150 个 XIN 被挖出来,然后销毁的就是 19415 个
另外还有一个较大的销毁是 Safe 节点加入的销毁,现在只有这一笔 2700XIN https://mixin.space/tx/4d1a273b4274c1c77610a52cc6bbd753f2ae09607cf13495d10fc5206ab46d1e
其他还有一些可能销毁的细节,比如有过一个 node cancel 200XIN 销毁,还需要再仔细计算得到一个明确数字,然后显示在浏览器上。
查了一下旧网络过去几年所有挖出来分配给节点的 XIN 是 174972.80951334,与刚刚统计的数据是几乎一致的。
大家可以自行用下面的代码验证:
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/MixinNetwork/mixin/common"
)
const KERNEL = "https://rpc.mixin.dev"
func main() {
var offset uint64
processed := make(map[uint64]bool)
var total common.Integer
for {
ms := listMintDistributions(KERNEL, offset, 500)
for _, m := range ms {
if processed[m.Batch] {
continue
}
offset = m.Batch
amt := common.NewIntegerFromString(m.Amount)
total = total.Add(amt)
}
if len(ms) == 1 && offset == 1706 {
break
}
}
fmt.Println(total.String())
}
type Mint struct {
Amount string `json:"amount"`
Batch uint64 `json:"batch"`
Transaction string `json:"transaction"`
}
func listMintDistributions(rpc string, offset, count uint64) []*Mint {
raw, err := callMixinRPC(rpc, "listmintdistributions", []any{offset, count, false})
if err != nil {
panic(err)
}
var mds []*Mint
err = json.Unmarshal(raw, &mds)
if err != nil {
panic(string(raw))
}
return mds
}
func callMixinRPC(node, method string, params []any) ([]byte, error) {
client := &http.Client{Timeout: 20 * time.Second}
body, err := json.Marshal(map[string]any{
"method": method,
"params": params,
})
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", node, bytes.NewReader(body))
if err != nil {
return nil, err
}
req.Close = true
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var result struct {
Data any `json:"data"`
Error any `json:"error"`
}
dec := json.NewDecoder(resp.Body)
dec.UseNumber()
err = dec.Decode(&result)
if err != nil {
return nil, err
}
if result.Error != nil {
return nil, fmt.Errorf("callMixinRPC(%s, %s, %s) => %v", node, method, params, result.Error)
}
if result.Data == nil {
return nil, nil
}
return json.Marshal(result.Data)
}