Coder Social home page Coder Social logo

domob1812 / namecoin-core Goto Github PK

View Code? Open in Web Editor NEW
37.0 14.0 190.0 173.55 MB

Reimplementation of Namecoin on top of the current Bitcoin Core codebase.

License: MIT License

Shell 0.98% Python 20.83% Makefile 0.78% C++ 65.73% C 9.40% HTML 0.12% Objective-C++ 0.03% M4 1.11% Assembly 0.15% Scheme 0.12% CMake 0.32% Sage 0.32% Cap'n Proto 0.01% Dockerfile 0.03% QMake 0.01% Rust 0.07%

namecoin-core's Introduction

Namecoin Core integration/staging tree

Build Status

https://namecoin.org

What is Namecoin?

Namecoin is a decentralized open source information registration and transfer system based on the Bitcoin cryptocurrency.

What does it do?

  • Securely record and transfer arbitrary names (keys).
  • Attach a value (data) to the names (up to 520 bytes, more in the future).
  • Transact namecoins, the digital currency (ℕ, NMC).

Namecoin was the first fork of Bitcoin and still is one of the most innovative altcoins. It was first to implement merged mining and a decentralized DNS. Namecoin squares Zooko's Triangle!

What can it be used for?

  • Protect free-speech rights online by making the web more resistant to censorship.
  • Access websites using the .bit domain (with TLS/SSL).
  • Store identity information such as email, GPG key, BTC address, TLS fingerprints, Bitmessage address, etc.
  • Human readable Tor .onion names/domains.
  • File signatures, Voting, bonds/stocks,/shares, web of trust, escrow and notary services (to be implemented).

For more information, as well as an immediately useable, binary version of the Namecoin Core software, see https://www.namecoin.org/download.

License

Namecoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but is not guaranteed to be completely stable. Tags are created regularly to indicate new official, stable release versions of Namecoin Core.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

The developer forum should be used to discuss complicated or controversial changes before working on a patch set.

Developer IRC can be found on Freenode at #namecoin-dev.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Translation workflow is not yet set up for Namecoin Core. For strings which are common to Bitcoin Core, see below.

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

namecoin-core's People

Contributors

achow101 avatar ajtowns avatar domob1812 avatar dongcarl avatar fanquake avatar furszy avatar gavinandresen avatar glozow avatar gmaxwell avatar hebasto avatar instagibbs avatar jamesob avatar jnewbery avatar jonasschnelli avatar jonatack avatar laanwj avatar luke-jr avatar meshcollider avatar morcos avatar non-github-bitcoin avatar practicalswift avatar promag avatar ryanofsky avatar sdaftuar avatar sipa avatar sjors avatar thebluematt avatar thestack avatar theuni avatar vasild avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

namecoin-core's Issues

Weird ASM encoding issue

Hi, I may be totally off base here, but I'm running into a strange ASM encoding issue for the name_firstupdate script:

    {
        "value" : 0.01000000,
        "n" : 1,
        "scriptPubKey" : {
            "nameOp" : {
                "op" : "name_firstupdate",
                "name" : "AAA",
                "value" : "AAA",
                "rand" : "b2fcc738e6663deafa452e13af90fa420d0fc973"
            },
            "asm" : "OP_NAME_FIRSTUPDATE 4276545 b2fcc738e6663deafa452e13af90fa420d0fc973 4276545 OP_2DROP OP_2DROP OP_DUP OP_HASH160 a3290828f90dea7efd2b2493e01d5ed5e1374d6b OP_EQUALVERIFY OP_CHECKSIG",
            "hex" : "520341414114b2fcc738e6663deafa452e13af90fa420d0fc973034141416d6d76a914a3290828f90dea7efd2b2493e01d5ed5e1374d6b88ac",
            "reqSigs" : 1,
            "type" : "pubkeyhash",
            "addresses" : [
                "mvPfbGSc2SHXF1K9YS2vfocMuAmhPqgHPQ"
            ]
        }
    }

I can't figure out why, but on some names, like the one above (AAA), the ASM representation for the name and value is a number of some kind. In this case it's 4276545. The decoded JSON version is correct, though. Any thoughts on why this may be happening? Is this part of the protocol or encoding that I'm unaware of?

CONTEXT. I'm creating the transaction like this:

name_new AAA
# RESULT: [ "06e4266ad3cadffc67ffcfddb7caed9b38540124e69f3305de19249b4a95d222", "b2fcc738e6663deafa452e13af90fa420d0fc973" ]
# GENERATE COINS, then:
name_firstupdate AAA b2fcc738e6663deafa452e13af90fa420d0fc973 06e4266ad3cadffc67ffcfddb7caed9b38540124e69f3305de19249b4a95d222 AAA
# RESULT 82b263a1af58a1705aa9b0c60f65d7b75f8ddb9442786849679812fdfb923d38

PS: Should issues be filed here or namecoin/namecore ?

Name "namecore" is confusing

Since Bitcore is a Javascript library, the name Namecore sounds a bit confusing. Might be better to rename to Namecoin Core before releasing. (Someone brought this up on IRC.) Also, Namecoin Core will probably show up better in Google results for Namecoin. Thoughts?

When will this be ready for production use?

I'm interested in adding Namecoin to a site but we need block and wallet notify and the updated version of listunspent to work with our proof of reserve system. This seems like it would solve a lot of the issues we have with the main branch of Namecoin.

When do you think this will be production ready?

Document protocol differences between Bitcoin and Namecoin.

Quite a few libraries have been written for Bitcoin, which rely on arbitrary constant parameters to make it easier for developers to port tools and projects over Namecoin's parameters ought to be documented.

Since this is essentially another implementation of Namecoin, I think it ought to document those constants. I will collect what I learn in the comments below.

Auxpow Security

Hello @domob1812,

I have a question regarding to the security of auxpow.
Auxpow is not part of the CPureBlockHeader, so it will not be hashed.

Is there a security mechanism, that protects it against forgery?
What I think now is: Is it possible to manipulate a block and insert different auxpow?
I mean there would be no sence to do it, but there is no hash mechanism which validates, if this auxpow was the one, that was included in this block?

So if you would modify block X with a new auxpow, it is still valid, because the blockhash will not change.
Then you have a different auxpow for block X then all other nodes, and if someone syncs from you, you distribute the "wrong" auxpow. The requirement must be, that the auxpow is valid. But its a completly different auxpow, than it was at the beginning.

I hope you can understand what I mean, it would be nice to discuss.

Thank you.

auxpow tests and name tests failing (lock not held) on "bitcoind" Travis CI build

I enabled the standard Travis CI tests (there's already a Travis CI config file in the repo), and it looks like the master branch is failing.

You can see the current build status at https://travis-ci.org/JeremyRand/namecore/builds .

If you want to enable Travis CI builds for this repo (so you don't need me to merge changes into my repo) you can do that at https://travis-ci.org ; just log in with your GitHub account and enable builds for this repo.

Here is the relevant part of the log from the "bitcoind" build in the master branch:

Running 132 test cases...

Assertion failed: lock cs_main not held in wallet.cpp:2335; locks held:

unknown location(0): fatal error in "check_auxpow": signal: SIGABRT (application abort requested)

test/auxpow_tests.cpp(211): last checkpoint

Assertion failed: lock cs_main not held in wallet.cpp:2335; locks held:

unknown location(0): fatal error in "auxpow_pow": signal: SIGABRT (application abort requested)

test/auxpow_tests.cpp(354): last checkpoint

Assertion failed: lock cs_main not held in main.cpp:624; locks held:

unknown location(0): fatal error in "name_tx_verification": signal: SIGABRT (application abort requested)

test/name_tests.cpp(305): last checkpoint

Assertion failed: lock cs not held in ./txmempool.h:226; locks held:

unknown location(0): fatal error in "name_mempool": signal: SIGABRT (application abort requested)

test/name_tests.cpp(31): last checkpoint

*** 4 failures detected in test suite "Bitcoin Test Suite"

FAIL: test/test_bitcoin

Traceback (most recent call last):

File "./test/bitcoin-util-test.py", line 12, in <module>

"bitcoin-util-test.json",buildenv)

File "/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src/test/bctest.py", line 51, in bctester

bctest(testDir, testObj, buildenv.exeext)

File "/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src/test/bctest.py", line 27, in bctest

proc = subprocess.Popen(execrun, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE,universal_newlines=True)

File "/usr/lib/python2.7/subprocess.py", line 679, in __init__

errread, errwrite)

File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child

raise child_exception

OSError: [Errno 2] No such file or directory

FAIL: test/bitcoin-util-test.py

==================================

2 of 2 tests failed

Please report to [email protected]

==================================

make[3]: *** [check-TESTS] Error 1

make[3]: Leaving directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'

make[2]: *** [check-am] Error 2

make[2]: Leaving directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'

make[1]: *** [check-recursive] Error 1

make[1]: Leaving directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'

make: *** [check-recursive] Error 1

The command "if [ "$RUN_TESTS" = "true" ]; then make check; fi" exited with 2.

Full log is at https://travis-ci.org/JeremyRand/namecore/jobs/46025001

Gitian descriptors still refer to Bitcoin

Building with Gitian does not work out of the box, because the Gitian descriptors point to the Bitcoin GitHub repo, and list the output name as Bitcoin. See https://github.com/domob1812/namecore/blob/master/contrib/gitian-descriptors/gitian-linux.yml#L2 , https://github.com/domob1812/namecore/blob/master/contrib/gitian-descriptors/gitian-linux.yml#L20 , and https://github.com/domob1812/namecore/blob/master/contrib/gitian-descriptors/gitian-linux.yml#L21 for the ones that jump out at me on Linux. (I assume the same issues exist in Windows and OS X, but I haven't checked.)

I guess these should be replaced with the Namecoin name, and the namecoin/namecoin GitHub repo (after @domob1812 moves this code there). If for some reason we're not able to move the repo to namecoin/namecoin in the foreseeable future, then pointing to this repo would be an acceptable interim step.

Feature request: sendtoname

Currently this functionality can already be achieved by a combination of two RPCs (name_show and sendtoaddress). However, the sendtoname feature could become an important "unique selling proposition" in the future. Therefore sendtoname should be an RPC in its own right, I think.

undefined reference to `CMerkleTx::SetMerkleBranch(CBlock const&)' in auxpow tests (No Wallet build)

Looks like the "no wallet" build configuration on Travis CI is having trouble building the auxpow tests.

Making check in src
make[1]: Entering directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'
make[2]: Entering directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
    --min-age=<epoch>
    --sparse
    --no-merges
    --min-parents=<n>
    --no-min-parents
    --max-parents=<n>
    --no-max-parents
    --remove-empty
    --all
    --branches
    --tags
    --remotes
    --stdin
    --quiet
  ordering output:
    --topo-order
    --date-order
    --reverse
  formatting output:
    --parents
    --children
    --objects | --objects-edge
    --unpacked
    --header | --pretty
    --abbrev=<n> | --no-abbrev
    --abbrev-commit
    --left-right
  special purpose:
    --bisect
    --bisect-vars
    --bisect-all
  CXXLD  test/test_bitcoin
test/test_test_bitcoin-auxpow_tests.o: In function `auxpow_tests::CAuxpowBuilder::get(CTransaction const&) const':
auxpow_tests.cpp:(.text+0x1496): undefined reference to `CMerkleTx::SetMerkleBranch(CBlock const&)'
collect2: ld returned 1 exit status
make[2]: *** [test/test_bitcoin] Error 1
make[2]: Leaving directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/travis/build/JeremyRand/namecore/bitcoin-x86_64-unknown-linux-gnu/src'
make: *** [check-recursive] Error 1
travis_time:end:09145eb4:start=1420512527312109831,finish=1420512528992377282,duration=1680267451
�[0K
�[31;1mThe command "if [ "$RUN_TESTS" = "true" ]; then make check; fi" exited with 2.�[0m
travis_time:start:01d920bc
�[0K$ if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi
No rpc tests to run. Wallet, utils, and bitcoind must all be enabled
travis_time:end:01d920bc:start=1420512529000104606,finish=1420512529010702513,duration=10597907
�[0K
�[32;1mThe command "if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi" exited with 0.�[0m
travis_fold:start:after_script
�[0Ktravis_time:start:1593e274
�[0K$ {:"if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then (echo \"Upload goes here. Something like"=>"scp -r $BASE_OUTDIR server\" || echo \"upload failed\"); fi"}
/home/travis/build.sh: line 41: scp -r /home/travis/build/JeremyRand/namecore/out server" || echo "upload failed"); fi}: No such file or directory
travis_time:end:1593e274:start=1420512529018560808,finish=1420512529025724414,duration=7163606
�[0Ktravis_fold:end:after_script
�[0K
Done. Your build exited with 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.