Bitcoin Forum
April 19, 2024, 08:14:49 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bencoin - Proof of Concept  (Read 5669 times)
benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 01, 2011, 01:42:57 AM
Last edit: June 01, 2011, 03:31:55 AM by benjamindees
 #1

With all the recent talk about "Towncoins" and forks and such, I suppose now is time to introduce an idea I've been kicking around for a while.  This has evolved somewhat over the past few months.  But it is basically just a local currency backed by Bitcoins.  Originally I looked into creating actual physical paper currency.  But I've decided on a much better approach that can be completely integrated with the existing Bitcoin network, and enables a higher level of trust for all participants, while maintaining the goal of a stable currency to encourage local trade.  So far I have a general idea of an implementation based on existing Bitcoin software, and a small proof-of-concept.

So I present to you, Bencoins.  Please let me know your thoughts.

FAQ:

What is a Bencoin?

 A Bencoin is a Bitcoin private key, generated by an individual participant, that is then encrypted and deposited with a Bencoin central bank.  A Bencoin represents a Bitcoin-backed account with the local central bank.  It can be used like a checking account for local transactions.

What is Bencoin good for?

 Bencoin is useful for creating a local digital currency pegged to Bitcoins.  The economy can be limited to authorized participants.  Transactions can be processed immediately.  Later, the Bitcoin peg can be removed and the local Bencoin economy seamlessly integrated into the larger Bitcoin economy.

Why would I want to do that?

 You might want to create a local currency without forking Bitcoin, and without opening your currency up to the entire Bitcoin economy.  A local authority can maintain a peg, and adjust it's value, while still being able to remove the peg later.  Local miners can mine real Bitcoins through a central pool, contributing to the security of the Bitcoin network, while the Bitcoins generated are converted into the local Bencoin currency and distributed based on the rules of the local currency.

How is a Bitcoin peg maintained?

 The central bank can exchange Bencoins for Bitcoins at a set rate.  It can also act as a mining pool operator.  Bitcoins generated by the pool can be distributed as Bencoins at the set rate.

What are the limitations?

 Unlike Bitcoin, Bencoin is totally dependent upon a local central authority.  Bencoin transactions are not particularly anonymous.



Concept:

Central Bank
   Acts as Bencoin central authority
      Responds to account queries
      Processes Bencoin transactions
   Acts as an exchange
      Exchanges Bencoins for Bitcoins
      Maintains currency peg
   Acts as a normal Bitcoin node
      Maintains a Bitcoin address for each participant
      Reconciles Bencoin accounts with the Bitcoin network (every 24 hrs)
   Acts as a Bitcoin pool operator
      Distributes Bencoins according to local rules
Participant
   Has a single Bencoin address
      Used to authenticate transaction requests with the central bank
   Acts as a normal Bitcoin node
      Helps to strengthen the Bitcoin network
      Can verify Bencoin account balance through the Bitcoin network
      May have a Bitcoin address as well (ie savings account)
   May act as a Bencoin miner with the central bank's pool



Proof-of-Concept:

Central Bank generates the Bencoin signing keys:
   openssl genrsa 3072 >bank_prv.pem
   openssl rsa -in bank_prv.pem -pubout >bank_pub.pem
Central Bank publishes the public Bencoin signing key.
Participant generates a Bitcoin key:
   openssl ecparam -name secp256k1 -genkey >bitcoin_prv.pem
Participant encrypts the Bitcoin key with the Central Bank's public key to issue a Bencoin:
   openssl rsautl -encrypt -inkey bank_pub.pem -pubin -in bitcoin_prv.pem -out bencoin.pem
Participant deposits the Bencoin with the Central Bank.
Central Bank decrypts the Bencoin:
   openssl rsautl -decrypt -inkey bank_prv.pem -in bencoin.pem -out bitcoin_prv.pem
Central Bank imports the Bitcoin private key.



Civil Liberty Through Complex Mathematics
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713557689
Hero Member
*
Offline Offline

Posts: 1713557689

View Profile Personal Message (Offline)

Ignore
1713557689
Reply with quote  #2

1713557689
Report to moderator
grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
June 01, 2011, 01:53:15 AM
Last edit: June 01, 2011, 02:13:46 AM by grondilu
 #2

Why does the participants send their private key??  Shouldn't they send their public key instead?

Also, I doubt it is possible to deal with a bitcoin user with only one address.


Making a bitcoin-pegged currency is a fair idea.  But there are certainly much simpler ways to do so.

You might consider the loom project for instance.  Or opentransaction, LETS and other complementary currencies software.

Also, please notice I wrote some bash functions that allow to turn a openssl generated public key into a bitcoin address:

Code:
#!/bin/bash
#
# This is free and unencumbered software released into the public domain.
#
# Requires bc, dc, openssl, xxd
#

base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
bitcoinregex="^[$(printf "%s" "${base58[@]}")]{34}$"

decodeBase58() {
    local s=$1
    for i in {0..57}
    do s="${s//${base58[i]}/ $i}"
    done
    dc <<< "16o0d${s// /+58*}+f"
}

encodeBase58() {
    # 58 = 0x3A
    bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
    tac |
    while read n
    do echo -n ${base58[n]}
    done
}

checksum() {
    xxd -p -r <<<"$1" |
    openssl dgst -sha256 -binary |
    openssl dgst -sha256 -binary |
    xxd -p -c 80 |
    head -c 8
}

checkBitcoinAddress() {
    if [[ "$1" =~ $bitcoinregex ]]
    then
        h=$(decodeBase58 "$1")
        checksum "00${h::${#h}-8}" |
        grep -qi "^${h: -8}$"
    else return 2
    fi
}

hash160() {
    openssl dgst -sha256 -binary |
    openssl dgst -rmd160 -binary |
    xxd -p -c 80
}

hash160ToAddress() {
    printf "%34s\n" "$(encodeBase58 "00$1$(checksum "00$1")")" |
    sed "y/ /1/"
}

publicKeyToAddress() {
    hash160ToAddress $(
    openssl ec -pubin -pubout -outform DER |
    tail -c 65 |
    hash160
    )
}

So if you want to create a private key and see the corresponding bitcoin address, you can run:

$ openssl ecparam -name secp256k1 -genkey |tee priv.pem| openssl ec -pubout |publicKeyToAddress


benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 01, 2011, 02:06:38 AM
Last edit: June 01, 2011, 06:06:02 AM by benjamindees
 #3

The point of sending the private key is that you are sharing a Bitcoin address with the Central Bank.  You must trust the Central Bank implicitly, as long as you use it, with whatever funds are represented by the Bitcoin address.  But you can revoke the account and withdraw the (Bitcoin) funds at any time.  You can also verify the balance independently, through the Bitcoin network.  This provides a check against the Central Bank.

I will have to look further into the address issue.

e: Okay I think at most the participant may need to create two addresses.  That's no problem.

Civil Liberty Through Complex Mathematics
sacarlson
Newbie
*
Offline Offline

Activity: 38
Merit: 0



View Profile
June 02, 2011, 01:22:59 AM
 #4

I'm not sure I see much of a difference to Beertokens as seen http://forum.bitcoin.org/index.php?topic=9493.msg138247#msg138247  maybe with added escrow as I hope to add with p2p escrow in the new upcoming clients,  but before that we could use the already existing 3rd party escrow that many have already trusted to back the new currency.   Beertokens web site exchange is already up and running in test mode at http://exchange.beertokens.info and soon to open with real money with escrow deposits in about 7 more days and already has a support group of freecoin with it's multi-crypto chain support which is already working in prerelease.  Were is your web site and proof of concept software?
benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 02, 2011, 03:13:46 AM
 #5

I'm not sure I see much of a difference to Beertokens as seen http://forum.bitcoin.org/index.php?topic=9493.msg138247#msg138247

The goals are obviously similar.  I would say that this is more like a deposit-backed account with some added protections.  As I understand it, Beertokens is more like buying shares of a trust or corporation.

Further, my focus is on enabling local trade, while moving towards the goal of seamlessly integrating the local economy with the larger Bitcoin economy in the future.

Quote
Were is your web site and proof of concept software?

I'm working on a modified version of the official Bitcoin client to handle transaction processing.  One difference is that there is no need for a Bencoin block chain or miners.  The Bencoin client keeps the Bitcoin blockchain only for third-party verification purposes.  Miners operate through a pool to mine actual Bitcoins.  Other than that, and what I posted already, as Grondilu pointed out all of the other software already exists in one form or another.  I don't have a website yet.

Civil Liberty Through Complex Mathematics
AntiVigilante
Member
**
Offline Offline

Activity: 98
Merit: 10



View Profile
June 02, 2011, 10:27:12 AM
 #6

How is a Bitcoin peg maintained?

 The central bank can exchange Bencoins for Bitcoins at a set rate.  It can also act as a mining pool operator.  Bitcoins generated by the pool can be distributed as Bencoins at the set rate.

What are the limitations?

 Unlike Bitcoin, Bencoin is totally dependent upon a local central authority.  Bencoin transactions are not particularly anonymous.

Towncoin isn't dependent on a central authority. And forks are redundant.

Proposal: http://forum.bitcoin.org/index.php?topic=11541.msg162881#msg162881
Inception: https://github.com/bitcoin/bitcoin/issues/296
Goal: http://forum.bitcoin.org/index.php?topic=12536.0
Means: Code, donations, and brutal criticism. I've got a thick skin. 1Gc3xCHAzwvTDnyMW3evBBr5qNRDN3DRpq
da2ce7
Legendary
*
Offline Offline

Activity: 1222
Merit: 1016


Live and Let Live


View Profile
June 02, 2011, 01:18:09 PM
 #7

What you is doing is better solved by Open Transactions: https://github.com/FellowTraveler/Open-Transactions/

Using the bitcoin topology for a central system is not logical.

One off NP-Hard.
Dansker
Hero Member
*****
Offline Offline

Activity: 740
Merit: 500


Hello world!


View Profile
June 02, 2011, 03:50:09 PM
 #8

Too many cowboys (currencies) and not enough indians (willing users)

TraderTimm
Legendary
*
Offline Offline

Activity: 2408
Merit: 1121



View Profile
June 02, 2011, 04:54:42 PM
 #9

I'm having trouble understanding how 'Bencoins' are any different (other than the key part) than what we have now, Bitcoin to US Dollar exchanges. (And other currencies.) I don't get why we need to 'defang' this technology. Embrace it, let the power-mongers sweat their loss of control, not invent new structures for bureaucrats.

fortitudinem multis - catenum regit omnia
benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 02, 2011, 08:44:05 PM
 #10

Towncoin isn't dependent on a central authority. And forks are redundant.

I agree.  That's why Bencoin isn't a fork of the block chain, unlike Towncoin.  And for a local currency, a central authority can be a feature, not a bug.  Having a central authority means I don't have to recruit an army of miners just to secure my transactions against outside interference.

Using the bitcoin topology for a central system is not logical.

I'm only using the Bitcoin topology as a backbone, and building on it.

I'm having trouble understanding how 'Bencoins' are any different than what we have now, Bitcoin to US Dollar exchanges.  I don't get why we need to 'defang' this technology.

I don't have a Bitcoin exchange in my town.  I want to use a local currency, not Dollars.  I don't want to have to deal with bank wires to Japan and three different layers of exchanges every time I convert between them.  I don't want the concentration to be on mining and speculation and competing for the millions of Bitcoins already in existence all over the globe.  I want to enable local trade.

Civil Liberty Through Complex Mathematics
TraderTimm
Legendary
*
Offline Offline

Activity: 2408
Merit: 1121



View Profile
June 02, 2011, 10:27:34 PM
 #11

Quote
I don't have a Bitcoin exchange in my town.  I want to use a local currency, not Dollars.  I don't want to have to deal with bank wires to Japan and three different layers of exchanges every time I convert between them.  I don't want the concentration to be on mining and speculation and competing for the millions of Bitcoins already in existence all over the globe.  I want to enable local trade.

Fair enough, makes a lot of sense much like how there are many methods to implement internet connectivity or running your own webserver.

Best of luck!

fortitudinem multis - catenum regit omnia
AntiVigilante
Member
**
Offline Offline

Activity: 98
Merit: 10



View Profile
June 02, 2011, 10:37:46 PM
 #12

Towncoin isn't dependent on a central authority. And forks are redundant.

I agree.  That's why Bencoin isn't a fork of the block chain, unlike Towncoin.

Towncoin is based on bitcoin subnets, not a fork.

Quote
And for a local currency, a central authority can be a feature, not a bug.  Having a central authority means I don't have to recruit an army of miners just to secure my transactions against outside interference.

Centralization isn't security. It's just passing the buck to a single point of failure, which is vulnerable to traditional breach attacks rather than tactical attacks which can only mess with output rates. Only a challenge provides security. But towncoin is based on pools. Any GPU army coming to town will see their reward drop the minute they connect.

Quote
I'm having trouble understanding how 'Bencoins' are any different than what we have now, Bitcoin to US Dollar exchanges.  I don't get why we need to 'defang' this technology.

I don't have a Bitcoin exchange in my town.  I want to use a local currency, not Dollars.  I don't want to have to deal with bank wires to Japan and three different layers of exchanges every time I convert between them.  I don't want the concentration to be on mining and speculation and competing for the millions of Bitcoins already in existence all over the globe.  I want to enable local trade.
[/quote]

Towncoins cover all that.

Proposal: http://forum.bitcoin.org/index.php?topic=11541.msg162881#msg162881
Inception: https://github.com/bitcoin/bitcoin/issues/296
Goal: http://forum.bitcoin.org/index.php?topic=12536.0
Means: Code, donations, and brutal criticism. I've got a thick skin. 1Gc3xCHAzwvTDnyMW3evBBr5qNRDN3DRpq
benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 02, 2011, 11:02:59 PM
Last edit: June 03, 2011, 01:25:05 AM by benjamindees
 #13

Quote from: AntiVigilante
Towncoin is based on bitcoin subnets, not a fork.

Towncoins cover all that.

I do have a model on how to do this, with bitcoin no less.

I have a model just let me know, I'll write it up as a proposal.

After tomorrow expect a formal proposal.

I have a model that can work

Well I'm glad that you have this all figured out in your head and that your model does everything but bake cookies.  But I have difficulty believing that your "subnets" can easily be integrated with the mainline Bitcoin block chain.  Regardless, if you are dependent upon a mining pool, that's centralization.

Civil Liberty Through Complex Mathematics
AntiVigilante
Member
**
Offline Offline

Activity: 98
Merit: 10



View Profile
June 03, 2011, 12:51:51 AM
 #14

Regardless, if you are dependent upon a mining pool, that's centralization.

No it isn't. The pool is the town. And they use CPUs. And you can seamlessly connect to towns across the globe that have the same difficulty.

Centralization is putting it in the hands of an institution.
Centralization is making people dependent on that institution without which their newcoins are worthless.

Proposal: http://forum.bitcoin.org/index.php?topic=11541.msg162881#msg162881
Inception: https://github.com/bitcoin/bitcoin/issues/296
Goal: http://forum.bitcoin.org/index.php?topic=12536.0
Means: Code, donations, and brutal criticism. I've got a thick skin. 1Gc3xCHAzwvTDnyMW3evBBr5qNRDN3DRpq
benjamindees (OP)
Legendary
*
Offline Offline

Activity: 1330
Merit: 1000


View Profile
June 03, 2011, 01:42:19 AM
 #15

No it isn't. The pool is the town. And they use CPUs. And you can seamlessly connect to towns across the globe that have the same difficulty.

I see.  And, in your model, what are the conditions that must be met in order to integrate the local currency into the Bitcoin economy?  Difficulty must equalize?

Civil Liberty Through Complex Mathematics
FooDSt4mP
Full Member
***
Offline Offline

Activity: 182
Merit: 100


View Profile
June 03, 2011, 03:42:01 AM
 #16

No it isn't. The pool is the town. And they use CPUs. And you can seamlessly connect to towns across the globe that have the same difficulty.

I see.  And, in your model, what are the conditions that must be met in order to integrate the local currency into the Bitcoin economy?  Difficulty must equalize?

Towncoins will be exchanged for Bitcoins.  Their relative value will vary depending on what can be purchased with them.

As we slide down the banister of life, this is just another splinter in our ass.
AntiVigilante
Member
**
Offline Offline

Activity: 98
Merit: 10



View Profile
June 03, 2011, 04:51:10 AM
 #17

I see.  And, in your model, what are the conditions that must be met in order to integrate the local currency into the Bitcoin economy?  Difficulty must equalize?

Mainly the drop in difficulty is balanced by a drop in reward. Similar changes occur as the town reaches self sustaining activity. So output drops, but to make things more even we take the square root of these changes.

Proposal: http://forum.bitcoin.org/index.php?topic=11541.msg162881#msg162881
Inception: https://github.com/bitcoin/bitcoin/issues/296
Goal: http://forum.bitcoin.org/index.php?topic=12536.0
Means: Code, donations, and brutal criticism. I've got a thick skin. 1Gc3xCHAzwvTDnyMW3evBBr5qNRDN3DRpq
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!