Delivery-date: Sat, 04 May 2024 08:40:31 -0700 Received: from mail-yb1-f190.google.com ([209.85.219.190]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s3HV0-0006Ka-Lo for bitcoindev@gnusha.org; Sat, 04 May 2024 08:40:31 -0700 Received: by mail-yb1-f190.google.com with SMTP id 3f1490d57ef6-de5a8638579sf1376571276.1 for ; Sat, 04 May 2024 08:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1714837224; x=1715442024; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:message-id:to:from:date:sender:from:to:cc:subject:date :message-id:reply-to; bh=nP2n7Ei2uXToiQ5Lj5tM//G4jxMRaUXKwtD4W8Zq4Ls=; b=bu9LV46Gui5P9waV4zrgGsMWio+LNHw5ldjG27k/Fy4W8ejzZ2T7s0LRPyBmGzuBy5 o/Fy115oPGy6ooTm5wXkCxzD1mxKTNsY/feQNaQzjRDt7isQEgqy84qQH12KexU0AvdY V30QaF/rGTRr7ncG2SUNcrQpBOAt5cJv5QomL88RLeK0nhghPaMBf1sEt61f4k1Xvr7c /9Ls1gpeGN4H44yryKwQDmCzY6OebwzjTOcyJL9llqWSoBngmsC4ZvsvMtpW6PVDpaBv Wsqs/TXbyCcRcFG1+DwsK9E+XMNwL9KqK27TBJhL8cGVNQ+guoiOv/d4x228r15Bu4At 8ZCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714837224; x=1715442024; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:message-id:to:from:date:from:to:cc:subject:date:message-id :reply-to; bh=nP2n7Ei2uXToiQ5Lj5tM//G4jxMRaUXKwtD4W8Zq4Ls=; b=ZVuBczmof4Fi7HJ+r+t3jzXKXUJPGvWuMdWUXAzWG4+vVHqpr7yXuysDVizyn0r8hJ UrixPHpDDsRMEF+yhyV/6dCEaw6L29+zXyWrGpjvLES1fC61Cq1CUN8xB5Eed1ZNoOxW W5pppJ1MZrhw7o6OkUpIGoQmEfiiHCLbonopbiN5PLTkXQYzivxwuzQJvf74B9GFp7+L v41nWBHcm1Buce3IflGELH1fZy+tHL1pCnHnc+PrcaaUyHOBS+cQbK7cUP+4i2GEfSQP N/dMt0lb9YtIgZ46KmEvNa32gY86KY0data3SGFqIs0mjL1XRAyJRz1Re9ylnOLMntmx g6yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714837224; x=1715442024; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-sender:mime-version :subject:message-id:to:from:date:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=nP2n7Ei2uXToiQ5Lj5tM//G4jxMRaUXKwtD4W8Zq4Ls=; b=TwEkB182lwnFIhAinXPVg5IsBWrJDljv+ZGIi2klSk9Ja30mIfZ8iGigstRlr9j6FN X4XsfRZi5D1En2zCDISZhFTLShPgqstQNnr/3dQ6UqpqxEeHsjR0rxDi03VYH3+TxeCg MBHnS7KLdw+btb4c2HaOQsTBVBHTIpoqMQxS9TvadHxYMDJpgQ6n7dVELu8EvBXQLc/B TfU1SfzlUQcgdRW9NzwXrrzmP2T3LbeVShZI9wXtDPjNMkoXuqLf9wOvH2wgdyd44JQJ 6dxG/oJVmk25lFzX0Sn6mz/LMp1UdDapJM1ChPWOEIaPhfn53yEIg4Yd6ne2EhqVYv08 EjHw== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=1; AJvYcCU5Y49/0f4V0nBRF74g2TStPKYCXCdIJ5WFPd9FR1nGhP+4zFaS3Uofkt5b/wpI8gFseqotDZbpXOitlem074ZGgN3pHas= X-Gm-Message-State: AOJu0YyeJecBzjOX2KbvaIhRZ7PhzokBXKaDlJphMuq3vAlshnxx9Ugq ucV3isCRXFcAb7zkVHMf2ka076tm4sj9OJa4E0vDXpcdAImNMadd X-Google-Smtp-Source: AGHT+IEDw3Geo9StDtl/GU2REZ2ME7WRdfRaniY3OPWZYCyUxZfFlmfs834ZZgFXkTqB8jQJoEXI3A== X-Received: by 2002:a25:7446:0:b0:de5:5040:ea12 with SMTP id p67-20020a257446000000b00de55040ea12mr6712874ybc.32.1714837224470; Sat, 04 May 2024 08:40:24 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a25:ac19:0:b0:dcc:37ed:efb1 with SMTP id 3f1490d57ef6-de8b54f938els551488276.2.-pod-prod-00-us; Sat, 04 May 2024 08:40:22 -0700 (PDT) X-Received: by 2002:a05:6902:2192:b0:de6:569:325c with SMTP id dl18-20020a056902219200b00de60569325cmr2124039ybb.4.1714837222771; Sat, 04 May 2024 08:40:22 -0700 (PDT) Received: by 2002:a05:690c:d8a:b0:620:26bb:319f with SMTP id 00721157ae682-62026bb31f1ms7b3; Sat, 4 May 2024 08:00:09 -0700 (PDT) X-Received: by 2002:a05:690c:d8c:b0:61b:e2e9:b59c with SMTP id da12-20020a05690c0d8c00b0061be2e9b59cmr1346765ywb.4.1714834808033; Sat, 04 May 2024 08:00:08 -0700 (PDT) Date: Sat, 4 May 2024 08:00:07 -0700 (PDT) From: Fractal Encrypt To: Bitcoin Development Mailing List Message-Id: <75628135-32ae-4df3-be52-9f7d054bc096n@googlegroups.com> Subject: [bitcoindev] A Fool's Errand or should I try? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1712_337132614.1714834807661" X-Original-Sender: fractalencryptlsd@gmail.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.5 (/) ------=_Part_1712_337132614.1714834807661 Content-Type: multipart/alternative; boundary="----=_Part_1713_833547110.1714834807661" ------=_Part_1713_833547110.1714834807661 Content-Type: text/plain; charset="UTF-8" TLDR: I'd like to investigate the possibilities of extending decoderawtransaction to include the fee (and maybe even sats per v/b). I'm hoping it will be a good project for me to work on and build at least a tiny understanding of bitcoin development. ------------------------------------------------------------------------ I use the createrawtransaction function to create transactions, and before broadcasting, I always like to use decoderawtransaction to see if I made any mistakes. I've sometimes messed up on the fee calculation, as I do that myself with a calculator. Unfortunately decoderawtransaction doesn't give me the fee information (for a very good reason, it is not aware of the value of the inputs in the tx). So to double check the fees, instead of using createrawtransaction, I'll use createpsbt and then go through the process of finalizing it so I can run decodepsbt, which does give the fee along with all the other relevant data. But the createpsbt process is more work for a simple transaction where all UTXOs are in the wallet I am creating the rawtx in. My goal would be to modify decoderawtransaction to perform these additional steps: 1. Fetch UTXO details for each input. 2. Calculate the total input value. 3. Subtract the total output value to determine the fee. Additionally there are the considerations about whether the inputs in the transaction are in your wallet or not. If I run listunspent it gives me the info I need to create the raw tx or psbt, and it has the values of the UTXOs that will be used as inputs in my tx. But I understand decoderawtransaction is meant to be used whether or not the keys are in your wallet (so I was thinking to make a command argument T/F to show the fee value only if keys are in your wallet). Alternatively if you are running the command in a node with txindex, then you have the full chainstate to look up txids (whether unspent or not) - so this needs to be addressed too. Doing this within my own node would be cool enough and I don't necessarily need it to go farther than that. However if I do get it working, I'd certainly try to submit a PR. I have no idea if any of this is possible, so I wanted to ask here for some guidance and maybe mentorship in this self-interest driven project. Also looking for this to be shot down mercilessly if it's just ridiculous. My abilities and skills are very low. My interest and persistence are high. Any help or ridicule invited ;) -- You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/bitcoindev/75628135-32ae-4df3-be52-9f7d054bc096n%40googlegroups.com. ------=_Part_1713_833547110.1714834807661 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
TLDR: I'd like to investigate the possibilities of extending decoderaw= transaction to include the fee (and maybe even sats per v/b).
I'm hoping it will be a good project for me to work on and bu= ild at least a tiny understanding of bitcoin development.

<= /div>
-----------------------------------------------------------------= -------

I use the createrawtransaction fun= ction to create transactions, and before broadcasting, I always like to use= decoderawtransaction to see if I made any mistakes.

=
I've sometimes messed up on the fee calculation, as I do that myself w= ith a calculator.

Unfortunately decoderawtransac= tion doesn't give me the fee information (for a very good reason, it is not= aware of the value of the inputs in the tx).

So= to double check the fees, instead of using createrawtransaction, I'll use = createpsbt and then go through the process of finalizing it so I can run de= codepsbt, which does give the fee along with all the other relevant data.

But the createpsbt process is more work for= a simple transaction where all UTXOs are in the wallet I am creating the r= awtx in.

My goal would be to modify decode= rawtransaction to perform these additional steps:
  1. Fetch UTXO = details for each input.
  2. Calculate the total input value.
  3. Su= btract the total output value to determine the fee.
Additiona= lly there are the considerations about whether the inputs in the transactio= n are in your wallet or not.

If I run lis= tunspent it gives me the info I need to create the raw tx or psbt, and it h= as the values of the UTXOs that will be used as inputs in my tx.

But I understand decoderawtransaction is meant to be used whether or not t= he keys are in your wallet (so I was thinking to make a command argument T/= F to show the fee value only if keys are in your wallet).

Altern= atively if you are running the command in a node with txindex, then you hav= e the full chainstate to look up txids (whether unspent or not) - so this n= eeds to be addressed too.

Doing this within my o= wn node would be cool enough and I don't necessarily need it to go farther = than that. However if I do get it working, I'd certainly try to submit a PR= .

I have no idea if any of this is possible, so I wan= ted to ask here for some guidance and maybe mentorship in this self-interes= t driven project. Also looking for this to be shot down mercilessly if it's= just ridiculous.

My abilities and skills are ve= ry low. My interest and persistence are high.

An= y help or ridicule invited ;)

--
You received this message because you are subscribed to the Google Groups &= quot;Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to bitcoind= ev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg= id/bitcoindev/75628135-32ae-4df3-be52-9f7d054bc096n%40googlegroups.com.=
------=_Part_1713_833547110.1714834807661-- ------=_Part_1712_337132614.1714834807661--