From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 358A8C016F for ; Tue, 9 Jun 2020 09:35:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 112C5204EE for ; Tue, 9 Jun 2020 09:35:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OGgankw2Ti4O for ; Tue, 9 Jun 2020 09:35:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by silver.osuosl.org (Postfix) with ESMTPS id EA7142049B for ; Tue, 9 Jun 2020 09:35:24 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id o15so21561330ejm.12 for ; Tue, 09 Jun 2020 02:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ZiG43gRVeJJe9xf0K7fowHKk7yV4/rNwQusWx5gt9E=; b=cdrwfeMGVRItM3UuLr2JnUOxzXJJSEYsIx38cn8VtwtdxvmW0KbJAbwsa7Hn6GQ95M Qx8S1y6i2uTcWwxh+cuJ998x0Qex8Kk8B16m2TheH/4+pWuhEPD+2IwSroGyZyHPe0Xw vehCDH9mG2L3wP69R/esxxRNXL+HR7xnMf0ZqEUZ6niMFLOMyK4gwJZ0QOxcbK4J1p/U jSZBWDjIAerHDG4CctvQeJGdEVPbhDOKh0VnUMvrCRXVMwvHnkVf66aIGWsfzWE6PaKQ YyG0mepw5uXocQqJYi0gU4F09ffNszIrdvhwMV0b4GP3M5HNsIWvrz1mEwhE7hVTXmQA 7ugg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ZiG43gRVeJJe9xf0K7fowHKk7yV4/rNwQusWx5gt9E=; b=BrSwtPbdOYTpNGzN7zbcYlp9kk23+PpPiSwriVhMmbLYWNEY4Q14+GCzPrX6Ap3Q2k IMUEGDom3QXlaJAQcrvIRE0huJrBsHd7lnnxtMsiXwWJKA1KlCY2hXR2gcCdBPOYMmyq CHPR2SUsf4NLp3EH/sFP1R5FCvaf1XRGbg9qTPL/NEKTLmzts8sji4x1Dg0tHGjcxQoh LlgC4B91uedRhUXh2U69Ijn0QJ13OOSkzHcpiizHOtdoal+GgxuW5NrZz2FSAD+eTTX/ cqtlxFq6WiA4ZRoDpHk9aQcl0BnnCpyCW+FtwUqi29bjamwZhW8uMYg9Z1WHvo3W/H6C HQjA== X-Gm-Message-State: AOAM5338iMSf2IbAK627y/CXccqF2zEG+33Vv/CXxhRQytHmON/PqpkW 09lIYxNDOXkfuVppnVuMkXy4+WGVe0iVeBhpxfM= X-Google-Smtp-Source: ABdhPJwolRW7bqCoCZqExO5Dt8+2YjL9hxwAQqgBlXXh0EDL15GtUWhRJdsM5ajfObpKwi1wIEA7KdHbPo7eBMK4/Xg= X-Received: by 2002:a17:906:d105:: with SMTP id b5mr9561196ejz.375.1591695323215; Tue, 09 Jun 2020 02:35:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mostafa Sedaghat joo Date: Tue, 9 Jun 2020 17:34:57 +0800 Message-ID: To: ZmnSCPxj Content-Type: multipart/alternative; boundary="00000000000054c06105a7a372e1" X-Mailman-Approved-At: Tue, 09 Jun 2020 11:20:25 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] Stamping transaction 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: Tue, 09 Jun 2020 09:35:27 -0000 --00000000000054c06105a7a372e1 Content-Type: text/plain; charset="UTF-8" Good day ZmnSCPxj As I said before, I don't expect a hard fork for this change. I wanted to share my thoughts with you guys. Anytime the bitcoin community decides to make a hard-fork, you might consider this change as well. I believe decoupling transactions from the block is beautiful. About transaction verification, Transactions have their own way to survive. Owner of the coin can keep the history of his transactions. But there is no guarantee that ndes should keep all of them from the genesis. It depends. Maybe some nodes want to keep all the transactions, some part of them and might nothing. Also we can think about check pointing. When a new node connects to the network, it doesn't need to validate all the blocks since genesis. It can start validating from a checkpoint. And also adding 32 bits to the header of translation (which won't be saved inside the block) is not a big deal. Adios, Mostafa On Sun, Jun 7, 2020 at 11:01 PM ZmnSCPxj wrote: > Good morning Mostafa, > > > > The main point of stamping transactions is decoupling transactions from > the block. > > > > Blockchain size matters > > SegWit is a good witness that shows blockchain size matters. > Nowadays, Data storage is cheap and easy, but that doesn't mean it's a > simple matter. If you need to have a data-center to keep a copy of a > blockchain, then you are far from a decentralization system. > > > > A Solution > > Stamping transaction is a simple idea to keep the size of the blockchain > as small as possible. The question that I was looking to answer is how we > can decouple the transaction from the blocks. > > Who cares about the transaction that happened 10 years ago. In the real > world you may go to your bank and ask them to give you transaction history. > But they probably have limits. They might say we just only keep the last 3 > months in our system. > > Stamping transaction is not how you would be able to keep **blockchain** > size low. > > The reason why very old history is retained is that, if a new node is > brought up, you need to prove to that node that you are in fact the correct > owner of the current coins. > Thus the entire history of Bitcoin is needed when starting a new node, and > why archive nodes exist. > > You might argue that banks do not do that, and that is because we want to > do better than banks; we know that existing currency systems have not only > the "official" minter, but also many "unofficial" minters (commonly called > counterfeiters) which dilute the value of the currency. > It is this insistence on a full accounting of the provenance for every > satoshi that separates Bitcoin from previous currency systems; bank fraud > exists, and it hides in such sloppy techniques as deleting old transaction > records. > > Work has been done to have client-side validation (i.e. the owner of a > coin keeps the entire history, and when paying, you hand over the entire > history of your coin to the payee, instead of everyone validating every > transaction). > Look up Peter Todd for some initial work on this. > > > > Implementation > > > > > First off, the proposed mechanism can be made into a softfork by using > an unspendable `scriptPubKey` with 0 output value. > > SoftFork is not possible here. Because the transaction will not be saved > inside the block (only tx hashes). Block format needs to be changed. > Therefore the block will be invalid. > > That greatly reduces the chances your proposal will get into Bitcoin; you > would need to have very good advantages to counterbalance the tremendous > risk that hardforks introduce in the continuity of the coin. > > Bitcoin has never gone through a hardfork that has not instead created a > new cryptocurrency, so any solution that requires a hardfork is going to be > unlikely to be accepted by everyone. > > > > Engineering-wise, block validation now needs to memorize the last N > block hashes. > > I don't think we need to memorize the last N block hashes. We can have > something like: > > ``` > > Current_Height - Height_Of(tx.stamp) <= N > > ``` > > ... > > > `Height_Of()` would basically be a mapping from block hashes to block > heights, with the number of elements equal to the height of the blockchain, > and thus continuously growing. > Thus, validation is expected to become more expensive as the blockchain > grows. > > Since stamped transactions have a time-to-live anyway, instead you can use > a *set* of the most recent N block hashes. > Then you simply check if the stamp is in the set. > This creates a data structure that is constant in size (at each block, you > remove the block from N blocks ago), which is good for validation. > > > Incentives > > I think Stamping transactions have nothing to do with the > incentivization mechanism. Forgive me if I couldn't get your point. > > A stamped tranasction has a stamp, an unstamped transaction has no stamp. > The stamped transaction is larger because of the stamp. > Larger transactions are more expensive because fees. > > Thus, stamped transactions are more expensive than unstamped transactions. > > Convince me why I would make *my* transaction stamped when I can just > convince *everyone else* to stamp *their* transactions and use unstamped > transactions myself. > > If you propose that all transactions must be stamped in a new version of > Bitcoin, then take note that users will prefer to run older versions and > never upgrade to the new version that requires stamped transactions. > Why should users prefer a more expensive transaction format? > For the good of the network? > That is precisely an incentives problem: if it is so good for the network, > then it should be good for an individual user, because the network is made > up of individual users anyway; if individual users are not incentivized to > use it, then that fact suggests it might not be as good for the network as > you might think. > > If you answer "the stamp can be discounted" then be aware that validating > the stamp is still a cost on every node, and it is that cost that we want > to be reflected in pricing every byte in the transaction. > For instance, UTXOs are retained, potentially indefinitely, and the UTXO > lookup structure has to be very fast and is referred to at every > transaction validation, so outputs (which create new UTXO entries) in > SegWit are 4x more expensive than signatures, since signatures are only > validated once when the transaction is queued to be put in the mempool. > > > > Mempool > > It's bad of me that I don't really know how mempool works in Bitcoin. My > assumption is that there are some junk transactions (transactions that are > valid but have very low or zero fees) inside the mempool. Stamping > transactions might help to get rid of them time to time. > > Why would you think that stamping reduces mempool size? > > If I wanted to I could just re-send the transaction with a fresh stamp. > Then the mempool usage would still be the same, and bandwidth use will > increase (because the same transaction is now re-broadcast with a fresh > stamp, and the added size of the stamps themselves). > > > Regards, > ZmnSCPxj > > --00000000000054c06105a7a372e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Good day ZmnSCPxj

As I said before, I d= on't expect a hard fork for=C2=A0this change. I wanted to share my thou= ghts with you guys. Anytime the bitcoin community decides to make a hard-fo= rk, you might consider this change as well.=C2=A0
I believe=C2=A0= decoupling transactions from the block is beautiful.=C2=A0

=C2=A0About transaction verification,
Transactions have = their own way to survive. Owner of the=C2=A0coin can keep the history of hi= s transactions.
But there is no guarantee=C2=A0that ndes should k= eep all of them from the genesis. It depends. Maybe some nodes want to keep= =C2=A0 all the transactions, some part of them and might nothing.
Also we can think about check pointing. When a new node connects to the ne= twork, it doesn't need to validate all the blocks since genesis. It can= start validating from a checkpoint.=C2=A0

And als= o adding 32 bits to the header of translation=C2=A0(which won't be save= d inside the block) is not a big deal.


<= div>Adios,
Mostafa=C2=A0


<= /div>
O= n Sun, Jun 7, 2020 at 11:01 PM ZmnSCPxj <ZmnSCPxj@protonmail.com> wrote:
Good morning Mostafa,<= br>

> The main point of stamping transactions is decoupling transactions fro= m the block.=C2=A0
>
> Blockchain size matters
> SegWit is a good witness that shows blockchain size matters. Nowadays,= =C2=A0Data storage is cheap and easy, but that doesn't mean it's a = simple matter. If you need to have a data-center to keep a copy of a blockc= hain, then you are far from a decentralization system.=C2=A0
>
> A Solution
> Stamping=C2=A0transaction is a simple idea to keep the size of the blo= ckchain as small as possible. The question that I was looking to answer is = how we can decouple the transaction from the blocks.
> Who cares about the transaction that happened=C2=A010 years ago. In th= e real world you may go to your bank and ask them to give you transaction= =C2=A0history. But they probably have limits. They might say we just only k= eep the last 3 months in our system.=C2=A0

Stamping transaction is not how you would be able to keep **blockchain** si= ze low.

The reason why very old history is retained is that, if a new node is broug= ht up, you need to prove to that node that you are in fact the correct owne= r of the current coins.
Thus the entire history of Bitcoin is needed when starting a new node, and = why archive nodes exist.

You might argue that banks do not do that, and that is because we want to d= o better than banks; we know that existing currency systems have not only t= he "official" minter, but also many "unofficial" minter= s (commonly called counterfeiters) which dilute the value of the currency.<= br> It is this insistence on a full accounting of the provenance for every sato= shi that separates Bitcoin from previous currency systems; bank fraud exist= s, and it hides in such sloppy techniques as deleting old transaction recor= ds.

Work has been done to have client-side validation (i.e. the owner of a coin= keeps the entire history, and when paying, you hand over the entire histor= y of your coin to the payee, instead of everyone validating every transacti= on).
Look up Peter Todd for some initial work on this.


> Implementation
>
> > First off, the proposed mechanism can be made into a softfork by = using an unspendable `scriptPubKey` with 0 output value.
> SoftFork is not possible here. Because the transaction will not be sav= ed inside the block (only tx hashes). Block format needs to be changed. The= refore the block will be invalid.

That greatly reduces the chances your proposal will get into Bitcoin; you w= ould need to have very good advantages to counterbalance the tremendous ris= k that hardforks introduce in the continuity of the coin.

Bitcoin has never gone through a hardfork that has not instead created a ne= w cryptocurrency, so any solution that requires a hardfork is going to be u= nlikely to be accepted by everyone.

> >=C2=A0Engineering-wise, block validation now needs to memorize the= last N block hashes.
> I don't think we need to memorize the last N block hashes.=C2=A0 W= e can have something like:
> ```
> Current_Height - Height_Of(tx.stamp) <=3D N=C2=A0
> ```

...


`Height_Of()` would basically be a mapping from block hashes to block heigh= ts, with the number of elements equal to the height of the blockchain, and = thus continuously growing.
Thus, validation is expected to become more expensive as the blockchain gro= ws.

Since stamped transactions have a time-to-live anyway, instead you can use = a *set* of the most recent N block hashes.
Then you simply check if the stamp is in the set.
This creates a data structure that is constant in size (at each block, you = remove the block from N blocks ago), which is good for validation.

> Incentives
> I think Stamping transactions have nothing to do with the incentivizat= ion=C2=A0mechanism.=C2=A0 Forgive me if I couldn't get your point.

A stamped tranasction has a stamp, an unstamped transaction has no stamp. The stamped transaction is larger because of the stamp.
Larger transactions are more expensive because fees.

Thus, stamped transactions are more expensive than unstamped transactions.<= br>
Convince me why I would make *my* transaction stamped when I can just convi= nce *everyone else* to stamp *their* transactions and use unstamped transac= tions myself.

If you propose that all transactions must be stamped in a new version of Bi= tcoin, then take note that users will prefer to run older versions and neve= r upgrade to the new version that requires stamped transactions.
Why should users prefer a more expensive transaction format?
For the good of the network?
That is precisely an incentives problem: if it is so good for the network, = then it should be good for an individual user, because the network is made = up of individual users anyway; if individual users are not incentivized to = use it, then that fact suggests it might not be as good for the network as = you might think.

If you answer "the stamp can be discounted" then be aware that va= lidating the stamp is still a cost on every node, and it is that cost that = we want to be reflected in pricing every byte in the transaction.
For instance, UTXOs are retained, potentially indefinitely, and the UTXO lo= okup structure has to be very fast and is referred to at every transaction = validation, so outputs (which create new UTXO entries) in SegWit are 4x mor= e expensive than signatures, since signatures are only validated once when = the transaction is queued to be put in the mempool.


> Mempool
> It's bad of me that I don't really know how mempool works in B= itcoin. My assumption is that there are some junk transactions (transaction= s that are valid but have very low or zero fees) inside the mempool. Stampi= ng transactions might help to get rid of them time to time.=C2=A0

Why would you think that stamping reduces mempool size?

If I wanted to I could just re-send the transaction with a fresh stamp.
Then the mempool usage would still be the same, and bandwidth use will incr= ease (because the same transaction is now re-broadcast with a fresh stamp, = and the added size of the stamps themselves).


Regards,
ZmnSCPxj

--00000000000054c06105a7a372e1--