summaryrefslogtreecommitdiff
path: root/20/89ffb92542c3b53868ceab4c55716fd72168a4
blob: 9fda04708e34157dc39767d52d51a19335c27ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Return-Path: <mrosset@bufio.org>
Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 3F33BC000D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  9 Sep 2021 14:29:59 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp4.osuosl.org (Postfix) with ESMTP id 66E3D402F5
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  9 Sep 2021 14:29:58 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: smtp4.osuosl.org (amavisd-new);
 dkim=pass (2048-bit key) header.d=bufio.org
Received: from smtp4.osuosl.org ([127.0.0.1])
 by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id WIar1Kf_JAsi
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  9 Sep 2021 14:29:57 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com
 [IPv6:2607:f8b0:4864:20::635])
 by smtp4.osuosl.org (Postfix) with ESMTPS id 38B3D40399
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu,  9 Sep 2021 14:29:57 +0000 (UTC)
Received: by mail-pl1-x635.google.com with SMTP id n18so1176688plp.7
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 09 Sep 2021 07:29:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bufio.org; s=google;
 h=user-agent:from:to:subject:date:message-id:mime-version;
 bh=EpFMwR5NfPGw98LtuQPAXQlY2Hv/1nuHSwTAZsd+VL8=;
 b=IRYa7pZB7PiC2B8GnN2uzIknJhl2u/TZeK/9kgHNZzBcerQqTgQFGcFtPBGqOIqAAU
 xawLBlyJ0/sNkFHxXhH8FAC+7R0r15J8Fe8PPfuEObKkrF33h1NGeWEd+KZzMs1Ieide
 cHDMDZaGTQPuNs8ZFRSYlLAnhXNKnL3oPgd+KNz/qmVFBmD7sC3btE0tJGjk1hUkw+b8
 JHJHDSaKhrDI66knqvuBVVIhFEo4+HuNvH3B6xXntD5y2GEO3sJ51IaeLEjp0V9SFxsW
 uEG0aicX8hBRoClRLxO3rEWCpoqb0ZUiQakcsw49LD0/4yXQsomFbaCE4PorJS3Et7uC
 hsUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:user-agent:from:to:subject:date:message-id
 :mime-version;
 bh=EpFMwR5NfPGw98LtuQPAXQlY2Hv/1nuHSwTAZsd+VL8=;
 b=oGNXHUnHDvXEk6sOe3vwDteRMuGCpj2O02ItUy7iKf2nh5ly7Z9bhFDj/3zI0ffDy0
 qB/E7pWdKhDTaYYNl5BWgC64HTgxYgJrZvKPtC8LzrtUitk0QcJ2tW3URdCMCU4jBS1b
 OCy70+2jvpY9mEtk7U4r0wmNDqEbQizsUEbEeBoh2NdWjCWQXLLqJPjBz6aZ+f/CzJCc
 fXuBX7uYsFm7+yzgE+pftsFel456XN5mSWDtGC4nMlpJ+V6/8p8dPU8m/E3uNNDfRRU7
 OmEJV06ZRod7UJaJHn0OJ5a2dyQCiFw6hLBlvnukW+Lz1lTp3uqfvwS3D4inhgZweJ4b
 bbmA==
X-Gm-Message-State: AOAM530g3hlNkcMayVZh/P+QygGK6fNFi1o6q1THZHUl9wnZ7wlKeVwV
 eZJnLyiI9dE45pJd35584tn485Ds52L9pHNy
X-Google-Smtp-Source: ABdhPJyATSNGAC5vPsdKTn6JpJncFueYl4M6/lp5FbPZNG6XITACXatQaA9Zx/IAkpcD/V5EusqXvw==
X-Received: by 2002:a17:90a:e001:: with SMTP id
 u1mr3960084pjy.183.1631197796320; 
 Thu, 09 Sep 2021 07:29:56 -0700 (PDT)
Received: from neutron (S010664777da04f43.vf.shawcable.net. [70.68.94.152])
 by smtp.gmail.com with ESMTPSA id h8sm2522761pfr.219.2021.09.09.07.29.55
 for <bitcoin-dev@lists.linuxfoundation.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Sep 2021 07:29:55 -0700 (PDT)
User-agent: mu4e 1.6.5; emacs 28.0.50
From: Mike Rosset <mrosset@bufio.org>
To: bitcoin-dev@lists.linuxfoundation.org
Date: Thu, 09 Sep 2021 05:54:18 -0700
Message-ID: <87r1dxbz4s.fsf@bufio.org>
MIME-Version: 1.0
Content-Type: text/plain
X-Mailman-Approved-At: Thu, 09 Sep 2021 17:22:46 +0000
Subject: [bitcoin-dev] Clarification on the use of getblocktemplate RPC
	method.
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Sep 2021 14:29:59 -0000


Hello all,

I recently went down the bitcoin protocol rabbit hole. I wanted to use
GNU guile scheme to experiment with bitcoin. I initially started by
creating a toy bitcoin miner but I've run into some inconsistencies with
the documentation found on
https://en.bitcoin.it/wiki/Getblocktemplate. Namely with creating the
templates merkle root.

From my understanding a coinbase transaction should have the
transactions data concatenated before creating the merkle root. But
getblocktemplate does not have a json cointbasetxn field. So I'm not
sure how to create a coinbase transaction without that.

I have a test template response data found here.
https://raw.githubusercontent.com/mrosset/prospect/master/test-suite/data.json
and using a modified version of the merkle python reference script found
on the wiki page. see
https://github.com/mrosset/prospect/blob/master/scripts/merkle.py . I'm
able to create a merkle root with the hash
c5fff939f628a04428c080ed5bd7cd9bc0b4722b2522743049adb18213adf28a but
that's minus the coinbase transaction.

So far I'm able to replicate this hash using the test data in guile. But
I'd like to sanitize this so that I'm using a coinbase transaction and
making sure the python and guile merkle roots match.

In short how do I get the coinbase transaction without the coinbasetxn
field existing?

Mike