From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D345FC58 for ; Sat, 9 Mar 2019 19:52:40 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AD7A2318 for ; Sat, 9 Mar 2019 19:52:39 +0000 (UTC) Received: by mail-wr1-f42.google.com with SMTP id l12so946029wrp.6 for ; Sat, 09 Mar 2019 11:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=dNRZCqMJLXAJRrhR9dZQ6PeRjqi0NlDn6gx/Jq6rYS8=; b=ZpOetsxLE3KiQJ86oZhuTYUz+q62wdutMqXLbTHkntRuTYHFrduWeycb3d8uC9Q47e biYVsC/tz9lplKn9oC19cIrrHysUGxOf9khbMJiK0JlsE9NZ43jP0lvUzmk29GuEMAWi b53gk+0afFjFRV9YrNGKUqZ9E7SBXwTsqsbi8Weu7bZi2wryDArSosJzdXekhtS188/z ZAib1XCulrnq3rys5kkxnQa7yjNN7JNleyfE1a6j9T9P4dT1byxmstCv0F0zRNhDHlEF 3PYMhOMZGBWbCYpd3YMQN68krIjCgVYUI8YseJup26eCLvzbE0r76FfxBYdVsci5waRM QEvw== 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:reply-to :from:date:message-id:subject:to; bh=dNRZCqMJLXAJRrhR9dZQ6PeRjqi0NlDn6gx/Jq6rYS8=; b=Wm6MiD/R7E9u0W8EHXKIg+i8PAo8uFZZvnmEXnz7LWeEzzrWNOGn14eKgkLKW1aMWz 8rkg81J17cZo9DY5fUExF3vFjIQHBU/OyixMGPv/XRmuC//wwfIrsONFxzYHkXhKcP5g 6VgX+3Rw1Tp215PKZamd3cvvqlWoBSoCtwAOgBzHYjzVjgFqzXx8/FnfIeYaDr7/7E2M 9cxM1O/lqQVxkKl/7rWx5bXGtx9SJHAt9vRSPSoO341eoSEIr3/4g9RoXBRaN/OgvEfJ FXrY97xwgz64UH9kjjmzkN6farhv/ddqgGYjOxto/PVjh1v5J3GBRyCZN4TMKAtiqHeJ 9+jg== X-Gm-Message-State: APjAAAW8l+kl3rt0l5HG15LKFj3a1OERltzMzvCI6malf34c/icdjYCr 3jHRyDtGVe9DecDQbG/TDYEQL+lQGOGp34AXfFxP2u4B X-Google-Smtp-Source: APXvYqy6/9n66RUhxs25S71N/zJqq3gq/k7x/ylu4y0P/d1fQl/8lsU3yH5Zmm+mjn/UtiaLHfsosqpN6denEA85dq0= X-Received: by 2002:adf:ba84:: with SMTP id p4mr15384550wrg.156.1552161158059; Sat, 09 Mar 2019 11:52:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: lautaro.dragan@gmail.com From: Lautaro Dragan Date: Sat, 9 Mar 2019 16:52:26 -0300 Message-ID: To: Karl-Johan Alm , Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="00000000000075dc6b0583aeae25" X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FREEMAIL_REPLYTO,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Sat, 09 Mar 2019 22:19:05 +0000 Subject: Re: [bitcoin-dev] Signet X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2019 19:52:40 -0000 --00000000000075dc6b0583aeae25 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Karl-Johan, my two cents: At Po.et we use regtest to simulate reorgs in integration tests in Travis / CircleCI. It has proved quite useful. In general regtest for automated testing has given us all we needed so far, but I admit we have a rather simple use of Bitcoin right now (colored coins). For local development, we sometimes use a script that "mines" blocks in regtest periodically. It was my goal to also use this method in QA, although we wound up using testnet and didn't encounter any problems so far= . Out of curiosity: what limitations did you find in using, for example, a private network of bitcoin core nodes running regtest? (this gives you the same power as centralization without any changes or extra functionality required) El vie., 8 de mar. de 2019 a la(s) 16:02, Karl-Johan Alm via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> escribi=C3=B3: > Hello, > > As some of you already know, I've been working on a network called > "signet", which is bascially a complement to the already existing testnet= , > except it is completely centralized, and blocks are signed by a specific > key rather than using proof of work. > > Benefits of this: > > 1. It is more predictable than testnet. Miners appear and disappear > regularly, causing irregular block generation. > > 2. Since it is centrally controlled, it is easy to perform global testing= , > such as reorgs (e.g. the network performs a 4 block reorg by request, or = as > scheduled). > > 3. It is more stable than testnet, which occasionally sees several > thousand block reorgs. > > 4. It is trivial to spin up (and shut down) new signets to make public > tests where anyone can participate. > > Anyone can create a signet at any time, simply by creating a key pair and > creating a challenge (scriptPubKey). The network can then be used globall= y > by anyone, assuming the creator sends some coins to the other participant= s. > > Having a persistent signet would be beneficial in particular to services > which need a stable place to test features over an extended period of tim= e. > My own company implements protocols on top of Bitcoin with sidechains. We > need multi-node test frameworks to behave in a predictable manner (unlike > testnet) and with the same standardness relay policy as mainnet. > > Signets consist of 2 parameters: the challenge script (scriptPubKey) and > the solution length. (The latter is needed to retain fixed length block > headers, despite having an additional payload.) > > I propose that a default persistent "signet1" is created, which can be > replaced in future versions e.g. if the coins are unwisely used as real > money, similarly to what happened to previous testnets. This signet is > picked by default if a user includes -signet without providing any of the > parameters mentioned above. The key holder would be someone sufficiently > trusted in the community, who would be willing to run the system (block > generation code, faucet, etc). It could be made a little more sturdy by > using 1-of-N multisig as the challenge, in case 1 <=3D x < N of the signe= rs > disappear. If people oppose this, it can be skipped, but will mean people > can't just jump onto signet without first tracking down parameters from > somewhere. > > Implementation-wise, the code adds an std::map with block hash to block > signature. This is serialized/deserialized as appropriate (Segwit witness > style), which means block headers in p2p messages are (80 + > solution_length) bytes. Block header non-contextual check goes from > checking if block header hash < target to checking if the payload is a > valid signature for the block header hash instead. > > Single commit with code (will split into commits and make PR later, but > just to give an idea what it looks like): > https://github.com/kallewoof/bitcoin/pull/4 > > I don't think this PR is overly intrusive, and I'm hoping to be able to > get signet code into Bitcoin Core eventually, and am equally hopeful that > devs of other (wallet etc) implementations will consider supporting it. > > Feedback requested on this. > > Attribution: parts of the signet code (in particular signblock and > getnewblockhex) were adapted from the ElementsProject/elements repository= . > When PR is split into atomic commits, I will put appropriate attribution > there. > > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > --00000000000075dc6b0583aeae25 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Karl-Johan, my two cents:

At Po.et w= e use regtest to simulate reorgs in integration tests in Travis / CircleCI.= It has proved quite useful.=C2=A0

In general regt= est for automated testing has given us all we needed so far, but I admit we= have a rather simple use of Bitcoin right now (colored coins).
<= br>
For local development, we sometimes use a script that "m= ines" blocks in regtest periodically. It was my goal to also use this = method in QA, although we wound up using testnet and didn't encounter a= ny problems so far.

Out of curiosity: what limitat= ions did you find in using, for example, a private network of bitcoin core = nodes running regtest? (this gives you the same power as centralization wit= hout any changes or extra functionality required)

El vie., 8 de mar. d= e 2019 a la(s) 16:02, Karl-Johan Alm via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.or= g> escribi=C3=B3:
Hello,

As som= e of you already know, I've been working on a network called "sign= et", which is bascially a complement to the already existing testnet, = except it is completely centralized, and blocks are signed by a specific ke= y rather than using proof of work.

Benefits of thi= s:

1. It is more predictable than testnet. Miners = appear and disappear regularly, causing irregular block generation.

2. Since it is centrally controlled, it is easy to perfor= m global testing, such as reorgs (e.g. the network performs a 4 block reorg= by request, or as scheduled).

3. It is more stabl= e than testnet, which occasionally sees several thousand block reorgs.

4. It is trivial to spin up (and shut down) new signet= s to make public tests where anyone can participate.

Anyone can create a signet at any time, simply by creating a key pair an= d creating a challenge (scriptPubKey). The network can then be used globall= y by anyone, assuming the creator sends some coins to the other participant= s.

Having a persistent signet would be beneficial = in particular to services which need a stable place to test features over a= n extended=C2=A0period of time. My own company implements protocols on top = of Bitcoin with sidechains. We need multi-node test frameworks to behave in= a predictable manner (unlike testnet) and with the same standardness relay= policy as mainnet.

Signets consist of 2 param= eters: the challenge script (scriptPubKey) and the solution length. (The la= tter is needed to retain fixed length block headers, despite having an addi= tional payload.)

I propose that a default persiste= nt "signet1" is created, which can be replaced in future versions= e.g. if the coins are unwisely used as real money, similarly to what happe= ned to previous testnets. This signet is picked by default if a user includ= es -signet without providing any of the parameters mentioned above. The key= holder would be someone sufficiently trusted in the community, who would b= e willing to run the system (block generation code, faucet, etc). It could = be made a little more sturdy by using 1-of-N multisig as the challenge, in = case 1 <=3D x < N of the signers disappear. If people oppose this, it= can be skipped, but will mean people can't just jump onto signet witho= ut first tracking down parameters from somewhere.

= Implementation-wise, the code adds an std::map with block hash to block sig= nature. This is serialized/deserialized as appropriate (Segwit witness styl= e), which means block headers in p2p messages are (80=C2=A0+ solution_lengt= h) bytes. Block header non-contextual check goes from checking if block hea= der hash < target to checking if the payload is a valid signature for th= e block header hash instead.

Single commit with co= de (will split into commits and make PR later, but just to give an idea wha= t it looks like):=C2=A0https://github.com/kallewoof/bitcoin/pull/4
=

I don't think this PR is overly intrusive, and I= 9;m hoping to be able to get signet code into Bitcoin Core eventually, and = am equally hopeful that devs of other (wallet etc) implementations will con= sider supporting it.

Feedback requested on this.

Attribution: parts of the signet code (in particula= r signblock and getnewblockhex) were adapted from the ElementsProject/eleme= nts repository. When PR is split into atomic commits, I will put appropriat= e attribution there.

_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev
--00000000000075dc6b0583aeae25--