Qitmeer FPGA 对接矿池技术文档

Qitmeer FPGA 对接矿池技术文档

一 qitmeer_keccak256 算法介绍

1. 算法代码
2. 修改sha3padding参数查看与标准sha3差异

二 qitmeer 矿池介绍

1. 官池 meerpool
2. 独角兽 666pool

三 qitmeer 矿池协议介绍


# 协议说明

1. 以bitcoin协议为基础

https://test.qitmeertalk.org/t/stratum/367

https://en.bitcoin.it/wiki/Stratum_mining_protocol

2. 修改下发任务(mining.notify)字段,内容如下:

jobID, prevHash, coinb1, coinb2, coinb3, coinb4, merkleBranchesStrs, version, nBits, nTime, mainHeight, cleanJobs


3. header组装

coinbaseHash =  Blake2bD ( cb1 + Blake2bD(cb2+ex1+ex2+cb3) + cb4 )

txRoot = MakeMerkleRoot(coinbaseHash,merkleBranchesStrs),,join hash func is Blake2bD

header =  version + prevHash + txRoot + StateRoot(zeroHash)+ nBits + nTime + nonce

header_hash = qitmeer_keccak256(header)


# 例1

下发Job
{
	JobID:"1",
	PrevHashReversed:"3ebbe1de1524c5d8450759652bfa0b1502f7b4b878b320dfcb56a3325b6307a3",
	CB1:"0100010001",
	CB2:"00000000000000000000000000000000000000000000000000000000000000005108",
	CB3:"162f7777772e6d656572706f6f6c2e636f6d2f32303230",
	CB4:"ffffffffffffffff01007841cb020000001976a914499896c7814a6f49fa256bc5feaa5882a665339188ac0000000000000000",
	MerkleBranch:[],
	Version:"0000000c",
	Bits:"1c1fffff",
	NTime:"5eb564e1"
}

提交数据SubmitData

{
	"Extranonce1": "02000001",
	"Extranonce2": "4d658221",
	"NTime":"5eb564e1",
	"Nonce":"00000001",
}


四 qitmeer 组装demo golang 版本

golang demo代码

五 blake2b 代码

c code