Esempio n. 1
0
 def to_addr(self, pubhex):
     assert pubhex.compressed, 'Uncompressed public keys incompatible with Segwit'
     from mmgen.protocol import hash160
     return CoinAddr(g.proto.pubhash2bech32addr(hash160(pubhex)))
Esempio n. 2
0
def Pubhex2addr(pubkeyhex): Pubhash2addr(hash160(pubkeyhex))
def Wif2hex(wif):           Msg(PrivKey(wif=wif))
Esempio n. 3
0
 def to_addr(self, pubhex):
     from mmgen.protocol import hash160
     assert type(pubhex) == PubKey
     return CoinAddr(g.proto.pubhash2addr(hash160(pubhex), p2sh=False))
Esempio n. 4
0
File: tool.py Progetto: mmgen/mmgen
	def pubhex2addr(self,pubkeyhex:'sstr'):
		"convert a hex pubkey to an address"
		if opt.type == 'segwit':
			return g.proto.pubhex2segwitaddr(pubkeyhex)
		else:
			return self.pubhash2addr(hash160(pubkeyhex))
Esempio n. 5
0
def Hash160(pubkeyhex):     Msg(hash160(pubkeyhex))
def Pubhex2addr(pubkeyhex): Pubhash2addr(hash160(pubkeyhex))
Esempio n. 6
0
def Pubhex2addr(pubkeyhex):
    Pubhash2addr(hash160(pubkeyhex))
Esempio n. 7
0
File: tool.py Progetto: mmgen/mmgen
	def hash160(self,hexstr:'sstr'):
		"compute ripemd160(sha256(data)) (convert hex pubkey to hex addr)"
		return hash160(hexstr)
Esempio n. 8
0
def Hash160(pubkeyhex):
    Msg(hash160(pubkeyhex))
Esempio n. 9
0
	def pubhex2addr(self,pubkeyhex:'sstr'):
		"convert a hex pubkey to an address"
		if opt.type == 'segwit':
			return g.proto.pubhex2segwitaddr(pubkeyhex)
		else:
			return self.pubhash2addr(hash160(pubkeyhex))
Esempio n. 10
0
	def hash160(self,hexstr:'sstr'):
		"compute ripemd160(sha256(data)) (convert hex pubkey to hex addr)"
		return hash160(hexstr)
Esempio n. 11
0
File: addr.py Progetto: mmgen/mmgen
	def to_addr(self,pubhex):
		assert pubhex.compressed,'Uncompressed public keys incompatible with Segwit'
		from mmgen.protocol import hash160
		return CoinAddr(g.proto.pubhash2bech32addr(hash160(pubhex)))
Esempio n. 12
0
File: addr.py Progetto: mmgen/mmgen
	def to_addr(self,pubhex):
		from mmgen.protocol import hash160
		assert type(pubhex) == PubKey
		return CoinAddr(g.proto.pubhash2addr(hash160(pubhex),p2sh=False))