From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3F33BC000D for ; 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 ; 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 ; 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 ; Thu, 9 Sep 2021 14:29:57 +0000 (UTC) Received: by mail-pl1-x635.google.com with SMTP id n18so1176688plp.7 for ; 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 (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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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