Search content
Sort by

Showing 9 of 9 results by mvrcrypto
Post
Topic
Board Altcoin Discussion
Re: Receiving eth by contract and call fallback function
by
mvrcrypto
on 05/02/2018, 11:36:40 UTC
Yes, this is correct. Look at the ethereum crowdsale example https://ethereum.org/crowdsale

Code:
    /**
     * Fallback function
     *
     * The function without name is the default function that is called whenever anyone sends funds to a contract
     */
    function () payable {
        require(!crowdsaleClosed);
        uint amount = msg.value;
        balanceOf[msg.sender] += amount;
        amountRaised += amount;
        tokenReward.transfer(msg.sender, amount / price);
        FundTransfer(msg.sender, amount, true);
    }
Post
Topic
Board Altcoin Discussion
Re: Web3.js question
by
mvrcrypto
on 05/02/2018, 11:29:23 UTC
1 to run web3.js whether I must run Geth on the same server

You only need to connect to a node in rpc.
Web3.js make the connection between the blockchain and your back-end.
Then, you choose to use a particular smart-contract on the chain using web3js.

So, to recap, you have to deploy your smart-conttract on the blockchain.
Set up a node (or more).
And connect your back-end to your node with web3js in order to communicate with your smart-contract.
Post
Topic
Board Development & Technical Discussion
Re: Point addition / double formulas in Bitcoin
by
mvrcrypto
on 01/02/2018, 16:17:31 UTC
If you have some basics in python, you can check the bitcoin library.
It's complete and simpler than the C++ core library.
Check https://github.com/vbuterin/pybitcointools/blob/aeb0a2bbb8bbfe421432d776c649650eaeb882a5/bitcoin/main.py
Post
Topic
Board Development & Technical Discussion
Re: Bitcoin’s Public-Key Security Level
by
mvrcrypto
on 01/02/2018, 08:23:44 UTC
What do you think of P2WKH (160bit hash of pubkey) vs P2WSH (256bit hash of pubkey) security?

In P2WKH you have to re-built an unknow script, and if you want to unlock a P2WKH Tx, you have to found a sha256 collision with the lock script of this transaction.
To me, it is still very secure unless you break sha256 and then, find a way to create a new valid script corresponding to the precedent hash.
Post
Topic
Board Development & Technical Discussion
Re: Is it possible to generate an already existing seed?
by
mvrcrypto
on 30/01/2018, 16:17:26 UTC
Yes it is possible to generate an existing seed. But hard. And it is harder to find a collision with a particular one.
If you want to know more about the odds, you can take a look at the birthday problem https://en.wikipedia.org/wiki/Birthday_problem.
You can also find someone who did the math here : https://download.wpsoftware.net/bitcoin-birthday.pdf
Post
Topic
Board Development & Technical Discussion
Merits 3 from 2 users
Re: OP_CHECKLOCKTIMEVERIFY / OP_HODL script
by
mvrcrypto
on 30/01/2018, 12:59:00 UTC
⭐ Merited by DannyHamilton (2) ,achow101 (1)
Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How do I calculate the Exponent for public/private keys
by
mvrcrypto
on 30/01/2018, 12:47:37 UTC
⭐ Merited by AGD (1)
Bitcoin don't use RSA but ECDSA.
Your private key D is a 256bits unsigned integer.
Then, you can calculate your public key by multiplying D with a generator point G on an elliptic curve.
On bitcoin, the standard is https://en.bitcoin.it/wiki/Secp256k1.
There is no exponent, or i don't understand what you call exponent (since it's not RSA).
Post
Topic
Board Development & Technical Discussion
Re: Elliptic curve point of R
by
mvrcrypto
on 30/01/2018, 12:41:04 UTC
I did convert the 32 bytes into integer and I believe the curve point is generated using the order of the base point, now can we remove the order of the base point and look at only the values on the curve?

No you can't. On elliptic curve you can multiply a point by a number, but you can't divide a point by anything.
If you could, we had know k and thus we can retrieve private keys from every p2pk signatures on the bitcoin network.

Edit: Or if you want to substract the point (not divide it), you can add the point G'=(Gx, -Gy).
Then, you will have P-G=P+G'
Post
Topic
Board Development & Technical Discussion
Weird ECC calculations
by
mvrcrypto
on 18/01/2018, 11:30:51 UTC
Hello,

I'm learning about bitcoin and while i was testing addresses generation i ran into weird things.

Code:
If we generate a 256bits private key k and generate corresponding public key Q.
We could split k in k1 (first 128 bits) and k2 (last 128bits)
Then we generate a set with all 128bits private key and their corresponding public keys.
So, in theory, for each public key in the set:
    we multiply the public key by 2^128
    then, we substract Q to the result
    we test if we have the result in the set
    if yes, we have found k

But what is weird is i always found one approximation of k and not the true k.

Here is a link to the experience in python if i'm not clear enough : https://github.com/mvrcrypto/bitp0wn/blob/master/substract_optim.py

EDIT: Okay, i now have one and only one k and i can retrieve the good one. You can get the programm at the address below.