Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 211A4C0011 for ; Tue, 22 Feb 2022 18:05:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id ED1158188B for ; Tue, 22 Feb 2022 18:05:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -0.854 X-Spam-Level: X-Spam-Status: No, score=-0.854 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, NUMERIC_HTTP_ADDR=1.242, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=ham autolearn_force=no Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y3Xr5Y1c1IVr for ; Tue, 22 Feb 2022 18:05:35 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4D236817A9 for ; Tue, 22 Feb 2022 18:05:35 +0000 (UTC) Received: by mail-vk1-xa34.google.com with SMTP id x62so3102655vkg.6 for ; Tue, 22 Feb 2022 10:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EVc0+Gn3l+Crm3g/nBoNNx7t0Gy5TDjHPuyK3p/mybI=; b=X/SmKwxXfibQaQzYnwDm7Yh3e7f4DsrKWg1IKVzzMumc9NUUSUNaYEkmWWga3vc9zg 6btQNkyEJ1BZI4xZ6RCGyWcDrAwv7faT0DKGoeMJUAi/c/1B7gz+T/KW9nQ9ledm7G/T RomHr6AncB/ErSv1pV1n7daStZF9jzdwfkKiv9iGqTozdolw148IzVJj+ZPkhGuD/1y+ FnUvD0qGCUyFUfar86uyZYO3Xe4I49jhJadwvWH7dHoqL7lFw6lsXMRAsPzfWlIpNXul tXDkw7+uKH4zZONAEIfFfD48Tkd86MB6q1qLmIDEQiZxKHUh4ZCUqnEB/0MYEIgwTQTU FOrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EVc0+Gn3l+Crm3g/nBoNNx7t0Gy5TDjHPuyK3p/mybI=; b=pSAxRMks+q3lXBKShen5wP9wnZ0tPR6AU7UA+wPmYplX62CBvkI7+k9u7/20SXsRDg S+bkWAmp4ynKFPLVMMdFtE1dL3/n0Qa9iZwB4DLiaHQTYwy0yV91MH0IyPf5lgyXICqC 3XhP83XmU7V5gOs5jag47gGMkwwkv0NrPYdigw84LXLZ6b+rneabG3SVpXGLeHL822yM DrPM6XeQDu/QQg7zX72BIxIQ8CRDpmJZWH16TKHqy2OR7NrgW2dx/V1XYBVNOcS3K7HW HBKWxgzgM5bQ1HLKjA2ivcK3hJPUBPXSRTogsf17KB7DL1O0tPD2jGBIt8M57Ib+ZVz/ d/zw== X-Gm-Message-State: AOAM530ypPcNRNfSIzifXExrYd10Acv4JZWIPR57LJX5y8hyRXWircOP hqaQxSdb9QUI3UpSbLOGNfhXCkxpdoD5+/cbuQo19/nEZthmEA== X-Google-Smtp-Source: ABdhPJypRIrWEMcmV3eT9Y8dQ595xVJ0xSKg9HVLbofTO5Nh5iZKbxI8HjWr4f0HB0SCyoRTCjva2bKvf8mUzBNy1YE= X-Received: by 2002:a05:6122:2229:b0:32d:1642:b58b with SMTP id bb41-20020a056122222900b0032d1642b58bmr10688780vkb.27.1645553133658; Tue, 22 Feb 2022 10:05:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jeremy Rubin Date: Tue, 22 Feb 2022 10:05:21 -0800 Message-ID: To: Bitcoin development mailing list Content-Type: multipart/alternative; boundary="000000000000fda52e05d89f312f" X-Mailman-Approved-At: Tue, 22 Feb 2022 18:11:16 +0000 Subject: Re: [bitcoin-dev] BIP-119 CTV Meeting #4 Draft Agenda for Tuesday February 22nd at 12:00 PT 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, 22 Feb 2022 18:05:38 -0000 --000000000000fda52e05d89f312f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Devs, As promised, a Sapio Tutorial. In this tutorial we'll walk through how to use the Sapio CLI to generate contracts and play with them on the network. We'll use a congestion control tree because it's very simple! We will walk through this step-by-step during the meeting today. -1. Install JQ (json manipulating tool) if you don't have it / other things needed to run a bitcoin node. 0. Set up a node as described above. You'll likely want settings like this in your bitcoin.conf too: [signet] # generate this yourself rpcauth=3Dgenerateme:fromtherpcauth.pyfile txindex=3D1 signetchallenge=3D512102946e8ba8eca597194e7ed90377d9bbebc5d17a9609ab3e35e70= 6612ee882759351ae rpcport=3D18332 rpcworkqueue=3D1000 fallbackfee=3D0.0002 Get coins https://faucet.ctvsignet.com/ / DM me 1. Follow the install instructions on https://learn.sapio-lang.org/ch01-01-installation.html You can skip the the sapio-studio part / pod part and just do the Local Quickstart up until "Instantiate a contract from the plugin". You'll also want to run *cargo build --release* from the root directory to build the sapio-cli. 2. Open up the site https://rjsf-team.github.io/react-jsonschema-form/ 3. Run *sapio-cli contract api --file plugin-example/target/wasm32-unknown-unknown/debug/sapio_wasm_plugin_exampl= e.wasm* 4. Copy the resulting JSON into the RJSF site 5. Fill out the form as you wish. You should see a JSON like { "context": { "amount": 3, "network": "Signet", "effects": { "effects": {} } }, "arguments": { "TreePay": { "fee_sats_per_tx": 1000, "participants": [ { "address": "tb1pwqchwp3zur2ewuqsvg0mcl34pmcyxzqn9x8vn0p5a4hzckmujqpqp2dlma"= , "amount": 1 }, { "address": "tb1pwqchwp3zur2ewuqsvg0mcl34pmcyxzqn9x8vn0p5a4hzckmujqpqp2dlma"= , "amount": 1 } ], "radix": 2 } } } You may have to delete some extra fields (that site is a little buggy). Optionally, just modify the JSON above directly. 6. Copy the JSON and paste it into a file ARGS.json 7. Find your sapio-cli config file (mine is at ~/.config/sapio-cli/config.json). Modify it to look like (enter your rpcauth credentials): { "main": null, "testnet": null, "signet": { "active": true, "api_node": { "url": "http://0.0.0.0:18332", "auth": { "UserPass": [ "YOUR RPC NAME", "YOUR PASSWORD HERE" ] } }, "emulator_nodes": { "enabled": false, "emulators": [], "threshold": 1 }, "plugin_map": {} }, "regtest": null } 8. Create a contract template: *cat ARGS.json| ./target/release/sapio-cli contract create --file plugin-example/target/wasm32-unknown-unknown/debug/sapio_wasm_plugin_exampl= e.wasm | jq > UNBOUND.json* 9. Get a proposed funding & binding of the template to that utxo: *cat UNBOUND.json| ./target/release/sapio-cli contract bind | jq > BOUND.json* 10. Finalize the funding tx: *cat BOUND.json | jq ".program[\"funding\"].txs[0].linked_psbt.psbt" | xargs echo | xargs -I% ./bitcoin-cli -signet utxoupdatepsbt % | xargs -I% ./bitcoin-cli -signet walletprocesspsbt % | jq ".psbt" | xargs -I% ./bitcoin-cli -signet finalizepsbt % | jq ".hex"* 11. Review the hex transaction/make sure you want this contract... and then send to network: *./bitcoin-cli -signet sendrawtransaction 020000000001015e69106b2eb00d668d945101ed3c0102cf35aba738ee6520fc2603bd60a87= 2ea0000000000feffffff02e8c5eb0b000000002200203d00d88fd664cbfaf8a1296d3f7176= 25595d2980976bbf4feeb10ab090180ccdcb3faefd020000002251208f7e5e50ce7f65debe0= 36a90641a7e4d719d65d621426fd6589e5ec1c5969e200140a348a8711cb389bdb3cc0b1050= 961e588bb42cb5eb429dd0a415b7b9c712748fa4d5dfe2bb9c4dc48b31a7e3d1a66d9104bbb= 5936698f8ef8a92ac27a650663500000000* 12. Send the other transactions: *cat BOUND.json| jq .program | jq ".[].txs[0].linked_psbt.psbt" | xargs -I% ./target/release/sapio-cli psbt finalize --psbt % | xargs -I% ./bitcoin-cli -signet sendrawtransaction %* Now what? - Maybe load up the Sapio Studio and try it through the GUI? - Modify the congestion control tree code and recompile it? - How big of a tree can you make (I did about 6000 last night)? - Try out other contracts? -- @JeremyRubin On Mon, Feb 21, 2022 at 7:36 PM Jeremy Rubin wrote: > Hi All, > > Apologies for the late posting of the agenda. The 4th CTV meeting will be > held tomorrow at 12:00 PT in ##ctv-bip-review in Libera.chat. > > Tomorrow the conversation will be slightly more tutorial focused. If you > have time in advance of the meeting, it might be good to do some of this = in > advance. > > 1) Discussion: What is the goal of Signet? (20 minutes) > - Do we have a "decision function" of observations from a test networ= k? > - What applications should be prototyped/fleshed out? > - What level of fleshed out matters? > - Should we add other experiments in the mix on this net, like > APO/Sponsors? > - Should we get e.g. lightning working on this signet? > 2) Connecting to CTV Signet Tutorial (10 mins) > > We'll make sure everyone who wants to be on it is on it & debug any issue= s. > > *Ahead of Meeting: Build this > branch https://github.com/JeremyRubin/bitcoin/tree/checktemplateverify-si= gnet-23.0-alpha > * > > Connect to: > ``` > [signet] > > signetchallenge=3D512102946e8ba8eca597194e7ed90377d9bbebc5d17a9609ab3e35e= 706612ee882759351ae > addnode=3D50.18.75.225 > ``` > > 3) Receiving Coins / Sending Coins (5 mins) > There's now a faucet for this signet: https://faucet.ctvsignet.com > And also an explorer: https://explorer.ctvsignet.com > > 4) Sapio tutorial (25 minutes) > > *Ahead of meeting, if you have time: skim https://learn.sapio-lang.org > & download/build the sapio cli & plugin > examples* > > We'll try to get everyone building and sending a basic application (e.g. > congestion control tree or vault) on the signet (instructions to be poste= d > before meeting). > > We won't use Sapio Studio, just the Sapio CLI. > > 5) Sapio Q&A (30 mins) > > After some experience playing with Sapio, more general discussion about > the project and what it may accomplish > > 6) General Discussion (30 minutes) > > > Best, > > Jeremy > > -- > @JeremyRubin > --000000000000fda52e05d89f312f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Devs,

As pr= omised, a Sapio Tutorial. In this tutorial we'll walk through how to us= e the Sapio CLI to generate contracts and play with them on the network. We= 'll use a congestion control tree because it's very simple! We will= walk through this step-by-step during the meeting today.

-1. Ins= tall JQ (json manipulating tool) if you don't have it / other things ne= eded to run a bitcoin node.
0. Se= t up a node as described above.=C2=A0 You'll likely want settings like = this in your bitcoin.conf too:
[signet]
# gen= erate this yourself=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rpcauth=3Dgen= erateme:fromtherpcauth.pyfile=C2=A0 =C2=A0 =C2=A0
txindex=3D1
signetchallenge=3D512102946e= 8ba8eca597194e7ed90377d9bbebc5d17a9609ab3e35e706612ee882759351ae
rpcpor= t=3D18332
rpcworkqueue=3D1000
fallbackfee=3D0.0002
<= span style=3D"font-family:monospace">

1. Follow the install instructions= on http= s://learn.sapio-lang.org/ch01-01-installation.html You can skip the the= sapio-studio part / pod part and just do the Local Quickstart up until &qu= ot;Instantiate a contract from the plugin". You'll also want to ru= n cargo build --release from the root directory to build the sapio-c= li.


3. Run sapio-cli cont= ract api --file plugin-example/target/wasm32-unknown-unknown/debug/sapio_wa= sm_plugin_example.wasm

=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"YOUR RPC NAME&q= uot;,
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"YOUR PASSWOR= D HERE"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
= =C2=A0=C2=A0=C2=A0},
=C2=A0=C2=A0=C2=A0"emulator_nodes": {
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0"enabled":
false,
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0"emulators": [],

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"threshold": 1
=C2=A0=C2= =A0=C2=A0},
=C2=A0=C2=A0=C2=A0"= ;plugin_map": {}
=C2=A0}, =C2=A0"regtest": = null
}

8. Create a contract template:
cat ARGS.json| ./ta= rget/release/sapio-cli contract create =C2=A0--file plugin-example/t= arget/wasm32-unknown-unknown/debug/sapio_wasm_plugin_example.wasm =C2=A0| j= q > UNBOUND.json
9. Get a proposed funding &am= p; binding of the template to that utxo:

<= /span>cat UNBOUND.json| ./target/release/sapio-cli contract bind | jq &g= t; BOUND.json
10. Finalize the funding tx= :

cat BOUND.js= on | jq ".program[\"funding\"].txs[0].linked_psbt.psbt"= | xargs echo | xargs -I% ./bitcoin-cl= i -signet utxoupdatepsbt= % | =C2=A0xargs -I% ./bitcoin-cli -si= gnet walletprocesspsbt %= | jq ".psbt" | xargs -I% ./= bitcoin-cli -signet finalizepsbt % | jq ".hex"

= 11. Review the hex transaction/= make sure you want this contract... and then send to network:

./bitcoin-cli -signet sendrawtrans= action 020000000001015e69106b2eb00d668d945101ed3c0102cf35aba738ee6520fc2603= bd60a872ea0000000000feffffff02e8c5eb0b000000002200203d00d88fd664cbfaf8a1296= d3f717625595d2980976bbf4feeb
10ab090180ccdcb3faefd020000002251208f7e5e50= ce7f65debe036a90641a7e4d719d65d621426fd6589e5ec1c5969e200140a348a8711cb389b= db3cc0b1050961e588bb42cb5eb429dd0a415b7b9c712748fa4d5d
fe2bb9c4dc48b31a7= e3d1a66d9104bbb5936698f8ef8a92ac27a650663500000000



12. Send the other transactions:

cat BOUND.json| jq .program | jq ".[].txs[0].linked_psb= t.psbt" | xargs -I% ./target/release/sapio-cli psbt finalize --psbt % = =C2=A0| xargs -I% ./bitcoin-cli -signet sendrawtransaction %


Now what?

- Maybe load up the Sapio Studio and try it through= the GUI?
- Modify the congestion con= trol tree code and recompile it?
- Ho= w big of a tree can you make (I did about 6000 last night)?
- Try out other contracts?


On Mon, Feb 21= , 2022 at 7:36 PM Jeremy Rubin <jeremy.l.rubin@gmail.com> wrote:
Hi All,

Apologies for the late posting of the agenda. The= 4th CTV meeting will be held tomorrow at 12:00 PT in ##ctv-bip-review in L= ibera.chat.

Tomorrow the conversation will be slightly more t= utorial focused. If you have time in advance=C2=A0of the meeting, it might = be good to do some of this in advance.

1) Discussion: What is the goal of Signet? (20 minutes)
=C2=A0 =C2=A0 - Do we have a "decision function&qu= ot; of observations from a test network?
= =C2=A0 =C2=A0 - What applications should be prototyped/fleshed out?
=C2=A0 =C2=A0 - What level of fleshed out matter= s?
=C2=A0 =C2=A0 - Should we add other ex= periments in the mix on this net, like APO/Sponsors?
=C2=A0 =C2=A0 - Should we get e.g. lightning working on this si= gnet?
2) Connecting to CTV S= ignet Tutorial (10 mins)

We'll make sure everyone who wants= to be on it is on it & debug any issues.


Connect to:
```[signet]
signetchallenge=3D512102946e8ba8eca597194e7ed90377d9bbebc5d17a= 9609ab3e35e706612ee882759351ae
addnode=3D50.18.75.225
```
3) Receiving=C2=A0Coins / Sendin= g Coins (5 mins)
There's now a faucet for this signet:=C2=A0https://faucet.ctvsignet.com=
And also an explorer:=C2=A0https://explorer.ctvsignet.com

4) Sapio tutorial (25 minutes)

Ahead of meeti= ng, if you have time: skim https://learn.sapio-lang.org & download/build the sapio= cli & plugin examples
We'll try to get everyone bu= ilding and sending a basic application (e.g. congestion control tree or vau= lt) on the signet (instructions to be posted before meeting).

W= e won't use Sapio Studio, just the Sapio=C2=A0CLI.=C2=A0

5)= Sapio Q&A (30 mins)

After some experience playing with Sap= io, more general discussion about the project and what it may accomplish

6) General Discussion (30 minutes)


Best,

Jeremy

--000000000000fda52e05d89f312f--