@@ -46,7 +46,6 @@ def sync_all(e1, e2):
4646 time .sleep (1 )
4747 return
4848
49-
5049## Preparations
5150
5251# Make data directories for each daemon
@@ -91,20 +90,19 @@ def sync_all(e1, e2):
9190# Alternatively, you can set validatepegin=0 in their configs and not
9291# run the bitcoin node, but it is necessary for fully validating the two way peg.
9392
94- # At beginning "immature balance" holds all funds until genesis is mature
95- # Regtest chain starts with 21M elements coins as OP_TRUE which the wallet
96- # understands. This is useful for testing basic functionality.
97- # In Elements there is no block subsidy. All 21M output value in a mainnet
98- # pegged sidechain are locked for pegging.
93+ # Regtest chain starts with 21M bitcoins as OP_TRUE which the wallet
94+ # understands. This is useful for testing basic functionality and for
95+ # blockchains that have no pegging functionality. "Policy" coins are required
96+ # for anti-DoS purposes as well as asset issuance, which consumes inputs for entropy.
97+ # In Elements there is no block subsidy. In a production sidechain it can
98+ # be configured to start with no outputs, necessitating peg-in functionality
99+ # for asset issuance.
99100e1 .getwalletinfo ()
100101
101102# In regtest mining "target" is OP_TRUE since we have not set `-signblockscript` argument
102103# Generate simply works.
103104e1 .generate (101 )
104105sync_all (e1 , e2 )
105- # Now we have 21M OP_TRUE value in each Elements wallet.
106- e1 .getwalletinfo ()
107- e2 .getwalletinfo ()
108106
109107######## WALLET ###########
110108
@@ -419,12 +417,6 @@ def sync_all(e1, e2):
419417bitcoin .generate (101 )
420418sync_all (e1 , e2 )
421419
422- # We have to lock up some of the funds first. Regtest(what we're running) has all funds as OP_TRUE
423- # but this is not the case in testnet/production. Doesn't matter where we send it
424- # inside Bitcoin, this is just a hack to lock some funds up.
425- # We can immediately grab this output from the mempool on subsequent steps
426- e1 .sendtomainchain (bitcoin .getnewaddress (), 50 )
427-
428420# Now we can actually start pegging in. Examine the pegin address fields
429421e1 .getpeginaddress ()
430422# Changes each time as it's a new sidechain address as well as new "tweak" for the watchmen keys
@@ -448,7 +440,7 @@ def sync_all(e1, e2):
448440raw = bitcoin .getrawtransaction (txid )
449441
450442# Attempt claim!
451- claimtxid = e1 .claimpegin (raw , proof , addrs ["sidechain_address " ])
443+ claimtxid = e1 .claimpegin (raw , proof , addrs ["witness_program " ])
452444sync_all (e1 , e2 )
453445
454446# Other node should accept to mempool and mine
0 commit comments