elementsproject / elementsproject.github.io Goto Github PK
View Code? Open in Web Editor NEWhttps://elementsproject.org website
https://elementsproject.org website
I'm attempting to set this up in a virtual machine following the tutorial. My VM is allocated ample storage and memory and running Ubuntu 20.04.2 LTS as the underlying operating system. The PPA repository for installing Bitcoin no longer seems to work, so I went ahead and installed Bitcoin from https://bitcoincore.org/bin/bitcoin-core-0.21.1/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz, checking sha256 and signatures.
After installing Elements and setting up work environment, the following commands fail as there is no wallet, as one is not created by default.
Give them a few seconds to start up and then check they are running:
e1-cli getwalletinfo
e2-cli getwalletinfo
To get past this, I simply create wallets for both
e1-cli createwallet ""
e2-cli createwallet ""
And also for bitcoin
b-cli createwallet ""
Advancing forward in the tutorial to the next page, Using Elements to perform basic operations. From the tutorial the expectation is for the wallets to show 21 million bitcoin due to anyone can spend. But the balance is 0. With no balance on regtest, I can't proceed with sending to addresses generated by elements due to Insufficient funds.
So then since this is regtest, I do this to get 5000 coins available, and more in the immature balance
b-cli -generate 200
This doesn't help get access to initialfreecoins but may be viable to use for pegin
Simplify. Attempting just the standalone
The same is true if I take bitcoin out of the equation. Using just the standalone blockchain guidance found here: https://elementsproject.org/elements-code-tutorial/blockchain
# Args
STANDALONEARGS=("-validatepegin=0" "-defaultpeggedassetname=newasset" "-initialfreecoins=100000000000000" "-initialreissuancetokens=200000000")
# Startup
e1-dae ${STANDALONEARGS[@]}
# Have to create wallet before viewing it
e1-cli createwallet ""
# Has zero balance, but shows asset name as `newasset` as anticipated
e1-cli getwalletinfo
# Look at transaction in first block from startup initialfreecoins
tx1=`e1-cli getblock $(e1-cli getblockhash 0) | jq -r .tx[1]`
e1-cli decoderawtransaction `e1-cli getrawtransaction $tx1`
I can see the 1,000,000 newasset created in vout, as well as the 2 for reissuance.
How can I claim the coins to the wallet to test with?
https://elementsproject.org/features/confidential-transactions
That page refers to CTE being the prefix but I think it's VJ for Live Liquid and in elementsregtest it's Azp.
We should also note somewhere that that address format is only known to the sender and receiver and that it is a combination of the public address (what you see in blockstream.info for example) and the blinding keys the receiver uses.
Think we need to update to use berkely v 5 now in the build from source steps. We also could just refer to using the binaries as well, which is easier but you still need the example elements.conf files from the elements repository.
Site says to make install in the setting up elements page but then in setting up environment the alias links point o the elements src make output.
Probably can just remove make install then, tidier for updates etc.
https://elementsproject.org/elements-code-tutorial/confidential-transactions:
In the Elements protocol blinded addresses start with “CTE” and unblinded addresses start with a “2”,
https://elementsproject.org/features/confidential-transactions/addresses:
As you can see the unconfidential P2PKH address starts with a Q. P2SH start with H
Maybe the info about "2" prefix is out of date ?
Also it is not clear from the pages if it is possible to have multisignature confidential address. It would be good to include info if it is possible and if not, why.
This will enable us to install dependencies to the venv workspace without changing the users wider python set up at all.
(in progress, tested, just need to write up)
Point to Bitcoin core.
Is is multi-sig?
From sidechain.md: "watchmen P2SH address:"
Flask is a more up to date framework for python web apps.
Suggest just adding to the existing page and leaving django in there as well as both are popular.
Will have to either change elements asset_tutorial elements.conf to include
deprecatedrpc=generate
or add -deprecatedrpc=generate to e1-dae and e2-dae start up here. (prefer both to be sure)
Odd because it didn't use to.
From this page:
https://elementsproject.org/elements-code-tutorial/advanced-examples#raw
If you run all example it doesn't fail, if you run RIA alone it does fail. If you use POI (proof of issuance) alone that doesn't fail. It only fails when you run with RIA switch.
Will look into shortly.
Add a new features page with sublinks to give brief overview of:
asset-issuance
confidential-transactions
deterministic-pegs
signed-blocks
opcodes?
On elements tutorial: Basic operations
Explanation on "Anyone-can-spend" was great, especially for users who have not done bitcoin script..
However paragrah below is not so clear to me:
Let’s drain the “anyone-can-spend” values and send half the assets to a new address generated by each Elements node. We’ll also need to generate more than 100 blocks so that the coins are spendable (a requirement of the maturity rule for spending coinbase rewards):
Any reason for picking 100 blocks and not 1 block?
What is "the maturity rule for spending coinbase rewards" referring to?
Tutorial mentions to paste:
using System;
namespace ExampleMVC.Models
{
public class ExampleNodeInfo
{
public string Balance { get; set; }
public string Message { get; set; }
//Add whatever other properties you want here
}
}
Had to change to:
using System;
namespace ElementsMVC.Models
{
public class ExampleNodeInfo
{
public string Balance { get; set; }
public string Message { get; set; }
//Add whatever other properties you want here
}
}
Otherwise dotnet would not run with error:
Controllers/HomeController.cs(31,25): error CS0246: The type or namespace name 'ExampleNodeInfo' could not be found (are you missing a using directive or an assembly reference?)
No biggie but when sending an asset to e.g Bob as part of tutorial : issuing-assets
A string is generated, would be nice to know what it is
e1-cli sendtoaddress $E2DEMOADD 10 "" "" false Prepaid-Credit-Mobile
**cc6408d0070bc87898fd4df2dc88f90a9660d901920391d7fdf74645f5b87f92**
Same comment when you use generate command
e1-cli generate 1
[
"**512356e0179a3f122ee2fb7626e89ac2130d78b3584985ab28da1ec0fad4fdac**"
]
con_dyna_deploy_start=9999999999999 for example.
Will amend now.
With =0 you hit an issue after 431 blocks have been created.
Again no big deal but for clarify I would change below.
Checking the output of that:
COMPLETE=$(echo $BLOCKRESULT | jq '.complete' | tr -d '"')
SIGNBLOCK=$(echo $BLOCKRESULT | jq '.hex' | tr -d '"')
We see a result of “True” for the “complete” property as we have signatures from enough keys to satisfy the 2 of 2 requirement. So “complete” in this context means “has enough signatures for the ‘n of m’ multi-sig to be valid”.
Now submit the block, it doesn’t matter who does this as long as they have a signed and valid block hex (which we have stored in the ‘SIGNBLOCK” variable from the results of calling “combineblocksigs”):
e2-cli submitblock $SIGNBLOCK
Checking the output of that:
COMPLETE=$(echo $BLOCKRESULT | jq '.complete' | tr -d '"')
echo $COMPLETE
We see a result of “True” for the “complete” property as we have signatures from enough keys to satisfy the 2 of 2 requirement. So “complete” in this context means “has enough signatures for the ‘n of m’ multi-sig to be valid”.
Now extract and submit the block, it doesn’t matter who does this as long as they have a signed and valid block hex (which we have stored in the ‘SIGNBLOCK” variable from the results of calling “combineblocksigs”):
e2-cli submitblock $SIGNBLOCK
SIGNBLOCK=$(echo $BLOCKRESULT | jq '.hex' | tr -d '"')
These need to be changed as they will not work presently until the tutorial code is amended to match the parameters used by elements 0.17
errors:
getinfo
getwalletinfo assetlabel
sendtoaddress
This simplifies the example code and leaves the examples in a state where they can be expanded upon with less developer effort.
https://elementsproject.org/elements-code-tutorial/issuing-assets says we installed jq as part of set up but the set up has changed to use the binaries now so that's not true.
e.g. getnewaddress returns something like:
AzpkfveJCn2frbBWqxFBTsbkDWfNAUo1Q3zSU7Fyt8VQ9FdRFFZvk5sGJSWk2AGnxYmyoxwFexuWebku
In the confidential-transactions page we refer to:
"In the Elements protocol blinded addresses start with “CTE” and unblinded addresses start with a “2”, so we can see that the address we have just generated for Bob is indeed a blinded, confidential address."
...which now appears to be incorrect.
When you select RPC Docs the page content shifts.
I think this is because it uses a different div (class page and not class post). But this is also probably related to the index files being .html but containing markdown and not .md files.
The following do not link to any details:
Schnorr Signature Validation
Signature Covers Value
Are descriptions needed?
Also - things like Confidential Transactions link to tutorial explanations and not their own page, which could be useful.
Outlining:
Watchmen pen in and out process and Block Signing.
The line...
SIGN1=$(e1-cli signblock $HEX)
fails with error 8 - "Signing dynamic blocks requires the witnessScript argument"
This is a change in 0.18 release relating to dynamic blocks.
Looking at fixing this now...
con_dyna_deploy_start
has been deprecated and decommissioned. Since v0.21.0.1 evbparams is used instead.
evbparams=dynafed:0:::
instead of con_dyna_deploy_start=0
Thanks to @pgreco for pointing this out.
In script runtutorial.sh a sample address is hardcoded which will result in line not working.
###### ASSETS #######
e1-cli getwalletinfo
e1-cli getwalletinfo bitcoin
e1-cli dumpassetlabels
e1-cli getwalletinfo b2e15d0d7a0c94e4e2ce0fe6e8691b9e451377f6e46e8045a86f7c4b5d4f0f23
Could be changed to
###### ASSETS #######
e1-cli getwalletinfo
e1-cli getwalletinfo bitcoin
e1-cli dumpassetlabels
e1-cli getwalletinfo $(e1-cli dumpassetlabels | jq '.bitcoin' | tr -d '"')
Community page links to Slack, Discussion mailing list and IRC.
Not sure if all of these are still active community discussion forms.
Link on this page is broken. Video no longer available.
https://elementsproject.org/features/confidential-transactions
The values in the referenced lines refer to old parameters, now (after ElementsProject/elements#834 was merged) CT_BITS allow to cover the whole range of 21M expressible on Bitcoin. Also, as I understand, min_value
for a long time was 1, allowing to blind values from 1 satoshi (https://github.com/ElementsProject/elements/blob/95602ec21f0b3ec4a58f36bbc1c53bb757c97701/src/blind.cpp#L184)
The current Let's Encrypt TLS certificate for www.elementsproject.org
is issued to www.blockstream.com
and is throwing errors in Chrome, Safari, curl
and presumably other browsers. Tested on macOS.
curl -v https://www.elementsproject.org/
* Trying 35.193.30.29...
* Connected to www.elementsproject.org (35.193.30.29) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /opt/local/share/curl/curl-ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=www.blockstream.com
* start date: 2018-12-01 19:00:10 GMT
* expire date: 2019-03-01 19:00:10 GMT
* subjectAltName does not match www.elementsproject.org
* SSL: no alternative certificate subject name matches target host name 'www.elementsproject.org'
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
curl: (51) SSL: no alternative certificate subject name matches target host name 'www.elementsproject.org'
https://www.elementsproject.org - invalid certificate for www.blockstream.com
.
Serial Number: 03 B2 9A FE 11 E9 0C 25 09 41 BA CF 68 D7 09 50 83 2A
https://elementsproject.org - valid cert
Serial Number: 03 78 2B 25 D1 DC 36 E6 4C FA DA 0C 6B CA 05 C8 79 C1
blockchain/sidechain can go into how it works and community reinstated at top level menu.
mentioned on landing page in benefits table.
"For the above command it is worth noting that only the hex value can be passed in and not the label. Along with the original issuance you should see a new entry with the following property:"
I think this was fixed a few months ago and a label can now be passed in.
GitHub Pages doesn't currently support creating a certificate that covers both the root domain and a www subdomain.
SSL is currently applied to https://elementsproject.org
Leaving this issue open as a placeholder/notice.
we don't need qt5 dependancies and should ./configure using --without-gui flag really.
I can't actually build elements from source at the minute - which is another issue I will log elsewhere
There is perhaps too much space under the elements logo.
Following bitcoind
installation instructions here: https://elementsproject.org/elements-code-tutorial/installing-bitcoin
It was necessary to run sudo add-apt-repository universe
with Ubuntu 18.04.1 Server in order for bitcoind
dependencies to be located.
This is fine in that the page forwards correctly but looks odd.
Change links to fully qualified or relate path.
Some existing links to pages that no longer exist in the new site will 404 and there is no custom 404 page yet.
Diagram could follow the process in steps 1 to 5.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.