Generate a new random keypair and return the corresponding ECKey / bytes objects. The private key can also be provided as WIF (wallet import format) string instead, which is often useful for wallet RPC interaction.
(compressed=True, wif=False)
| 87 | ) |
| 88 | |
| 89 | def generate_keypair(compressed=True, wif=False): |
| 90 | """Generate a new random keypair and return the corresponding ECKey / |
| 91 | bytes objects. The private key can also be provided as WIF (wallet |
| 92 | import format) string instead, which is often useful for wallet RPC |
| 93 | interaction.""" |
| 94 | privkey = ECKey() |
| 95 | privkey.generate(compressed) |
| 96 | pubkey = privkey.get_pubkey().get_bytes() |
| 97 | if wif: |
| 98 | privkey = bytes_to_wif(privkey.get_bytes(), compressed) |
| 99 | return privkey, pubkey |
| 100 | |
| 101 | def get_multisig(node): |
| 102 | """Generate a fresh 2-of-3 multisig on node |
no test coverage detected