Welches Versionsbyte erzeugt eine Base58-Codierung, die mit X beginnt?

Was ist der Wert von X in Base58?

Das Problem ist, wenn ich mich auf diese Tabelle beziehe: https://en.bitcoin.it/wiki/Base58Check_encoding

Am Ende komme ich auf D, wenn ich 30 verwendet habe, aber ich möchte X, also was ist der richtige Wert für PUBKEY_ADDRESSund (falls erforderlich)SCRIPT_ADDRESS

Dies ist mein bestehender Code:

PUBKEY_ADDRESS = 30, // The letter X (Version 1 Addr.)  
         SCRIPT_ADDRESS = 9,         
PUBKEY_ADDRESS_TEST = 56, // The Letter P (Version 0 Addr.)  
   SCRIPT_ADDRESS_TEST = 119,

Kann jemand den Wert nennen, der mir X gibt

Fragen Sie, welches Versionsbyte Quarkcoin verwendet oder welches Versionsbyte ein Präfix von X erzeugt?
Ich frage, welches Versionsbyte das Präfix von X erzeugen wird

Antworten (1)

Ich habe ein node.js-Programm geschrieben, um dies im Allgemeinen zu lösen.

var cs = require('coinstring')

var hash160L = "0000000000000000000000000000000000000000" //hash representing uncompressed
var hash160H = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" //hash representing uncompressed
function startsWith(version) {
        var hash160Buf = new Buffer(hash160L, 'hex')
        lowEnd = cs.encode(hash160Buf, version).charAt(0);
        hash160Buf = new Buffer(hash160H, 'hex')
        highEnd = cs.encode(hash160Buf, version).charAt(0);
        if(lowEnd == highEnd) {
                return lowEnd;
        } else {
                return [lowEnd, highEnd];
        }
}
var version = 0x00; //Bitcoin public address
for(var i = 0; i < 256; i++) {
        console.log(i + " will produce addresses starting with: " + startsWith(i));
}

Hier ist die Ausgabe:

0 will produce addresses starting with: 1
1 will produce addresses starting with: Q,o
2 will produce addresses starting with: o,2
3 will produce addresses starting with: 2
4 will produce addresses starting with: 2,3
5 will produce addresses starting with: 3
6 will produce addresses starting with: 3
7 will produce addresses starting with: 3,4
8 will produce addresses starting with: 4
9 will produce addresses starting with: 4,5
10 will produce addresses starting with: 5
11 will produce addresses starting with: 5
12 will produce addresses starting with: 5,6
13 will produce addresses starting with: 6
14 will produce addresses starting with: 6,7
15 will produce addresses starting with: 7
16 will produce addresses starting with: 7
17 will produce addresses starting with: 7,8
18 will produce addresses starting with: 8
19 will produce addresses starting with: 8,9
20 will produce addresses starting with: 9
21 will produce addresses starting with: 9
22 will produce addresses starting with: 9,A
23 will produce addresses starting with: A
24 will produce addresses starting with: A,B
25 will produce addresses starting with: B
26 will produce addresses starting with: B
27 will produce addresses starting with: B,C
28 will produce addresses starting with: C
29 will produce addresses starting with: C,D
30 will produce addresses starting with: D
31 will produce addresses starting with: D
32 will produce addresses starting with: D,E
33 will produce addresses starting with: E
34 will produce addresses starting with: E,F
35 will produce addresses starting with: F
36 will produce addresses starting with: F
37 will produce addresses starting with: F,G
38 will produce addresses starting with: G
39 will produce addresses starting with: G,H
40 will produce addresses starting with: H
41 will produce addresses starting with: H
42 will produce addresses starting with: H,J
43 will produce addresses starting with: J
44 will produce addresses starting with: J,K
45 will produce addresses starting with: K
46 will produce addresses starting with: K
47 will produce addresses starting with: K,L
48 will produce addresses starting with: L
49 will produce addresses starting with: L,M
50 will produce addresses starting with: M
51 will produce addresses starting with: M
52 will produce addresses starting with: M,N
53 will produce addresses starting with: N
54 will produce addresses starting with: N,P
55 will produce addresses starting with: P
56 will produce addresses starting with: P
57 will produce addresses starting with: P,Q
58 will produce addresses starting with: Q
59 will produce addresses starting with: Q,R
60 will produce addresses starting with: R
61 will produce addresses starting with: R
62 will produce addresses starting with: R,S
63 will produce addresses starting with: S
64 will produce addresses starting with: S,T
65 will produce addresses starting with: T
66 will produce addresses starting with: T
67 will produce addresses starting with: T,U
68 will produce addresses starting with: U
69 will produce addresses starting with: U,V
70 will produce addresses starting with: V
71 will produce addresses starting with: V
72 will produce addresses starting with: V,W
73 will produce addresses starting with: W
74 will produce addresses starting with: W,X
75 will produce addresses starting with: X
76 will produce addresses starting with: X
77 will produce addresses starting with: X,Y
78 will produce addresses starting with: Y
79 will produce addresses starting with: Y,Z
80 will produce addresses starting with: Z
81 will produce addresses starting with: Z
82 will produce addresses starting with: Z,a
83 will produce addresses starting with: a
84 will produce addresses starting with: a,b
85 will produce addresses starting with: b
86 will produce addresses starting with: b,c
87 will produce addresses starting with: c
88 will produce addresses starting with: c
89 will produce addresses starting with: c,d
90 will produce addresses starting with: d
91 will produce addresses starting with: d,e
92 will produce addresses starting with: e
93 will produce addresses starting with: e
94 will produce addresses starting with: e,f
95 will produce addresses starting with: f
96 will produce addresses starting with: f,g
97 will produce addresses starting with: g
98 will produce addresses starting with: g
99 will produce addresses starting with: g,h
100 will produce addresses starting with: h
101 will produce addresses starting with: h,i
102 will produce addresses starting with: i
103 will produce addresses starting with: i
104 will produce addresses starting with: i,j
105 will produce addresses starting with: j
106 will produce addresses starting with: j,k
107 will produce addresses starting with: k
108 will produce addresses starting with: k
109 will produce addresses starting with: k,m
110 will produce addresses starting with: m
111 will produce addresses starting with: m,n
112 will produce addresses starting with: n
113 will produce addresses starting with: n
114 will produce addresses starting with: n,o
115 will produce addresses starting with: o
116 will produce addresses starting with: o,p
117 will produce addresses starting with: p
118 will produce addresses starting with: p
119 will produce addresses starting with: p,q
120 will produce addresses starting with: q
121 will produce addresses starting with: q,r
122 will produce addresses starting with: r
123 will produce addresses starting with: r
124 will produce addresses starting with: r,s
125 will produce addresses starting with: s
126 will produce addresses starting with: s,t
127 will produce addresses starting with: t
128 will produce addresses starting with: t
129 will produce addresses starting with: t,u
130 will produce addresses starting with: u
131 will produce addresses starting with: u,v
132 will produce addresses starting with: v
133 will produce addresses starting with: v
134 will produce addresses starting with: v,w
135 will produce addresses starting with: w
136 will produce addresses starting with: w,x
137 will produce addresses starting with: x
138 will produce addresses starting with: x
139 will produce addresses starting with: x,y
140 will produce addresses starting with: y
141 will produce addresses starting with: y,z
142 will produce addresses starting with: z
143 will produce addresses starting with: z
144 will produce addresses starting with: z,2
145 will produce addresses starting with: 2
146 will produce addresses starting with: 2
147 will produce addresses starting with: 2
148 will produce addresses starting with: 2
149 will produce addresses starting with: 2
150 will produce addresses starting with: 2
151 will produce addresses starting with: 2
152 will produce addresses starting with: 2
153 will produce addresses starting with: 2
154 will produce addresses starting with: 2
155 will produce addresses starting with: 2
156 will produce addresses starting with: 2
157 will produce addresses starting with: 2
158 will produce addresses starting with: 2
159 will produce addresses starting with: 2
160 will produce addresses starting with: 2
161 will produce addresses starting with: 2
162 will produce addresses starting with: 2
163 will produce addresses starting with: 2
164 will produce addresses starting with: 2
165 will produce addresses starting with: 2
166 will produce addresses starting with: 2
167 will produce addresses starting with: 2
168 will produce addresses starting with: 2
169 will produce addresses starting with: 2
170 will produce addresses starting with: 2
171 will produce addresses starting with: 2
172 will produce addresses starting with: 2
173 will produce addresses starting with: 2
174 will produce addresses starting with: 2
175 will produce addresses starting with: 2
176 will produce addresses starting with: 2
177 will produce addresses starting with: 2
178 will produce addresses starting with: 2
179 will produce addresses starting with: 2
180 will produce addresses starting with: 2
181 will produce addresses starting with: 2
182 will produce addresses starting with: 2
183 will produce addresses starting with: 2
184 will produce addresses starting with: 2
185 will produce addresses starting with: 2
186 will produce addresses starting with: 2
187 will produce addresses starting with: 2
188 will produce addresses starting with: 2
189 will produce addresses starting with: 2
190 will produce addresses starting with: 2
191 will produce addresses starting with: 2
192 will produce addresses starting with: 2
193 will produce addresses starting with: 2
194 will produce addresses starting with: 2
195 will produce addresses starting with: 2
196 will produce addresses starting with: 2
197 will produce addresses starting with: 2
198 will produce addresses starting with: 2
199 will produce addresses starting with: 2
200 will produce addresses starting with: 2
201 will produce addresses starting with: 2
202 will produce addresses starting with: 2
203 will produce addresses starting with: 2
204 will produce addresses starting with: 2
205 will produce addresses starting with: 2
206 will produce addresses starting with: 2
207 will produce addresses starting with: 2
208 will produce addresses starting with: 2
209 will produce addresses starting with: 2
210 will produce addresses starting with: 2
211 will produce addresses starting with: 2
212 will produce addresses starting with: 2
213 will produce addresses starting with: 2
214 will produce addresses starting with: 2
215 will produce addresses starting with: 2
216 will produce addresses starting with: 2
217 will produce addresses starting with: 2
218 will produce addresses starting with: 2
219 will produce addresses starting with: 2
220 will produce addresses starting with: 2
221 will produce addresses starting with: 2
222 will produce addresses starting with: 2
223 will produce addresses starting with: 2
224 will produce addresses starting with: 2
225 will produce addresses starting with: 2
226 will produce addresses starting with: 2
227 will produce addresses starting with: 2
228 will produce addresses starting with: 2
229 will produce addresses starting with: 2
230 will produce addresses starting with: 2
231 will produce addresses starting with: 2
232 will produce addresses starting with: 2
233 will produce addresses starting with: 2
234 will produce addresses starting with: 2
235 will produce addresses starting with: 2
236 will produce addresses starting with: 2
237 will produce addresses starting with: 2
238 will produce addresses starting with: 2
239 will produce addresses starting with: 2
240 will produce addresses starting with: 2
241 will produce addresses starting with: 2
242 will produce addresses starting with: 2
243 will produce addresses starting with: 2
244 will produce addresses starting with: 2
245 will produce addresses starting with: 2
246 will produce addresses starting with: 2
247 will produce addresses starting with: 2
248 will produce addresses starting with: 2
249 will produce addresses starting with: 2
250 will produce addresses starting with: 2
251 will produce addresses starting with: 2
252 will produce addresses starting with: 2
253 will produce addresses starting with: 2
254 will produce addresses starting with: 2
255 will produce addresses starting with: 2

Sie können 75 oder 76 verwenden . 74 und 77 funktionieren auch, aber nur manchmal.

Tangential, warum würde zB 111 (0x6f) 2 mögliche base58-Darstellungen zurückgeben? Also m oder n
@WizardOfOzzie Weil Sie im Wesentlichen eine Basis-256-Nummer in eine Basis-58-Nummer konvertieren. Warum 2 Karten sowohl für Q als auch für O gelten, habe ich nichts.
Ah okay. Ich bin eigentlich wirklich schlecht mit Base256-Konvertierungen von einem abstrakten Standpunkt aus. Ich habe kein Problem damit, mit Hex zu arbeiten. Zu Q/o vielleicht bc Q=23, o=46 (Position in base58), da 46/2=23. Das ist eine spontane Vermutung, obwohl tbh
@WizardOfOzzie I'm actually really bad with base256 conversions [..]Dafür sind Computer da. :)